zoukankan      html  css  js  c++  java
  • 在日期上加上相应天数,并在GridView上显示

    后台处理代码:

      /// <summary>
            /// 在日期上加上相应天数
            /// </summary>
            /// <param name="date"></param>
            /// <returns></returns>
            public string GetDateTime(string date)
            {
                string time = "";
                DateTime dt = Convert.ToDateTime(date).AddDays(1);
                time = dt.ToString("yyyy-MM-dd");
                return time;
            }

    前台页面内容:

    <asp:GridView ID="GridView1" runat="server" Width="98%" AutoGenerateColumns="False">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="受理号">
                                                        <ItemTemplate>
                                                            <a href='ZFDBSRY_SJSHPage.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
                                                                <%# DataBinder.Eval(Container.DataItem, "JBQKSLH") %></a>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                      <asp:TemplateField HeaderText="状态">
                                                        <ItemTemplate>
                                                            <a href='ZFDBSRY_SJSHPage.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
                                                                <%# DataBinder.Eval(Container.DataItem, "State") %></a>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                     <asp:TemplateField HeaderText="任务接收日期">
                                                        <ItemTemplate>
                                                            <a href='BSRY_JSAJPage.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
                                                                <%# DataBinder.Eval(Container.DataItem, "CreateDate", "{0:yyyy-MM-dd}")%>
                                                            </a>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="该任务完成截止日期">
                                                        <ItemTemplate>
                                                            <a href='BSRY_JSAJPage.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
                                                                <%# GetDateTime(DataBinder.Eval(Container.DataItem, "CreateDate", "{0:yyyy-MM-dd}"))%>
                                                            </a>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="总天数">
                                                        <ItemTemplate>
                                                            60
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>

  • 相关阅读:
    (1)spark核心RDD的概念解析、创建、以及相关操作
    docker常用命令
    asyncpg:异步操作PostgreSQL
    python调用golang编写的动态链接库
    使用C语言为python编写动态模块(3)--在C中实现python中的类
    使用C语言为python编写动态模块(2)--解析python中的对象如何在C语言中传递并返回
    flask的orm操作
    python下载指定的版本包
    flask 的管理模块的功能add_template_global、send_from_directory
    docker 的简单使用
  • 原文地址:https://www.cnblogs.com/ZhangGuiHai/p/2155422.html
Copyright © 2011-2022 走看看