Esempio 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();
     }
 }
Esempio 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();
        }
    }
Esempio n. 3
0
    protected void EBtnModify_Click(object sender, EventArgs e)
    {
        B_ProjectWork bprojecwork = new B_ProjectWork();
        M_ProjectWork mprojectwork = bprojecwork.SelectWorkByWID(DataConverter.CLng(HFWid.Value));// new M_ProjectWork();
        bool updatework = false;
        bool updaterole = false;
        bool deleterole=false;
        B_WorkRole bworkrole=new B_WorkRole();
        M_WorkRole mworkrole = new M_WorkRole();
        int power = 0;
        mprojectwork.WorkName = TxtWorkName.Text.Trim();
        mprojectwork.WorkIntro = TxtWorkIntro.Text.Trim();
        mprojectwork.EndDate = DataConverter.CDate(txtEndDay.Value.Trim());
        updatework=bprojecwork.UpdateProjectWork(mprojectwork);
         for (int t = 0; t < this.cblRoleList.Items.Count; t++)//先删除所有
            {
                if (this.cblRoleList.Items[t].Selected)
                {
                    deleterole=bworkrole.DelWorkRole(Convert.ToInt32(mprojectwork.WorkID));
                    t=this.cblRoleList.Items.Count-1;
                }
            }

        for (int t = 0; t < this.cblRoleList.Items.Count; t++)//再添加
            {
                power = Convert.ToInt32(this.cblRoleList.Items[t].Value);
                if (this.cblRoleList.Items[t].Selected)
                {
                    mworkrole.RoleID = power;
                    mworkrole.WorkID = bprojecwork.GetMaxWorkID(DataConverter.CLng(mprojectwork.ProjectID));// GetMaxWorkID(int projectid).ge;
                    updaterole = bworkrole.AddWorkRole(mworkrole);;
                }
            }
        if (updatework)// && deleterole && updaterole
        {
            Response.Write("<script language=javascript> alert('内容修改成功!');window.document.location.href='WorkManage.aspx?Pid=" + mprojectwork.ProjectID+ "';</script>");
        }
    }
Esempio n. 4
0
    public void InitPage()
    {
        int wid = 0;

        M_ProjectWork mprojectwork = new M_ProjectWork();
        B_ProjectWork bprojectwork = new B_ProjectWork();
        if (Request.QueryString["wid"] != null)
        {
            wid = DataConverter.CLng(Request.QueryString["wid"].Trim());
            mprojectwork = bprojectwork.SelectWorkByWID(wid);
            this.m_pid = mprojectwork.ProjectID;
            LblProIntro.Text = mprojectwork.WorkName.ToString();
            LblProName.Text = bpro.GetProjectByid(Convert.ToInt32(mprojectwork.ProjectID)).ProjectName.ToString();
        }
        if (this.m_uid > 0)
        {
            muser = buser.SeachByID(this.m_uid);
            if (muser.UserName != null)
                TxtUserName.Text = muser.UserName.ToString();
            else
                TxtUserName.Text="佚名";
        }
    }
Esempio n. 5
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     int power=0;
     bool addwork = false;
     bool workrole = false;
     M_ProjectWork mprojectwork = new M_ProjectWork();
     B_ProjectWork bprojecwork=new B_ProjectWork();
     M_WorkRole mworkrole = new M_WorkRole();
     B_WorkRole bworkrole=new B_WorkRole();
     if (Request.QueryString["Pid"] != null)
     {
         mprojectwork.WorkName = TxtWorkName.Text.Trim();
         mprojectwork.WorkIntro = TxtWorkIntro.Text.Trim();
         mprojectwork.ProjectID = DataConverter.CLng(Request.QueryString["pid"].Trim());
         mprojectwork.Approving = 0;//默认值
         mprojectwork.Status = 0;
         mprojectwork.EndDate = DataConverter.CDate(txtEndDay.Value.Trim());
         addwork = bprojecwork.AddProjectWork(mprojectwork);
         for (int t = 0; t < this.cblRoleList.Items.Count; t++)
         {
             power = Convert.ToInt32(this.cblRoleList.Items[t].Value);
             if (this.cblRoleList.Items[t].Selected)
             {
                 mworkrole.RoleID = power;
                 mworkrole.WorkID = bprojecwork.GetMaxWorkID(DataConverter.CLng(Request.QueryString["Pid"].Trim()));// GetMaxWorkID(int projectid).ge;
                 workrole = bworkrole.AddWorkRole(mworkrole);
             }
         }
         if (addwork)//&&&& workrole
         {
             Response.Write("<script language=javascript> alert('内容添加成功!');window.document.location.href='WorkManage.aspx?Pid=" + mprojectwork.ProjectID + "';</script>");
         }
     }
 }