private int m_uid = 1; //测试用 #endregion Fields #region Methods protected void EBtnSubmit_Click(object sender, EventArgs e) { string strusername = TxtUserName.Text.Trim(); string strcontent = TxtRequireContent.Text.Trim(); B_ClientRequire bclientrequire = new B_ClientRequire(); M_ClientRequire mrequire=new M_ClientRequire(); mrequire.Require=strcontent; mrequire.UserID=this.m_uid; mrequire.ReuqireDate=DateTime.Now; if (bclientrequire.Add(mrequire)) { Response.Write("<script language=javascript> alert('添加成功!');window.document.location.href='ProjectList.aspx';</script>"); } }
private SqlParameter[] GetParameters(M_ClientRequire ClientRequireinfo) { SqlParameter[] parameter = new SqlParameter[] { new SqlParameter("@RequireID", SqlDbType.Int), new SqlParameter("@UserID", SqlDbType.Int), new SqlParameter("@Require", SqlDbType.NText,16), new SqlParameter("@ReuqireDate", SqlDbType.DateTime,8), }; parameter[0].Value = ClientRequireinfo.RequireID; parameter[1].Value = ClientRequireinfo.UserID; parameter[2].Value = ClientRequireinfo.Require; parameter[3].Value = ClientRequireinfo.ReuqireDate; return parameter; }
public bool Update(M_ClientRequire CRinfo) { return dal.Add(CRinfo); }
public bool Update(M_ClientRequire ClientRequireinfo) { SqlParameter[] cmdParams = GetParameters(ClientRequireinfo); ; return SqlHelper.ExecuteProc("PR_ClientRequire_Update", cmdParams); }
public bool Add(M_ClientRequire ClientRequireinfo) { string strSql = "PR_ClientRequire_Add"; SqlParameter[] parameter = GetParameters(ClientRequireinfo); return SqlHelper.ExecuteProc(strSql, parameter); }