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="佚名"; } }
public void InitPage() { if (Request.QueryString["Pid"] != null)//这项目添加内容 { LblTitleAdd.Visible = true; LblTitleModify.Visible = false; TxtProjectName.Text = bproject.GetProjectByid(Convert.ToInt32(Request.QueryString["Pid"].Trim())).ProjectName; Bind(); } if (Request.QueryString["Wid"] != null)//修改内容 { LblTitleAdd.Visible = false; LblTitleModify.Visible = true; HFWid.Value = Request.QueryString["Wid"].Trim(); mprojectwork=bprojectwork.SelectWorkByWID(DataConverter.CLng(Request.QueryString["Wid"].Trim())); TxtProjectName.Text = bproject.GetProjectByid(Convert.ToInt32(mprojectwork.ProjectID.ToString())).ProjectName; TxtWorkName.Text = mprojectwork.WorkName; TxtWorkIntro.Text=mprojectwork.WorkIntro; txtEndDay.Value = mprojectwork.EndDate.ToShortDateString(); Bind(); ArrayList alistrole = bworkrole.GetWorkRole(DataConverter.CLng(HFWid.Value)); for (int i=0; i < alistrole.Count;i++ ) { int j=DataConverter.CLng(alistrole[i]); for (int p = 0; p < cblRoleList.Items.Count; p++) { if (j == Convert.ToInt32(cblRoleList.Items[p].Value)) { cblRoleList.Items[p].Selected = true; } } } EBtnSubmit.Visible = false; EBtnModify.Visible = true; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "FinishWork": this.mprojectwork=this.bllwork.SelectWorkByWID(Convert.ToInt32(e.CommandArgument)); int i = this.mprojectwork.WorkID; this.mprojectwork.Status=1; this.mprojectwork.EndDate = DateTime.Now; this.bllwork.UpdateProjectWork(this.mprojectwork); MyBind(); break; case "EditWork": Response.Redirect("AddWork.aspx?Wid=" + Convert.ToInt32(e.CommandArgument) + ""); break; case "DelWork": string Id = e.CommandArgument.ToString(); this.bllwork.DelProWorByID(DataConverter.CLng(Id)); //this.bprodis.DelProjectDiscuss(//项目内容删除时关键的讨论也应删除 MyBind(); break; } }
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>"); } } }
public bool UpdateProjectWork(M_ProjectWork m_projwork) { return ProjectWorkMethod.UpdateProjectWork(m_projwork); }
public bool AddProjectWork(M_ProjectWork m_projwork) { return ProjectWorkMethod.AddProjectWork(m_projwork); }
public bool AddProjectWork(M_ProjectWork m_projwork) { string strSql = "PR_ProjectWork_Add"; SqlParameter[] cmdParams = GetParameters(m_projwork); return SqlHelper.ExecuteProc(strSql, cmdParams); }
private M_ProjectWork GetProjectWorkInfoFromReader(SqlDataReader reader) { M_ProjectWork info = new M_ProjectWork(); info.WorkID = DataConverter.CLng(reader["WorkID"]); info.WorkName =reader["WorkName"].ToString(); info.WorkIntro = reader["WorkIntro"].ToString(); info.ProjectID =DataConverter.CLng(reader["ProjectID"]); info.Approving =DataConverter.CLng(reader["Approving"].ToString()); info.Status = DataConverter.CLng(reader["Status"].ToString().Trim()); info.EndDate =DataConverter.CDate(reader["EndDate"].ToString().Trim()); return info; }
private static SqlParameter[] GetParameters(M_ProjectWork m_projwork) { SqlParameter[] parameter = new SqlParameter[] { new SqlParameter("@WorkID", SqlDbType.Int, 4), new SqlParameter("@WorkName",SqlDbType.NVarChar,255), new SqlParameter("@WorkIntro", SqlDbType.NText), new SqlParameter("@ProjectID", SqlDbType.Int, 4), new SqlParameter("@Approving", SqlDbType.Int, 4), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@EndDate", SqlDbType.DateTime,8) }; parameter[0].Value = m_projwork.WorkID; parameter[1].Value = m_projwork.WorkName; parameter[2].Value = m_projwork.WorkIntro; parameter[3].Value = m_projwork.ProjectID; parameter[4].Value = m_projwork.Approving; parameter[5].Value = m_projwork.Status; parameter[6].Value = m_projwork.EndDate; return parameter; }