Exemplo n.º 1
0
 public void MyBind()
 {
     B_ProjectWork bprojectwork = new B_ProjectWork();
     if (Request.QueryString["Pid"] != null)
     {
         int Pid = DataConverter.CLng(Request.QueryString["Pid"].Trim());//2;
         mproject=bproject.GetProjectByid(Pid);
         DataView dv = bprojectwork.SelectWorkByPID(Pid);
         this.m_projectname = mproject.ProjectName;
         this.Egv.DataSource = dv;
         this.Egv.DataKeyNames = new string[] { "WorkID" };
         this.Egv.DataBind();
     }
     else
     {
         DataTable dt = bprojectwork.GetProjectWorkAll();
         this.Egv.DataSource = dt;
         this.Egv.DataBind();
     }
 }
Exemplo n.º 2
0
    public void InitPage()
    {
        B_Project bpro = new B_Project();
        B_ProjectWork bwork=new B_ProjectWork();
        M_Project mpro = new M_Project();
        StringBuilder strbul = new StringBuilder();
        int rid = 0;
        if (Request.QueryString["pid"] != null)
        {
            rid = DataConverter.CLng(Request.QueryString["pid"].Trim());
            mpro = bpro.GetProjectByid(rid);
            LblProName.Text = mpro.ProjectName;
            LblProIntro.Text = mpro.ProjectIntro;
            LblStartDate.Text = mpro.StartDate.ToShortDateString();
            if (mpro.EndDate.ToShortDateString() == DateTime.MaxValue.ToShortDateString())
            {
                LblEndDate.Text = "";
            }
            else
            {
                LblEndDate.Text = mpro.EndDate.ToShortDateString();
            }

            DataView dv=bwork.SelectWorkByPID(rid);
            if (dv.Table.Rows.Count > 0)
            {
                foreach (DataRow dr in dv.Table.Rows)
                {
                    strbul.Append("<a href='DiscussList.aspx?wid=" + dr["WorkID"] + "&pid=" + Request.QueryString["pid"] + "'>" + dr["WorkName"] + "</a>&nbsp;&nbsp;<a href='DiscussList.aspx?wid=" + dr["WorkID"] + "&pid=" + Request.QueryString["pid"] + "'>查看讨论</a><br/>");

                }
            }
            else
            {
                strbul.Append("暂无工作内容!");
            }

            LblContent.Text = strbul.ToString();
        }
    }