public bool UpdateIOTimeComm(CMSMStruct.CommStruct cos) { int recount = opa.UpdateIOTimeComm(cos); if (recount <= 0) { return(false); } else { return(true); } }
protected void btIg_Click(object sender, System.EventArgs e) { CMSMStruct.CommStruct cos = new CMSMStruct.CommStruct(); if (txtFee.Text.Trim() == "") { cos.strCommName = "0"; } else if (double.Parse(txtFee.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("消费金额不能小于0!"); return; } else { cos.strCommName = txtFee.Text.Trim(); } if (txtIg.Text.Trim() == "") { cos.strCommCode = "0"; } else if (double.Parse(txtIg.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("赠送积分分值不能小于0!"); return; } else { cos.strCommCode = txtIg.Text.Trim(); } cos.strCommSign = "IG"; cos.strComments = "积分赠送"; Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; m1 = new Manager(strcons); if (m1.UpdateIgComm(cos)) { this.SetSuccMsgPageBydir("消费积分设置成功!", "paraconf/wfmSysParaSet.aspx"); return; } else { this.SetErrorMsgPageBydir("消费积分设置失败!"); return; } }
public int UpdateFillPromComm(Hashtable htp) { con.Open(); using (SqlTransaction tran = con.BeginTransaction()) { try { string sql1 = ""; string sql2 = ""; for (int i = 1; i <= htp.Count; i++) { CMSMStruct.CommStruct cos = (CMSMStruct.CommStruct)htp["FP" + i]; sql1 = "select count(*) from tbCommCode where vcCommSign='" + cos.strCommSign + "'"; SqlDataReader drr = SqlHelper.ExecuteReader(con, tran, CommandType.Text, sql1); drr.Read(); string strCount = drr[0].ToString(); drr.Close(); if (strCount == "0") { sql2 = "insert into tbCommCode values('" + cos.strCommName + "','" + cos.strCommCode + "','" + cos.strCommSign + "','" + cos.strComments + "')"; } else { sql2 = "update tbCommCode set vcCommCode='" + cos.strCommCode + "' where vcCommSign='" + cos.strCommSign + "'"; } SqlHelper.ExecuteNonQuery(con, tran, CommandType.Text, sql2); } tran.Commit(); } catch (Exception e) { tran.Rollback(); clog.WriteLine(e); return(0); } finally { if (con.State == ConnectionState.Open) { con.Close(); } } return(1); } }
private void setPromHt(Hashtable htpar, TextBox txt, string commName, string commSign) { CMSMStruct.CommStruct cos = new CMSMStruct.CommStruct(); if (txt.Text.Trim() == "") { cos.strCommCode = "0"; } else if (double.Parse(txt.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("充值赠款比例不能小于0!"); return; } else { cos.strCommCode = txt.Text.Trim(); } cos.strCommName = commName; cos.strCommSign = commSign; cos.strComments = "充值赠款"; htpar.Add(commSign, cos); }
public ArrayList DownSysPara() { DataTable dtPara = new DataTable(); ArrayList alPara = new ArrayList(); string sql1 = "select * from tbCommCode where vcCommSign<>'LOCAL' order by vcCommSign,vcCommCode"; dtPara = SqlHelper.ExecuteDataTable(con, CommandType.Text, sql1); for (int i = 0; i < dtPara.Rows.Count; i++) { CMSMStruct.CommStruct paratmp = new CMSMStruct.CommStruct(); paratmp.strCommName = dtPara.Rows[i]["vcCommName"].ToString(); paratmp.strCommCode = dtPara.Rows[i]["vcCommCode"].ToString(); paratmp.strCommSign = dtPara.Rows[i]["vcCommSign"].ToString(); paratmp.strComments = dtPara.Rows[i]["vcComments"].ToString(); alPara.Add(paratmp); } if (con.State == ConnectionState.Open) { con.Close(); } return(alPara); }
protected void btProm_Click(object sender, System.EventArgs e) { CMSMStruct.CommStruct cos = new CMSMStruct.CommStruct(); Hashtable htpar = new Hashtable(); if (txtPromRate1.Text.Trim() == "") { cos.strCommCode = "0"; } else if (double.Parse(txtPromRate1.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("充值赠款比例不能小于0!"); return; } else { cos.strCommCode = txtPromRate1.Text.Trim(); } cos.strCommName = "充值赠款100-500"; cos.strCommSign = "FP1"; cos.strComments = "充值赠款"; htpar.Add("FP1", cos); CMSMStruct.CommStruct cos2 = new CMSMStruct.CommStruct(); if (txtPromRate2.Text.Trim() == "") { cos2.strCommCode = "0"; } else if (double.Parse(txtPromRate2.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("充值赠款比例不能小于0!"); return; } else { cos2.strCommCode = txtPromRate2.Text.Trim(); } cos2.strCommName = "充值赠款500-1000"; cos2.strCommSign = "FP2"; cos2.strComments = "充值赠款"; htpar.Add("FP2", cos2); CMSMStruct.CommStruct cos3 = new CMSMStruct.CommStruct(); if (txtPromRate3.Text.Trim() == "") { cos3.strCommCode = "0"; } else if (double.Parse(txtPromRate3.Text.Trim()) < 0) { this.SetErrorMsgPageBydir("充值赠款比例不能小于0!"); return; } else { cos3.strCommCode = txtPromRate3.Text.Trim(); } cos3.strCommName = "充值赠款1000以上"; cos3.strCommSign = "FP3"; cos3.strComments = "充值赠款"; htpar.Add("FP3", cos3); Hashtable htapp = (Hashtable)Application["appconf"]; string strcons = (string)htapp["cons"]; m1 = new Manager(strcons); if (m1.UpdateFillPromComm(htpar)) { this.SetSuccMsgPageBydir("消费积分设置成功!", "paraconf/wfmSysParaSet.aspx"); return; } else { this.SetErrorMsgPageBydir("消费积分设置失败!"); return; } }