protected void Button1_Click(object sender, EventArgs e) { if (this.Page.IsValid) { string vCode = this.Session["ValidateCode"].ToString(); if (string.IsNullOrEmpty(vCode)) { function.WriteErrMsg("<li>验证码无效,请刷新验证码重新登录</li>"); } if (string.Compare(this.TxtCode.Text.Trim(), vCode, true) != 0) { function.WriteErrMsg("<li>验证码不正确</li>"); } M_Correct info = new M_Correct(); info.CorrectID = 0; info.CorrectTitle = this.lblTitle.Text; info.CorrectUrl = this.lblUrl.Text; info.CorrectType = DataConverter.CLng(this.RBLType.SelectedValue); info.CorrectDetail = this.TxtDetail.Text; info.CorrectPer = this.TxtPer.Text; info.CorrectEmail = this.TxtEmail.Text; B_Correct bll = new B_Correct(); bll.Add(info); function.WriteSuccessMsg("纠错报告成功记录,谢谢您的参与!"); } }
private static SqlParameter[] GetParameters(M_Correct Info) { SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@CorrectID", SqlDbType.Int), new SqlParameter("@CorrectTitle", SqlDbType.NVarChar,255), new SqlParameter("@CorrectUrl", SqlDbType.NVarChar,255), new SqlParameter("@CorrectType", SqlDbType.Int), new SqlParameter("@CorrectDetail", SqlDbType.NVarChar,255), new SqlParameter("@CorrectPer", SqlDbType.NVarChar,50), new SqlParameter("@CorrectEmail", SqlDbType.NVarChar,50) }; sp[0].Value = Info.CorrectID; sp[1].Value = Info.CorrectTitle; sp[2].Value = Info.CorrectUrl; sp[3].Value = Info.CorrectType; sp[4].Value = Info.CorrectDetail; sp[5].Value = Info.CorrectPer; sp[6].Value = Info.CorrectEmail; return sp; }
void ID_Correct.Add(M_Correct info) { string strSql = "PR_Correct_Add"; SqlParameter[] sp = GetParameters(info); SqlHelper.ExecuteProc(strSql, sp); }
public void Add(M_Correct info) { dal.Add(info); }