protected void EBtnSubmit_Click(object sender, EventArgs e) { M_ProjectDiscuss mpro=new M_ProjectDiscuss(); B_ProjectDiscuss bpro=new B_ProjectDiscuss(); mpro.ProjectID=DataConverter.CLng(Request.QueryString["pid"].Trim()); mpro.WorkID=DataConverter.CLng(Request.QueryString["wid"].Trim()); mpro.UserID=this.m_uid; mpro.Content = TxtDisContent.Text.ToString(); mpro.DiscussDate = DateTime.Now; if(bpro.AddProjectDiscuss(mpro)) { Response.Write("<script language=javascript> alert('讨论发布成功!');window.document.location.href='DiscussList.aspx?wid=" + Request.QueryString["wid"].Trim() + "&pid=" + Request.QueryString["pid"].Trim() + "';</script>"); } }
private SqlParameter[] GetParameters(M_ProjectDiscuss ProjectDiscuss) { SqlParameter[] parameter = new SqlParameter[] { new SqlParameter("@DiscussID", SqlDbType.Int,4), new SqlParameter("@ProjectID", SqlDbType.Int,4), new SqlParameter("@WorkID", SqlDbType.Int,4), new SqlParameter("@UserID", SqlDbType.Int,4), new SqlParameter("@Content", SqlDbType.NText), new SqlParameter("@DiscussDate",SqlDbType.DateTime,8) }; parameter[0].Value = ProjectDiscuss.DiscussID; parameter[1].Value = ProjectDiscuss.ProjectID; parameter[2].Value = ProjectDiscuss.WorkID; parameter[3].Value = ProjectDiscuss.UserID; parameter[4].Value = ProjectDiscuss.Content; parameter[5].Value = ProjectDiscuss.DiscussDate; return parameter; }
public bool UpdateProjectDiscuss(M_ProjectDiscuss ProjectDiscuss) { string strSql = "PR_ProjectDiscuss_Update"; SqlParameter[] cmdParams = GetParameters(ProjectDiscuss); return SqlHelper.ExecuteProc(strSql, cmdParams); }
public bool AddProjectDiscuss(M_ProjectDiscuss ProjectDiscuss) { string strSql = "PR_ProjectDiscuss_Add"; SqlParameter[] parameter = GetParameters(ProjectDiscuss); return SqlHelper.ExecuteProc(strSql, parameter); }
public bool UpdateProjectDiscuss(M_ProjectDiscuss ProjectDiscuss) { return dal.UpdateProjectDiscuss(ProjectDiscuss); }
public bool AddProjectDiscuss(M_ProjectDiscuss ProjectDiscuss) { return dal.AddProjectDiscuss(ProjectDiscuss); }