Ejemplo 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();
     }
 }
Ejemplo 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();
        }
    }
Ejemplo n.º 3
0
 public string CountRate(int projectid)
 {
     int result = 0;
     int FinishCount = this.bllwork.CountFinishWork(projectid);
     if (FinishCount == 0)
         return "0%";
     else
     {
         result = FinishCount * 100 / CountWork(projectid);
         this.mproject = this.bll.GetProjectByid(projectid);
         if (result == 100)
         {
             this.mproject.Status = 1;
         }
         else
         {
             this.mproject.Status = 0;
         }
         this.bll.Update(this.mproject);
         return result+"%";
     }
 }
Ejemplo n.º 4
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     M_Project mproject=new M_Project();
     mproject.ProjectName=TxtProjectName.Text.Trim();
     mproject.ProjectIntro=TxtProjectIntro.Text.Trim();
     mproject.StartDate=DataConverter.CDate(tbUBday.Value.Trim());
     if (!string.IsNullOrEmpty(txtEndDay.Value.Trim()))
         mproject.EndDate = DataConverter.CDate(txtEndDay.Value.Trim());
     else
         mproject.EndDate=DateTime.MaxValue;//new DateTime();
     mproject.Uid = this.m_uid;
     mproject.Status = 0;
     if (Request.QueryString["rid"] != null)
         mproject.RequireID = DataConverter.CLng(Request.QueryString["rid"].Trim());
     else
         mproject.RequireID = 0;//无需求ID也可以由管理员自己添加项目
     B_Project bproject=new B_Project();
     if (bproject.Add(mproject))
     {
         Response.Write("<script language=javascript> alert('项目添加成功!');window.document.location.href='ProjectManage.aspx';</script>");
     }
 }
Ejemplo n.º 5
0
 public bool Update(M_Project m_Project)
 {
     return dal.Update(m_Project);
 }
Ejemplo n.º 6
0
 public bool Add(M_Project projectInfo)
 {
     return dal.Add(projectInfo);
 }
Ejemplo n.º 7
0
 public bool Add(M_Project m_project)
 {
     string strSql = "PR_Project_Add";
     SqlParameter[] parameter = GetParameters(m_project);
     return SqlHelper.ExecuteProc(strSql, parameter);
 }
Ejemplo n.º 8
0
 private M_Project GetProjectInfoFromReader(SqlDataReader reader)
 {
     M_Project info = new M_Project();
     info.ProjectID = DataConverter.CLng(reader["ProjectID"].ToString());
     info.ProjectName = reader["ProjectName"].ToString();
     info.ProjectIntro = reader["ProjectIntro"].ToString();
     info.RequireID = DataConverter.CLng(reader["RequireID"].ToString());
     info.Uid = DataConverter.CLng(reader["UserID"].ToString());
     info.StartDate = DataConverter.CDate(reader["StartDate"]);
     info.EndDate = DataConverter.CDate(reader["EndDate"]);
     info.Status = DataConverter.CLng(reader["Status"]);
     return info;
 }
Ejemplo n.º 9
0
        private SqlParameter[] GetParameters(M_Project m_project)
        {
            SqlParameter[] parameter = new SqlParameter[] {
                new SqlParameter("@ProjectID", SqlDbType.Int),
                new SqlParameter("@ProjectName", SqlDbType.NVarChar,255),
                new SqlParameter("@ProjectIntro", SqlDbType.NText,16),
                new SqlParameter("@RequireID", SqlDbType.Int,4),
                new SqlParameter("@StartDate", SqlDbType.DateTime,8),
                new SqlParameter("@EndDate", SqlDbType.DateTime,8),
                new SqlParameter("@Status", SqlDbType.Int,4),
                new SqlParameter("@UserID", SqlDbType.Int,4)

            };
            parameter[0].Value = m_project.ProjectID;
            parameter[1].Value = m_project.ProjectName;
            parameter[2].Value = m_project.ProjectIntro;
            parameter[3].Value = m_project.RequireID;
            parameter[4].Value = m_project.StartDate;
            parameter[5].Value = m_project.EndDate;
            parameter[6].Value = m_project.Status;
            parameter[7].Value = m_project.Uid;
            return parameter;
        }
Ejemplo n.º 10
0
 public bool Update(M_Project m_project)
 {
     SqlParameter[] cmdParams = GetParameters(m_project); ;
     return SqlHelper.ExecuteProc("PR_Project_Update", cmdParams);
 }