/// <summary> /// 得到一个对象实体 /// </summary> public REL_Question_ChartMod GetModel(int SysNo) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SysNo, Question_SysNo, Chart_SysNo from REL_Question_Chart"); strSql.Append(" where SysNo=@SysNo "); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int, 4) }; parameters[0].Value = SysNo; REL_Question_ChartMod model = new REL_Question_ChartMod(); DataSet ds = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "") { model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString()); } if (ds.Tables[0].Rows[0]["Question_SysNo"].ToString() != "") { model.Question_SysNo = int.Parse(ds.Tables[0].Rows[0]["Question_SysNo"].ToString()); } if (ds.Tables[0].Rows[0]["Chart_SysNo"].ToString() != "") { model.Chart_SysNo = int.Parse(ds.Tables[0].Rows[0]["Chart_SysNo"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(REL_Question_ChartMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into REL_Question_Chart("); strSql.Append("Question_SysNo,Chart_SysNo)"); strSql.Append(" values ("); strSql.Append("@Question_SysNo,@Chart_SysNo)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@Question_SysNo",SqlDbType.Int,4), new SqlParameter("@Chart_SysNo",SqlDbType.Int,4), }; if (model.Question_SysNo != AppConst.IntNull) parameters[0].Value = model.Question_SysNo; else parameters[0].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[0]); if (model.Chart_SysNo != AppConst.IntNull) parameters[1].Value = model.Chart_SysNo; else parameters[1].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[1]); return SqlHelper.ExecuteNonQuery(cmd,parameters); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(REL_Question_ChartMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update REL_Question_Chart set "); strSql.Append("Question_SysNo=@Question_SysNo,"); strSql.Append("Chart_SysNo=@Chart_SysNo"); strSql.Append(" where SysNo=@SysNo "); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int, 4), new SqlParameter("@Question_SysNo", SqlDbType.Int, 4), new SqlParameter("@Chart_SysNo", SqlDbType.Int, 4) }; if (model.SysNo != AppConst.IntNull) { parameters[0].Value = model.SysNo; } else { parameters[0].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[0]); if (model.Question_SysNo != AppConst.IntNull) { parameters[1].Value = model.Question_SysNo; } else { parameters[1].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[1]); if (model.Chart_SysNo != AppConst.IntNull) { parameters[2].Value = model.Chart_SysNo; } else { parameters[2].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[2]); return(SqlHelper.ExecuteNonQuery(cmd, parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(REL_Question_ChartMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into REL_Question_Chart("); strSql.Append("Question_SysNo,Chart_SysNo)"); strSql.Append(" values ("); strSql.Append("@Question_SysNo,@Chart_SysNo)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@Question_SysNo", SqlDbType.Int, 4), new SqlParameter("@Chart_SysNo", SqlDbType.Int, 4), }; if (model.Question_SysNo != AppConst.IntNull) { parameters[0].Value = model.Question_SysNo; } else { parameters[0].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[0]); if (model.Chart_SysNo != AppConst.IntNull) { parameters[1].Value = model.Chart_SysNo; } else { parameters[1].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[1]); return(SqlHelper.ExecuteNonQuery(cmd, parameters)); }
public ReturnValue<USR_CustomerShow> AddQuestionWithChart(Stream openPageData) { QA_QuestionInput<FATE_ChartMod> input; //try //{ int nReadCount = 0; MemoryStream ms = new MemoryStream(); byte[] buffer = new byte[1024]; while ((nReadCount = openPageData.Read(buffer, 0, 1024)) > 0) { ms.Write(buffer, 0, nReadCount); } byte[] byteJson = ms.ToArray(); string textJson = System.Text.Encoding.UTF8.GetString(byteJson); input = XMS.Core.Json.JsonSerializer.Deserialize<QA_QuestionInput<FATE_ChartMod>>(textJson); if (input == null) { throw new BusinessException("参数有误"); } //} //catch (Exception ex) //{ // throw ex; //} #region 判断输入项 if (input.CateSysNo == 0 || input.CateSysNo == AppConst.IntNull) { throw new BusinessException("请选择分类"); } if (input.Title.DoTrim() == "") { throw new BusinessException("请输入标题"); } if (input.Title.DoTrim().Length > 30) { throw new BusinessException("您输入的标题太长,请控制在30字以内"); } int point = USR_CustomerBll.GetInstance().GetModel(input.CustomerSysNo).Point; if (input.Award > point && point != AppConst.IntNull) { throw new BusinessException("您最多可用" + point + "积分"); } #endregion //try //{ QA_QuestionMod m_quest = new QA_QuestionMod(); m_quest.Award = input.Award; m_quest.CateSysNo = input.CateSysNo; m_quest.Context = SQLData.SQLFilter(AppCmn.CommonTools.StringFilter(input.Context)); m_quest.CustomerSysNo = input.CustomerSysNo; m_quest.LastReplyTime = DateTime.Now; m_quest.ReplyCount = 0; m_quest.ReadCount = 0; m_quest.BuyCount = 0; m_quest.OrderCount = 0; m_quest.Title = AppCmn.CommonTools.SystemInputFilter(input.Title); m_quest.TS = DateTime.Now; m_quest.DR = (int)AppEnum.State.normal; int sysno = 0; QA_QuestionBll.GetInstance().AddQuest(ref m_quest, true); sysno = m_quest.SysNo; if (input.Chart.Count > 0) { FATE_ChartMod m_chart = new FATE_ChartMod(); m_chart.CharType = input.Chart[0].CharType; ; if (m_chart.CharType != (int)AppEnum.ChartType.nochart) { m_chart.FirstBirth = input.Chart[0].FirstBirth; m_chart.FirstPoi = input.Chart[0].FirstPoi; m_chart.Transit = DateTime.Now; m_chart.TransitPoi = input.Chart[0].FirstPoi; m_chart.TheoryType = 0; m_chart.FirstPoiName = input.Chart[0].FirstPoiName; m_chart.FirstTimeZone = -8; m_chart.FirstGender = input.Chart[0].FirstGender; m_chart.FirstDayLight = input.Chart[0].FirstDayLight; if (m_chart.CharType == (int)AppEnum.ChartType.relation) { m_chart.SecondBirth = input.Chart[0].SecondBirth; m_chart.SecondPoi = input.Chart[0].SecondPoi; m_chart.SecondPoiName = input.Chart[0].SecondPoiName; m_chart.SecondTimeZone = -8; m_chart.SecondGender = input.Chart[0].SecondGender; m_chart.SecondDayLight = input.Chart[0].SecondDayLight; } m_chart.TS = DateTime.Now; m_chart.DR = (int)AppEnum.State.normal; int fatesysno = FATE_ChartBll.GetInstance().Add(m_chart); REL_Question_ChartMod m_qchart = new REL_Question_ChartMod(); m_qchart.Chart_SysNo = fatesysno; m_qchart.Question_SysNo = sysno; REL_Question_ChartBll.GetInstance().Add(m_qchart); } } //} //catch (Exception ex) //{ // throw ex; //} USR_CustomerShow ret = new USR_CustomerShow(); USR_CustomerBll.GetInstance().GetModel(input.CustomerSysNo).MemberwiseCopy(ret); return ReturnValue<USR_CustomerShow>.Get200OK(ret); }
protected void Unnamed3_Click(object sender, EventArgs e) { Login(Request.Url.ToString()); #region 判断输入项 if (drpCate.SelectedIndex == 0) { CateTip.InnerHtml = "请选择分类"; CateTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } if (txtTitle.Text.Trim() == "") { TitleTip.InnerHtml = "请输入标题"; TitleTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } if (txtTitle.Text.Trim().Length > 200) { TitleTip.InnerHtml = "您输入的标题太长,请控制在200字以内"; TitleTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } #endregion try { QA_QuestionMod m_quest = new QA_QuestionMod(); m_quest.Award = 0; m_quest.CateSysNo = int.Parse(drpCate.SelectedValue); m_quest.Context = SQLData.SQLFilter(AppCmn.CommonTools.StringFilter(txtContext.Text.Trim())); m_quest.CustomerSysNo = GetSession().CustomerEntity.SysNo; m_quest.LastReplyTime = DateTime.Now; m_quest.ReplyCount = 0; m_quest.ReadCount = 0; m_quest.BuyCount = 0; m_quest.OrderCount = 0; m_quest.Title = AppCmn.CommonTools.SystemInputFilter(txtTitle.Text.Trim()); m_quest.TS = DateTime.Now; m_quest.DR = (int)AppEnum.State.normal; int sysno = 0; QA_QuestionBll.GetInstance().AddQuest(ref m_quest, false); sysno = m_quest.SysNo; RefreshSession(); FATE_ChartMod m_chart = new FATE_ChartMod(); m_chart.CharType = int.Parse(drpType.SelectedValue); if (m_chart.CharType != (int)AppEnum.ChartType.nochart) { m_chart.FirstBirth = DatePicker1.SelectedTime; m_chart.FirstPoi = District1.lng + "|" + District1.lat; m_chart.Transit = DateTime.Now; m_chart.TransitPoi = m_chart.FirstPoi; m_chart.TheoryType = 0; m_chart.FirstPoiName = District1.Area1Name + "-" + District1.Area2Name + "-" + District1.Area3Name; m_chart.FirstTimeZone = -8; m_chart.FirstGender = int.Parse(drpGender1.SelectedValue); if (chkDaylight1.Checked) { m_chart.FirstDayLight = (int)AppEnum.BOOL.True; } else { m_chart.FirstDayLight = (int)AppEnum.BOOL.False; } if (m_chart.CharType == (int)AppEnum.ChartType.relation) { m_chart.SecondBirth = DatePicker2.SelectedTime; m_chart.SecondPoi = District2.lng + "|" + District2.lat; m_chart.SecondPoiName = District2.Area1Name + "-" + District2.Area2Name + "-" + District2.Area3Name; m_chart.SecondTimeZone = -8; m_chart.SecondGender = int.Parse(drpGender2.SelectedValue); if (chkDaylight2.Checked) { m_chart.SecondDayLight = (int)AppEnum.BOOL.True; } else { m_chart.SecondDayLight = (int)AppEnum.BOOL.False; } } m_chart.TS = DateTime.Now; m_chart.DR = (int)AppEnum.State.normal; int fatesysno = FATE_ChartBll.GetInstance().Add(m_chart); REL_Question_ChartMod m_qchart = new REL_Question_ChartMod(); m_qchart.Chart_SysNo = fatesysno; m_qchart.Question_SysNo = sysno; REL_Question_ChartBll.GetInstance().Add(m_qchart); } LogManagement.getInstance().WriteTrace("前台话题", "Ask", "IP:" + Request.UserHostAddress + "|UID:" + GetSession().CustomerEntity.Email); Page.ClientScript.RegisterStartupScript(this.GetType(), "askok", "alert('话题发布成功!');", true); Response.Redirect(AppConfig.HomeUrl() + "Quest/Topic/" + sysno, false); } catch (Exception ex) { LogManagement.getInstance().WriteException(ex, "QA-Add", Request.UserHostAddress, "发布话题失败"); Page.ClientScript.RegisterStartupScript(this.GetType(), "askok", "alert('系统故障,请联系管理员!');", true); } }
/// <summary> /// 更新一条数据 /// </summary> public void Update(REL_Question_ChartMod model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(REL_Question_ChartMod model) { return dal.Add(model); }
protected void Unnamed3_Click(object sender, EventArgs e) { Login(Request.Url.ToString()); #region 判断输入项 if (drpCate.SelectedIndex == 0) { CateTip.InnerHtml = "请选择分类"; CateTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } if (txtTitle.Text.Trim() == "") { TitleTip.InnerHtml = "请输入标题"; TitleTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } if (txtTitle.Text.Trim().Length > 200) { TitleTip.InnerHtml = "您输入的标题太长,请控制在200字以内"; TitleTip.Attributes["class"] = "err"; Page.ClientScript.RegisterStartupScript(this.GetType(), "typemodify", "qaTypeChanged(document.getElementById('" + drpType.ClientID + "'));", true); return; } #endregion try { QA_QuestionMod m_quest = new QA_QuestionMod(); m_quest.Award = 0; m_quest.CateSysNo = int.Parse(drpCate.SelectedValue); m_quest.Context = SQLData.SQLFilter(AppCmn.CommonTools.StringFilter(txtContext.Text.Trim())); m_quest.CustomerSysNo = GetSession().CustomerEntity.SysNo; m_quest.LastReplyTime = DateTime.Now; m_quest.ReplyCount = 0; m_quest.ReadCount = 0; m_quest.BuyCount = 0; m_quest.OrderCount = 0; m_quest.Title = AppCmn.CommonTools.SystemInputFilter(txtTitle.Text.Trim()); m_quest.TS = DateTime.Now; m_quest.DR = (int)AppEnum.State.normal; int sysno = 0; QA_QuestionBll.GetInstance().AddQuest(ref m_quest,false); sysno = m_quest.SysNo; RefreshSession(); FATE_ChartMod m_chart = new FATE_ChartMod(); m_chart.CharType = int.Parse(drpType.SelectedValue); if (m_chart.CharType != (int)AppEnum.ChartType.nochart) { m_chart.FirstBirth = DatePicker1.SelectedTime; m_chart.FirstPoi = District1.lng + "|" + District1.lat; m_chart.Transit = DateTime.Now; m_chart.TransitPoi = m_chart.FirstPoi; m_chart.TheoryType = 0; m_chart.FirstPoiName = District1.Area1Name + "-" + District1.Area2Name + "-" + District1.Area3Name; m_chart.FirstTimeZone = -8; m_chart.FirstGender = int.Parse(drpGender1.SelectedValue); if (chkDaylight1.Checked) { m_chart.FirstDayLight = (int)AppEnum.BOOL.True; } else { m_chart.FirstDayLight = (int)AppEnum.BOOL.False; } if (m_chart.CharType == (int)AppEnum.ChartType.relation) { m_chart.SecondBirth = DatePicker2.SelectedTime; m_chart.SecondPoi = District2.lng + "|" + District2.lat; m_chart.SecondPoiName = District2.Area1Name + "-" + District2.Area2Name + "-" + District2.Area3Name; m_chart.SecondTimeZone = -8; m_chart.SecondGender = int.Parse(drpGender2.SelectedValue); if (chkDaylight2.Checked) { m_chart.SecondDayLight = (int)AppEnum.BOOL.True; } else { m_chart.SecondDayLight = (int)AppEnum.BOOL.False; } } m_chart.TS = DateTime.Now; m_chart.DR = (int)AppEnum.State.normal; int fatesysno = FATE_ChartBll.GetInstance().Add(m_chart); REL_Question_ChartMod m_qchart = new REL_Question_ChartMod(); m_qchart.Chart_SysNo = fatesysno; m_qchart.Question_SysNo = sysno; REL_Question_ChartBll.GetInstance().Add(m_qchart); } LogManagement.getInstance().WriteTrace("前台话题", "Ask", "IP:" + Request.UserHostAddress + "|UID:" + GetSession().CustomerEntity.Email); Page.ClientScript.RegisterStartupScript(this.GetType(), "askok", "alert('话题发布成功!');", true); Response.Redirect(AppConfig.HomeUrl()+"Quest/Topic/" + sysno,false); } catch (Exception ex) { LogManagement.getInstance().WriteException(ex, "QA-Add", Request.UserHostAddress, "发布话题失败"); Page.ClientScript.RegisterStartupScript(this.GetType(), "askok", "alert('系统故障,请联系管理员!');", true); } }
public ReturnValue <USR_CustomerShow> AddQuestionWithChart(Stream openPageData) { QA_QuestionInput <FATE_ChartMod> input; //try //{ int nReadCount = 0; MemoryStream ms = new MemoryStream(); byte[] buffer = new byte[1024]; while ((nReadCount = openPageData.Read(buffer, 0, 1024)) > 0) { ms.Write(buffer, 0, nReadCount); } byte[] byteJson = ms.ToArray(); string textJson = System.Text.Encoding.UTF8.GetString(byteJson); input = XMS.Core.Json.JsonSerializer.Deserialize <QA_QuestionInput <FATE_ChartMod> >(textJson); if (input == null) { throw new BusinessException("参数有误"); } //} //catch (Exception ex) //{ // throw ex; //} #region 判断输入项 if (input.CateSysNo == 0 || input.CateSysNo == AppConst.IntNull) { throw new BusinessException("请选择分类"); } if (input.Title.DoTrim() == "") { throw new BusinessException("请输入标题"); } if (input.Title.DoTrim().Length > 30) { throw new BusinessException("您输入的标题太长,请控制在30字以内"); } int point = USR_CustomerBll.GetInstance().GetModel(input.CustomerSysNo).Point; if (input.Award > point && point != AppConst.IntNull) { throw new BusinessException("您最多可用" + point + "积分"); } #endregion //try //{ QA_QuestionMod m_quest = new QA_QuestionMod(); m_quest.Award = input.Award; m_quest.CateSysNo = input.CateSysNo; m_quest.Context = SQLData.SQLFilter(AppCmn.CommonTools.StringFilter(input.Context)); m_quest.CustomerSysNo = input.CustomerSysNo; m_quest.LastReplyTime = DateTime.Now; m_quest.ReplyCount = 0; m_quest.ReadCount = 0; m_quest.BuyCount = 0; m_quest.OrderCount = 0; m_quest.Title = AppCmn.CommonTools.SystemInputFilter(input.Title); m_quest.TS = DateTime.Now; m_quest.DR = (int)AppEnum.State.normal; int sysno = 0; QA_QuestionBll.GetInstance().AddQuest(ref m_quest, true); sysno = m_quest.SysNo; if (input.Chart.Count > 0) { FATE_ChartMod m_chart = new FATE_ChartMod(); m_chart.CharType = input.Chart[0].CharType;; if (m_chart.CharType != (int)AppEnum.ChartType.nochart) { m_chart.FirstBirth = input.Chart[0].FirstBirth; m_chart.FirstPoi = input.Chart[0].FirstPoi; m_chart.Transit = DateTime.Now; m_chart.TransitPoi = input.Chart[0].FirstPoi; m_chart.TheoryType = 0; m_chart.FirstPoiName = input.Chart[0].FirstPoiName; m_chart.FirstTimeZone = -8; m_chart.FirstGender = input.Chart[0].FirstGender; m_chart.FirstDayLight = input.Chart[0].FirstDayLight; if (m_chart.CharType == (int)AppEnum.ChartType.relation) { m_chart.SecondBirth = input.Chart[0].SecondBirth; m_chart.SecondPoi = input.Chart[0].SecondPoi; m_chart.SecondPoiName = input.Chart[0].SecondPoiName; m_chart.SecondTimeZone = -8; m_chart.SecondGender = input.Chart[0].SecondGender; m_chart.SecondDayLight = input.Chart[0].SecondDayLight; } m_chart.TS = DateTime.Now; m_chart.DR = (int)AppEnum.State.normal; int fatesysno = FATE_ChartBll.GetInstance().Add(m_chart); REL_Question_ChartMod m_qchart = new REL_Question_ChartMod(); m_qchart.Chart_SysNo = fatesysno; m_qchart.Question_SysNo = sysno; REL_Question_ChartBll.GetInstance().Add(m_qchart); } } //} //catch (Exception ex) //{ // throw ex; //} USR_CustomerShow ret = new USR_CustomerShow(); USR_CustomerBll.GetInstance().GetModel(input.CustomerSysNo).MemberwiseCopy(ret); return(ReturnValue <USR_CustomerShow> .Get200OK(ret)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(REL_Question_ChartMod model) { return(dal.Add(model)); }
/// <summary> /// 得到一个对象实体 /// </summary> public REL_Question_ChartMod GetModel(int SysNo) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SysNo, Question_SysNo, Chart_SysNo from REL_Question_Chart"); strSql.Append(" where SysNo=@SysNo "); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int,4 ) }; parameters[0].Value = SysNo; REL_Question_ChartMod model = new REL_Question_ChartMod(); DataSet ds = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "") { model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString()); } if (ds.Tables[0].Rows[0]["Question_SysNo"].ToString() != "") { model.Question_SysNo = int.Parse(ds.Tables[0].Rows[0]["Question_SysNo"].ToString()); } if (ds.Tables[0].Rows[0]["Chart_SysNo"].ToString() != "") { model.Chart_SysNo = int.Parse(ds.Tables[0].Rows[0]["Chart_SysNo"].ToString()); } return model; } else { return null; } }
/// <summary> /// 更新一条数据 /// </summary> public int Update(REL_Question_ChartMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update REL_Question_Chart set "); strSql.Append("Question_SysNo=@Question_SysNo,"); strSql.Append("Chart_SysNo=@Chart_SysNo"); strSql.Append(" where SysNo=@SysNo "); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@SysNo",SqlDbType.Int,4), new SqlParameter("@Question_SysNo",SqlDbType.Int,4), new SqlParameter("@Chart_SysNo",SqlDbType.Int,4) }; if (model.SysNo != AppConst.IntNull) parameters[0].Value = model.SysNo; else parameters[0].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[0]); if (model.Question_SysNo != AppConst.IntNull) parameters[1].Value = model.Question_SysNo; else parameters[1].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[1]); if (model.Chart_SysNo != AppConst.IntNull) parameters[2].Value = model.Chart_SysNo; else parameters[2].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[2]); return SqlHelper.ExecuteNonQuery(cmd, parameters); }