/// <summary> /// 导出excel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Download_Click(object sender, System.EventArgs e) { DataTable dt1 = DAL.DBHelper.ExecuteDataTable("select Balancemoney-happenmoney as qcje," + ViewState["PageColumn"].ToString() + " from " + ViewState["table"].ToString() + " where " + ViewState["condition"].ToString()); if (dt1.Rows.Count == 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("000053", "没有数据,不能导出Excel!") + "')</script>"); return; } DataTable dt = new DataTable(); dt = dt1.Clone(); dt.Columns["kmtype"].DataType = typeof(String); foreach (DataRow r in dt1.Rows) { DataRow newrow = dt.NewRow(); newrow["Number"] = r["Number"]; newrow["kmtype"] = D_AccountBLL.GetKmtype(r["kmtype"].ToString()); newrow["happentime"] = DateTime.Parse(r["happentime"].ToString()).AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours()).ToString(); newrow["qcje"] = r["qcje"]; newrow["happenmoney"] = r["happenmoney"]; newrow["Balancemoney"] = r["Balancemoney"]; newrow["remark"] = r["remark"]; dt.Rows.Add(newrow); } Excel.OutToExcel(dt, GetTran("007130", "服务机构报单账户明细"), new string[] { "number=" + GetTran("001195", "编号"), "kmtype=" + GetTran("006615", "科目"), "happentime=" + GetTran("006581", "发生时间"), "qcje=" + GetTran("006605", "期初金额"), "happenmoney=" + GetTran("006582", "发生金额"), "Balancemoney=" + GetTran("006583", "账户余额"), "remark=" + GetTran("006616", "摘要") }); }
/// <summary> /// 导出excel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Download_Click(object sender, System.EventArgs e) { DataTable dt1 = DAL.DBHelper.ExecuteDataTable("select Balancemoney-happenmoney as qcje," + ViewState["PageColumn"].ToString() + " from " + ViewState["table"].ToString() + " where " + ViewState["condition"].ToString()); if (dt1.Rows.Count == 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("000053", "没有数据,不能导出Excel!") + "')</script>"); return; } DataTable dt = new DataTable(); dt = dt1.Clone(); dt.Columns["kmtype"].DataType = typeof(String); foreach (DataRow r in dt1.Rows) { DataRow newrow = dt.NewRow(); newrow["Number"] = r["Number"]; newrow["kmtype"] = D_AccountBLL.GetKmtype(r["kmtype"].ToString()); newrow["happentime"] = GetHDate(r["happentime"].ToString()); newrow["qcje"] = r["qcje"]; newrow["happenmoney"] = r["happenmoney"]; newrow["Balancemoney"] = r["Balancemoney"]; newrow["remark"] = getMark(r["remark"].ToString()); dt.Rows.Add(newrow); } if (this.RadioButtonList1.SelectedValue == "0") { Excel.OutToExcel(dt, GetTran("010005", "消费账户明细"), new string[] { "number=" + GetTran("001195", "编号"), "kmtype=" + GetTran("006615", "科目"), "happentime=" + GetTran("006581", "发生时间"), "qcje=" + GetTran("006605", "期初金额"), "happenmoney=" + GetTran("006582", "发生金额"), "Balancemoney=" + GetTran("006583", "账户余额"), "remark=" + GetTran("006616", "摘要") }); } else if (this.RadioButtonList1.SelectedValue == "1") { Excel.OutToExcel(dt, GetTran("010006", "可用石斛积分账户明细"), new string[] { "number=" + GetTran("001195", "编号"), "kmtype=" + GetTran("006615", "科目"), "happentime=" + GetTran("006581", "发生时间"), "qcje=" + GetTran("006605", "期初金额"), "happenmoney=" + GetTran("006582", "发生金额"), "Balancemoney=" + GetTran("006583", "账户余额"), "remark=" + GetTran("006616", "摘要") }); } else if (this.RadioButtonList1.SelectedValue == "4") { Excel.OutToExcel(dt, GetTran("010007", "投资石斛积分账户明细"), new string[] { "number=" + GetTran("001195", "编号"), "kmtype=" + GetTran("006615", "科目"), "happentime=" + GetTran("006581", "发生时间"), "qcje=" + GetTran("006605", "期初金额"), "happenmoney=" + GetTran("006582", "发生金额"), "Balancemoney=" + GetTran("006583", "账户余额"), "remark=" + GetTran("006616", "摘要") }); } else if (this.RadioButtonList1.SelectedValue == "5") { Excel.OutToExcel(dt, GetTran("010008", "奖励石斛积分账户明细"), new string[] { "number=" + GetTran("001195", "编号"), "kmtype=" + GetTran("006615", "科目"), "happentime=" + GetTran("006581", "发生时间"), "qcje=" + GetTran("006605", "期初金额"), "happenmoney=" + GetTran("006582", "发生金额"), "Balancemoney=" + GetTran("006583", "账户余额"), "remark=" + GetTran("006616", "摘要") }); } }
/// <summary> /// 删除复消单 /// </summary> public string DelOredrAgain(string orderId, double totalPv, string number, int except, string storeId) { double totalMoney = AddOrderDataDAL.GetTotalMoneyByOrderId(orderId); MemberOrderModel order = MemberOrderDAL.GetMemberOrder(orderId); string info = null; using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecordtran(tran, orderId); //添加日志,修改前记录原来数据 //如果该订单不存在 if (!BrowsememberordersDAL.CheckOrderIdExists(orderId)) { info = BLL.Translation.Translate("001661", "抱歉,该订单不存在!"); tran.Rollback(); conn.Close(); return(info); } if (order.DefrayState == 1) { if (totalMoney > 0) { D_AccountBLL.AddAccount(storeId, totalMoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金扣添加,订单号为【" + orderId + "】", tran); if (order.DefrayType == 2) { IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.TotalMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单删除现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单删除现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } int result = addOrderDataDAL.Js_delfuxiao(number, totalPv, except, 1, tran); } //删除复消单 addOrderDataDAL.Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); cl_h_info.DeletedIntoLogstran(tran, BLL.CommonClass.ChangeCategory.store1, orderId, BLL.CommonClass.ENUM_USERTYPE.objecttype5);//插入日志 tran.Commit(); } catch { info = BLL.Translation.Translate("000417", "删除失败!"); tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } return(info); }
protected void BtnConfirm_Click(object sender, EventArgs e) { type = 0; getMemberInfo(); DataTable dt = D_AccountBLL.GetAllMemberAccountMoney(); if (dt != null && dt.Rows.Count > 0) { Label1.Text = "现金账户余额总计:<font color='red'>" + dt.Rows[0]["TotalMoney"].ToString() + "</font>"; Label2.Text = "报单账户余额总计:<font color='red'>" + dt.Rows[0]["TotalOrderMoney"].ToString() + "</font>"; } }
protected void Page_Load(object sender, EventArgs e) { Permissions.ComRedirect(Page, Permissions.redirUrl); Permissions.CheckManagePermission(EnumCompanyPermission.CustomerQureyMember); Response.Cache.SetExpires(DateTime.Now); sphours = Convert.ToInt32(Session["WTH"]); if (!IsPostBack) { if (Request.QueryString["dd"] != null && Request.QueryString["dd"] != "") { type = 1; } CommonDataBLL.BindQishuList(this.DropDownExpectNum, true); getMemberInfo(); DataTable dt = D_AccountBLL.GetAllMemberAccountMoney(); if (dt != null && dt.Rows.Count > 0) { Label1.Text = "现金账户余额总计:<font color='red'>" + dt.Rows[0]["TotalMoney"].ToString() + "</font>"; Label2.Text = "报单账户余额总计:<font color='red'>" + dt.Rows[0]["TotalOrderMoney"].ToString() + "</font>"; } } Translations(); }
public static bool QPOrders(Model.QuickPay.quickPayParames qpp) { string ExSql = string.Empty; bool flag = false; string notify_id = qpp.DealId; string TotalMoney = Convert.ToString(qpp.PayAmount / 100); //定单额 string hkid = qpp.OrderId; //如果是汇款 string BankId = qpp.BankId; //银行代码 string body = qpp.ProductDesc; //商品描述 string orderID = qpp.OrderId; //如果是订单支付 Model.Enum_RemittancesType RemitType = (Model.Enum_RemittancesType) int.Parse(qpp.Ext1); SqlParameter[] spas = new SqlParameter[] { new SqlParameter("@PayWay", SqlDbType.Int), new SqlParameter("@Remittancesid", SqlDbType.NVarChar, 20), new SqlParameter("@PayExpectNum", SqlDbType.Int), new SqlParameter("@ReceivablesDate", SqlDbType.DateTime) }; spas[0].Value = 4; spas[1].Value = qpp.OrderId; spas[2].Value = BLL.CommonClass.CommonDataBLL.getMaxqishu(); spas[3].Value = DateTime.Now; int var = 0; SqlTransaction tran = null; SqlConnection con = DAL.DBHelper.SqlCon(); try { con.Open(); tran = con.BeginTransaction(); if (RemitType == Model.Enum_RemittancesType.enum_StoreRemittance) { Model.RemittancesModel model = BLL.MoneyFlows.RemittancesBLL.GetRemitByHuidan(qpp.OrderId); string type = ""; ExSql = "update Remittances set IsGSQR=1,PayWay=@PayWay,PayExpectNum=@PayExpectNum,ReceivablesDate=@ReceivablesDate where Remittancesid=@Remittancesid"; switch (model.Use) { case 1: type = string.Format("TotalAccountMoney = TotalAccountMoney+{0}", TotalMoney); break; case 2: type = string.Format("TurnOverMoney=TurnOverMoney+{0}", TotalMoney); break; case 3: type = string.Format("TotalInvestMoney=TotalInvestMoney+{0}", TotalMoney); break; case 4: type = string.Format("OtherMoney=OtherMoney+{0}", TotalMoney); break; } string upstore = ""; if (type != "") { upstore = string.Format(" update StoreInfo set {0} where StoreID='{1}'", type, model.RemitNumber); } else { flag = false; tran.Rollback(); return(flag); } ExSql += upstore; //加入对账单 D_AccountBLL.AddAccount(model.RemitNumber, double.Parse(TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.RechargeByOnline, DirectionEnum.AccountsIncreased, BLL.Translation.Translate("006712", "店铺快钱支付"), tran); } else if (RemitType == Model.Enum_RemittancesType.enum_MemberRemittance) { ExSql = "update MemberRemittances set IsGSQR=1,PayWay=@PayWay,PayExpectNum=@PayExpectNum,ReceivablesDate=@ReceivablesDate where Remittancesid=@Remittancesid"; Model.RemittancesModel model = BLL.MoneyFlows.RemittancesBLL.GetMemberRemittances(qpp.OrderId); string upmember = string.Format(" update MemberInfo set TotalRemittances = TotalRemittances+{0} where Number='{1}'", TotalMoney, model.RemitNumber); ExSql += upmember; D_AccountBLL.AddAccount(model.RemitNumber, double.Parse(model.RemitMoney.ToString()), D_AccountSftype.MemberType, D_AccountKmtype.RechargeByOnline, DirectionEnum.AccountsIncreased, BLL.Translation.Translate("006713", "会员快钱支付"), tran); } var = DAL.DBHelper.ExecuteNonQuery(tran, ExSql, spas, CommandType.Text); if (var > 0) { flag = true; tran.Commit(); } else { flag = false; tran.Rollback(); } } catch (Exception ex) { flag = false; tran.Rollback(); } return(flag); }
//double money = 0.0; protected void DataGrid1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //money += double.Parse((e.Row.FindControl("Label1") as Label).Text); if (e.Row.Cells[18].Text.ToLower() == "true") { e.Row.Cells[18].Text = GetTran("000233", "是"); } else { e.Row.Cells[18].Text = GetTran("000235", "否"); } e.Row.Attributes.Add("onmouseover", "bg=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bg"); ((Label)e.Row.FindControl("lbl_num")).Text = Convert.ToString(e.Row.RowIndex + 1); e.Row.Cells[5].Text = CommonDataBLL.GetLanguageStr(int.Parse(e.Row.Cells[5].Text), "Currency", "Name"); e.Row.Cells[17].Text = CommonDataBLL.GetLanguageStr(int.Parse(e.Row.Cells[17].Text), "Currency", "Name"); //switch (e.Row.Cells[5].Text) //{ // case "1": e.Row.Cells[5].Text = "美元"; break; // case "2": e.Row.Cells[5].Text = "人民币"; break; // case "3": e.Row.Cells[5].Text = "泰珠"; break; // case "4": e.Row.Cells[5].Text = "英磅"; break; // default: e.Row.Cells[5].Text = ""; break; //} switch (e.Row.Cells[6].Text) { case "0": e.Row.Cells[6].Text = GetTran("000000", "会员现金账户"); break; case "1": e.Row.Cells[6].Text = GetTran("000000", "会员消费账户"); break; case "10": e.Row.Cells[6].Text = GetTran("000000", "店铺订货款"); break; case "11": e.Row.Cells[6].Text = GetTran("000000", "店铺周转款"); break; default: e.Row.Cells[6].Text = ""; break; } //switch (e.Row.Cells[10].Text) //{ // case "1": e.Row.Cells[10].Text = GetTran("000643", "传真"); break; // case "2": e.Row.Cells[10].Text = GetTran("000644", "核实"); break; // case "3": e.Row.Cells[10].Text = GetTran("000646", "电话"); break; // case "4": e.Row.Cells[10].Text = GetTran("000647", "透支"); break; //} //switch (e.Row.Cells[8].Text) //{ // case "0": e.Row.Cells[8].Text = GetTran("005962", "公司录入"); break; // case "1": e.Row.Cells[8].Text = GetTran("001582", "银行汇款"); break; // case "2": e.Row.Cells[8].Text = GetTran("005963", "在线支付"); break; // case "3": e.Row.Cells[8].Text = GetTran("005964", "奖金转入"); break; //} e.Row.Cells[8].Text = D_AccountBLL.GetPaymentstr((PaymentEnum)int.Parse(e.Row.Cells[8].Text)); //e.Row.Cells[8].Text = CommonDataBLL.GetpaymentName(int.Parse(e.Row.Cells[8].Text), 1); e.Row.Cells[2].Text = Encryption.Encryption.GetDecipherName(e.Row.Cells[2].Text); //解密店长姓名 e.Row.Cells[15].Text = Encryption.Encryption.GetDecipherName(e.Row.Cells[15].Text); //解密汇款人 if (e.Row.Cells[7].Text != "") { try { e.Row.Cells[7].Text = DateTime.Parse(e.Row.Cells[7].Text).AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours()).ToShortDateString(); } catch { } } if (e.Row.Cells[12].Text != "") { try { e.Row.Cells[12].Text = DateTime.Parse(e.Row.Cells[12].Text).AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours()).ToShortDateString(); } catch { } } } //if (e.Row.RowType == DataControlRowType.Footer) //{ // //double total = 0; // //foreach (DataRow row in dt.Rows) // //{ // // total += double.Parse(row["RemitMoney"].ToString()); // //} // e.Row.Cells[0].Text = GetTran("000630", "合计"); // e.Row.Cells[4].Text = getstr(money.ToString()); //} }
/// <summary> /// 转账 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnE_Click(object sender, EventArgs e) { //设置特定值防止重复提交 hid_fangzhi.Value = "0"; //判断会员账户是否被冻结 if (MemberInfoDAL.CheckState(Session["Member"].ToString())) { Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用电子转账');window.location.href='First.aspx';</script>"); return; } ECTransferDetailModel detailmodel = new ECTransferDetailModel(); try { //验证金额是否合法 double money = 0.0; if (!double.TryParse(this.txtEmoney.Text.Trim(), out money)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('金额必须是数字,请重新输入!');</script>"); return; } //验证是否输入金额 if (this.txtEmoney.Text.Length <= 0 || money <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须大于0!');</script>"); return; } //验证输入金额是否是10的倍数 decimal mony = Convert.ToDecimal(this.txtEmoney.Text); if (mony % 10 != 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须是10的倍数');</script>"); return; } double Cash = 0; //可用FTC账户 double Declarations = 0; //消费账户 ECRemitDetailBLL.GetCashDeclarations(Session["Member"].ToString(), out Cash, out Declarations); int level2 = 0; double djq = 0; string ssql = "select level2,fuxiaoin-fuxiaoout+fuxiaothin-fuxiaothout as djq from MemberInfoBalance" + CommonDataBLL.getMaxqishu() + " a ,MemberInfo b where a.number=b.Number and a.number='" + Session["Member"].ToString() + "'"; DataTable dts = DAL.DBHelper.ExecuteDataTable(ssql); if (dts.Rows.Count > 0) { level2 = Convert.ToInt16(dts.Rows[0]["Level2"].ToString()); djq = Convert.ToDouble(dts.Rows[0]["djq"].ToString()); } double jdjy = 0; if (level2 > 0) { if (Convert.ToDouble(Cash) + djq > 30000) { jdjy = (Convert.ToDouble(Cash) + djq) - 30000; if (jdjy > Convert.ToDouble(Cash)) { jdjy = Convert.ToDouble(Cash); } } else { jdjy = 0; } Cash = jdjy; } //验证转账金额最大值 if (RadioButtonList1.SelectedValue == "1" && money > Cash) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须小于当前FTC可用账户最大可转金额!');</script>"); return; } else if (RadioButtonList1.SelectedValue == "3" && money > Declarations) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前消费账户最大可转金额!") + "');</script>"); return; } else if (RadioButtonList1.SelectedValue == "2") { double bd = 0; string sql = "select pointBIn-pointBOut as bd from MemberInfo where number='" + Session["Member"].ToString() + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { bd = Convert.ToDouble(shj.Rows[0][0].ToString()); if (money > bd) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前报单账户最大可转金额!") + "');</script>"); return; } } } else if (RadioButtonList1.SelectedValue == "4") { double bd = 0; double xj = 0; string sql = "select zzye-xuhao as bd,Jackpot-Out as xj from MemberInfo where number='" + Session["Member"].ToString() + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { bd = Convert.ToDouble(shj.Rows[0][0].ToString()); xj = Convert.ToDouble(shj.Rows[0][1].ToString()); if (money > bd) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前保险账户最大可转金额!") + "');</script>"); return; } if (xj > 10) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "可用FTC使用完才可以操作保险账户转账!") + "');</script>"); return; } } } string number = ""; if (RadioButtonList1.SelectedValue == "1" || RadioButtonList1.SelectedValue == "4") { string sql = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入111!')</script>"); return; } string GetError1 = new AjaxClass().CheckNumberNetTui(number, lbEnum.Text.Trim()); string GetError2 = new AjaxClass().CheckNumberNetTui(lbEnum.Text.Trim(), number); if (RadioButtonList1.SelectedValue == "1" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != ""))) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false); return; } if (RadioButtonList1.SelectedValue == "4" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != ""))) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false); return; } //验证转入编号 if (number == "") { ScriptHelper.SetAlert(Page, "编号不能为空!"); return; } } else { number = Session["Member"].ToString(); } string lll = Request.Form["rad_Inzh"]; string llll = rad_Outzh.SelectedValue; //验证会员是否自己给自己转入现金账户 if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "1") { ScriptHelper.SetAlert(Page, "自己不能转入自己的FTC账户"); return; } //验证会员是否自己给自己转入消费账户 //if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "3") //{ // ScriptHelper.SetAlert(Page, GetTran("000000", "自己不能转入自己的消费积分账户")); // return; //} //验证会员转入账户是否服务机构订货款和转入编号是否服务机构编号 //if (Request.Form["rad_Inzh"] == "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from storeinfo where storeid= '" + txt_InNumber.Text.Trim() + "'") <= 0) //{ // ScriptHelper.SetAlert(Page, GetTran("007696", "转入服务机构订货款,转入编号必须是服务机构编号")); // return; //} //else if (Request.Form["rad_Inzh"] != "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from memberinfo where number= '" + txt_InNumber.Text.Trim() + "'") <= 0) //{ // ScriptHelper.SetAlert(Page, GetTran("007697", "转入编号不正确,请重新填写!")); // return; //} //验证备注do if (this.txtEnote.Text.Length > 500) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您输入的字符超出最大范围!');</script>"); return; } //验证密码 非空 //if (this.txtEpwd.Text.Trim() == "") //{ // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006662", "请输入二级密码!") + "');</script>"); // return; //} ////验证电子账户密码是否正确 //string word = Encryption.Encryption.GetEncryptionPwd(this.txtEpwd.Text.Trim(), this.lbEnum.Text.Trim()); //int blean = ECRemitDetailBLL.ValidatePwd(Session["Member"].ToString(), word); //if (blean == 1) //{ // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001554", "电子账户密码不正确!") + "');", true); // return; //} //else if (blean == 2) //{ // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("007162", "对不起,您连续5次输入密码错,请2小时候在登录!") + "');", true); // return; //} //是否收到款项 if (!cboyishd.Checked) { ScriptHelper.SetAlert(Page, "请先确认是否收到该会员支付的上数金额!"); return; } detailmodel.OutNumber = Session["Member"].ToString(); detailmodel.OutMoney = double.Parse(this.txtEmoney.Text.Trim()); detailmodel.ExpectNum = CommonDataBLL.getMaxqishu(); detailmodel.OperateIP = CommonDataBLL.OperateIP; // 获取ip detailmodel.OperateNumber = Session["Member"].ToString(); // 获取当前会员编号 detailmodel.Remark = this.txtEnote.Text.Trim(); if (RadioButtonList1.SelectedValue == "1") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberCash; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "2") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberBD; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "3") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberCons; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "4") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberTypeFx; detailmodel.inAccountType = InAccountType.MemberTypeFx; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请输入正确的参数!');</script>"); } SqlTransaction tran = null; SqlConnection conn = DAL.DBHelper.SqlCon(); conn.Open(); tran = conn.BeginTransaction(); try { if (detailmodel.outAccountType == OutAccountType.MemberCash && detailmodel.inAccountType == InAccountType.MemberCash) { string number = ""; string sql = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); detailmodel.InNumber = number; } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入222!')</script>"); return; } //对会员现金账户转入会员现金账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 1, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员可用FTC账户转入" + txt_InNumber.Text.Trim() + "~会员保险账户", tran); string st = "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员可用钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + detailmodel.InNumber + "'"; int ret1 = DBHelper.ExecuteNonQuery(tran, st); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (detailmodel.outAccountType == OutAccountType.MemberBD && detailmodel.inAccountType == InAccountType.MemberCash) { //对会员现金账户转入会员消费账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 3, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberTypeBd, D_Sftype.baodanFTC, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员报单账户转入" + detailmodel.InNumber + "~会员保险账户", tran); int ret1 = D_AccountBLL.AddAccountTran(detailmodel.InNumber, detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员报单账户为" + detailmodel.InNumber + "会员保险账户转入" + detailmodel.OutMoney, tran); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (detailmodel.outAccountType == OutAccountType.MemberCons && detailmodel.inAccountType == InAccountType.MemberCash) { //对会员消费账户转入会员消费账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 0, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberCoshType, D_Sftype.EleAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员消费账户转入" + txt_InNumber.Text.Trim() + "~会员可用FTC账户", tran); int ret1 = D_AccountBLL.AddAccountTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员消费账户为" + txt_InNumber.Text.Trim() + "会员可用FTC账户转入" + detailmodel.OutMoney, tran); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (RadioButtonList1.SelectedValue == "4") { //对会员保险账户转入会员保险账户 string mot = ""; int ret = 0; int ret1 = 0; int ret2 = 0; int ret3 = 0; string sqll = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable xsj = DBHelper.ExecuteDataTable(sqll); if (xsj.Rows.Count > 0) { mot = xsj.Rows[0][0].ToString(); ret = DBHelper.ExecuteNonQuery(tran, "update memberinfo set xuhao+=" + detailmodel.OutMoney + " where number='" + Session["Member"].ToString() + "'"); ret1 = DBHelper.ExecuteNonQuery(tran, "update memberinfo set zzye+=" + detailmodel.OutMoney + " where number='" + mot + "'"); ret2 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,1,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + Session["Member"].ToString() + "'"); ret3 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + mot + "'"); } if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败444!');</script>"); } this.txtEmoney.Text = string.Empty; this.txt_InNumber.Text = string.Empty; txtEnote.Text = string.Empty; } catch { //tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败!123');</script>"); } }
public static string UpdateMemberOrder(string OrderId, IList <MemberDetailsModel> list, MemberOrderModel memberOrderModel, string StoreID) { SqlConnection conn = new SqlConnection(DBHelper.connString); MemberOrderModel order = MemberOrderBLL.GetMemberOrder(memberOrderModel.OrderId); SqlTransaction tran = null; try { conn.Open(); tran = conn.BeginTransaction(); SqlCommand cmd = new SqlCommand(); cmd.Transaction = tran; cmd.Connection = conn; DataTable dhpv = DBHelper.ExecuteDataTable(tran, "select totalpv,LackProductMoney from MemberOrder where OrderID='" + OrderId + "'"); if (memberOrderModel.PayExpect != -1 && memberOrderModel.DefrayState == 1) { if (Convert.ToDecimal(dhpv.Rows[0]["totalpv"]) != memberOrderModel.TotalPv) { //修改后需重新结算 cmd.CommandText = "update config set jsflag='0' where ExpectNum>='" + memberOrderModel.PayExpect + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } if (memberOrderModel.DefrayState == 1) { decimal oldlackproductmoney = Convert.ToDecimal(dhpv.Rows[0]["LackProductMoney"]); if (memberOrderModel.LackProductMoney != oldlackproductmoney) { D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(oldlackproductmoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "店铺[" + StoreID + "]修改订单[" + order.OrderId + "]退回钱[" + oldlackproductmoney + "]", tran); //D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(memberOrderModel.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "店铺[" + StoreID + "]修改订单[" + memberOrderModel.OrderId + "]扣除钱[" + memberOrderModel.LackProductMoney + "]", tran); if (order.DefrayType == 2) { new MemberOrderBLL().IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单修改现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } } int res = 0; SqlParameter[] del_parm = { new SqlParameter("@OrderID", OrderId), new SqlParameter("@StoreID", StoreID), new SqlParameter("@Type", 1), new SqlParameter("@res", res), new SqlParameter("@opnum", memberOrderModel.OperateNumber), new SqlParameter("@opip", memberOrderModel.OperateIp), }; BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberOrder", "ltrim(rtrim(OrderID))"); cl_h_info.AddRecordtran(tran, OrderId); BLL.CommonClass.ChangeLogs cl_h_info1 = new BLL.CommonClass.ChangeLogs("MemberDetails", "ltrim(rtrim(OrderID))"); cl_h_info1.AddRecordtran(tran, OrderId); DBHelper.ExecuteNonQuery(tran, "Delete_H_Order", del_parm, CommandType.StoredProcedure); if (Convert.ToInt32(del_parm[3].Value) == 0) { //添加订单 new AddOrderBLL().SaveHOrder(tran, list, memberOrderModel); cl_h_info.AddRecordtran(tran, OrderId); cl_h_info1.AddRecordtran(tran, OrderId); if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar(tran, "select count(1) from MemberDetails where OrderId='" + OrderId + "'", CommandType.Text)) > 0) { cl_h_info.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); cl_h_info1.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); } tran.Commit(); return("1"); } else { tran.Rollback(); return("-2"); } } catch (Exception ee) { tran.Rollback(); return("-2"); } finally { conn.Close(); conn.Dispose(); } }
//赋值 private void set_get_value() { string ReceivablesDate = Convert.ToDateTime(FKBirthday.Text).ToString("yyyy-MM-dd") + " " + this.ddlHour.SelectedValue + ":" + this.ddlMinute.SelectedValue + ":00"; string zw_hcr = Convert.ToDateTime(HCBirthday.Text).ToString("yyyy-MM-dd") + " " + this.DropDownList1.SelectedValue + ":" + this.DropDownList2.SelectedValue + ":00"; RemittancesModel info = new RemittancesModel(); info.ReceivablesDate = DateTime.Parse(ReceivablesDate).ToUniversalTime(); info.RemittancesDate = DateTime.Parse(zw_hcr).ToUniversalTime(); info.ImportBank = ""; info.ImportNumber = ""; info.RemittancesAccount = ""; info.RemittancesBank = ""; info.SenderID = ""; info.Sender = ""; info.RemitNumber = this.Number.Text; info.RemitMoney = decimal.Parse(this.Money.Text); info.StandardCurrency = CommonDataBLL.GetStandard(); info.ConfirmType = int.Parse(Way.SelectedValue); info.Remark = this.Remark.Text; info.RemittancesCurrency = CommonDataBLL.GetStandard(); info.PayWay = (int)PayWayType.RecAdvance; info.RemittancesMoney = decimal.Parse(this.Money.Text); info.Managers = Session["Company"].ToString(); info.PhotoPath = ""; info.OperateIp = Request.UserHostAddress; info.OperateNum = Session["Company"].ToString(); info.IsGSQR = true; info.PayexpectNum = BLL.CommonClass.CommonDataBLL.GetMaxqishu(); //获取汇单号 string huidan = "HK" + Model.Other.MYDateTime.ToYYMMDDHHmmssString(); //判断汇单号是否存在:true存在,false不存在 bool isExist = RemittancesBLL.isMemberExistsHuiDan(huidan); while (isExist) { huidan = "HK" + Model.Other.MYDateTime.ToYYMMDDHHmmssString(); isExist = RemittancesBLL.isMemberExistsHuiDan(huidan); } info.Remittancesid = huidan; if (this.RadPayFashion.SelectedIndex == 1) { string zw_hr_kfh = BankName.SelectedItem.Text.Substring(0, BankName.SelectedItem.Text.IndexOf("—", 0)); string zw_hr_zh = BankName.SelectedItem.Text.Substring(BankName.SelectedItem.Text.IndexOf("—", 0) + 1, BankName.SelectedItem.Text.Length - BankName.SelectedItem.Text.IndexOf("—", 0) - 1); string zw_skr = ReceivablesDate; info.RemittancesDate = DateTime.Parse(zw_hcr).ToUniversalTime(); info.ImportBank = zw_hr_kfh; info.ImportNumber = zw_hr_zh; info.RemittancesAccount = this.RemitNum.Text; info.ReceivablesDate = DateTime.Parse(zw_skr).ToUniversalTime(); info.RemittancesBank = this.RemitBank.Text; info.SenderID = this.IdentityCard.Text; info.Sender = this.Remitter.Text; } if (ViewState["Type"].ToString() == "Member") { info.RemitStatus = 1; info.Use = int.Parse(member_type.SelectedValue); } else if (ViewState["Type"].ToString() == "Store") { info.RemitStatus = 0; info.Use = int.Parse(store_type.SelectedValue); } int ret = 0; SqlTransaction tran = null; SqlConnection conn = DAL.DBHelper.SqlCon(); conn.Open(); tran = conn.BeginTransaction(); //添加汇款记录,并更新对应的金额 int id = 0; RemittancesBLL.AddMemberRemittancesTran(info, CommonDataBLL.GetStandard().ToString(), CommonDataBLL.GetStandard().ToString(), out id, tran); if (id > 0) { if (info.Use == 0)//现金账户对账单 { ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran); } else if (info.Use == 1)//消费账户对账单 { ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberCoshType, D_Sftype.EleAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran); } else if (info.Use == 2)//复消账户对账单 { ret = D_AccountBLL.AddAccountTran(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.MemberTypeFx, D_Sftype.CancellationAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~007214", tran); } //店铺订货款 else if (info.Use == 10) { ret = D_AccountBLL.AddStoreAccount(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.StoreDingHuokuan, S_Sftype.dianhuo, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~003079", tran); }//店铺周转款 else if (info.Use == 11) { ret = D_AccountBLL.AddStoreAccount(info.RemitNumber, Double.Parse(info.RemitMoney.ToString()) * RemittancesBLL.GetCurrency(info.RemittancesCurrency), D_AccountSftype.StoreZhouZhuankuan, S_Sftype.zhouzhuan, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, " " + "~003079", tran); } if (ret > 0) { //发送短信 //string receiverName = "", storeidnumber = "", mobile = ""; //if (ViewState["Type"].ToString() == "Store") //{ // StoreInfoModel storeinfo = StoreInfoDAL.GetStoreInfoByStoreId(this.Number.Text); // receiverName = Encryption.Encryption.GetDecipherName(storeinfo.Name); // storeidnumber = storeinfo.Number; // mobile = Encryption.Encryption.GetDecipherTele(storeinfo.MobileTele); //} //else if (ViewState["Type"].ToString() == "Member") //{ // MemberInfoModel storeinfo = MemberInfoDAL.getMemberInfo(Number.Text.Trim()); // receiverName = Encryption.Encryption.GetDecipherName(storeinfo.Name); // storeidnumber = storeinfo.Number; // mobile = Encryption.Encryption.GetDecipherTele(storeinfo.MobileTele); //} //Session["RemittancesModel"] = null; //string hkid = id.ToString(); //try //{ // BLL.MobileSMS.SendMsgMode(tran, receiverName, "收到" + info.RemittancesMoney + RemittancesBLL.GetCurrencyByID(info.RemittancesCurrency), storeidnumber, mobile, hkid, Model.SMSCategory.sms_Receivables); // tran.Commit(); //} //catch //{ // tran.Rollback(); //} if (ViewState["Type"].ToString() == "Member") { tran.Commit(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("001126", "汇款成功!") + "');location.href='AuditingStoreAccount.aspx?type=Member';</script>"); } else { tran.Commit(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("001126", "汇款成功!") + "');location.href='AuditingStoreAccount.aspx';</script>"); } } else { tran.Rollback(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("008020", "汇款失败") + "!');</script>"); } } else { tran.Rollback(); conn.Close(); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("008020", "汇款失败") + "!');</script>"); } }
/// <summary> /// 添加订单信息 /// </summary> /// <param name="mode"></param> /// <param name="memberOrderModel"></param> /// <param name="totalPv"></param> /// <param name="except"></param> /// <param name="memberDetailsModel"></param> /// <param name="storeInfoModel"></param> public static bool AddOrderData(bool isEdit, MemberOrderModel memberOrderModel, IList <MemberDetailsModel> list) { bool state = false; using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //如果是编辑 if (isEdit) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecordtran(tran, memberOrderModel.OrderId); //添加日志,修改前记录原来数据 MemberOrderModel order = MemberOrderBLL.GetMemberOrder(memberOrderModel.OrderId); if (order.LackProductMoney > 0) { D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); if (order.DefrayType == 2) { new Registration_declarations.MemberOrderAgainBLL().IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单修改现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } int delResult = new AddOrderDataDAL().Del_Horder(tran, memberOrderModel.OrderId, memberOrderModel.StoreId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); if (memberOrderModel.DefrayState == 1)//店铺复消减去业绩 { int js_delfuxiao_Result = new AddOrderDataDAL().Js_delfuxiao(memberOrderModel.Number, Convert.ToDouble(memberOrderModel.TotalPv), memberOrderModel.PayExpect, memberOrderModel.DefrayState, tran); } cl_h_info.ModifiedIntoLogstran(tran, ChangeCategory.Order, memberOrderModel.OrderId, ENUM_USERTYPE.objecttype5);//插入日志 } //添加订单 new AddOrderBLL().SaveHOrder(tran, list, memberOrderModel); //顾客购物业绩上传(注意支付money要改) if (memberOrderModel.DefrayState == 1) { new AddOrderDataDAL().Js_addfuxiao(memberOrderModel.Number, Convert.ToDouble(memberOrderModel.TotalPv), memberOrderModel.PayExpect, memberOrderModel.DefrayState, tran); CommonDataBLL.SetMemberLevel(tran, memberOrderModel.Number, memberOrderModel.OrderId); } state = true; tran.Commit(); } catch { tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } return(state); }
protected void lkSubmit_Click(object sender, EventArgs e) { //用IList存储选择了哪个复选框。 IList <string> zcbmList = new List <string>(); for (int i = 0; i <= gvdeduct.Rows.Count - 1; i++) { CheckBox cbox = (CheckBox)(gvdeduct.Rows[i].FindControl("CheckBox1")); if (cbox.Checked == true) { //用循环查出来哪个复选框选中,并把这个行的第二列的值存到IList中。我这里第二列是唯一标示列 zcbmList.Add(gvdeduct.Rows[i].Cells[1].Text); } } if (zcbmList.Count == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('请先选择需要处理的用户!')</script>"); return; } string sql1 = "ID in("; foreach (var zcbm in zcbmList) { if (zcbmList.IndexOf(zcbm) < zcbmList.Count - 1) { sql1 += "'" + zcbm + "',"; } else { sql1 += "'" + zcbm + "')"; } } string sqll = ""; if (plsh.SelectedValue == "0") { sqll = "update MemberCashXF set XFState=0,ps='" + beizhu.Text + "' where " + sql1 + ""; } if (plsh.SelectedValue == "1") { sqll = "update MemberCashXF set XFState=1,ps='" + beizhu.Text + "' where " + sql1 + ""; } if (plsh.SelectedValue == "2") { sqll = "update MemberCashXF set XFState=2,ps='" + beizhu.Text + "' where " + sql1 + ""; string tk = "update memberinfo set pointBIn=pointBIn+XFON from memberinfo,MemberCashXF where memberinfo.number=MemberCashXF.number and MemberCashXF." + sql1 + " and MemberCashXF.XFState not in(2,3)"; DBHelper.ExecuteNonQuery(tk); foreach (var zcbm in zcbmList) { string sqq = "select * from MemberCashXF where ID=" + zcbm + " and XFState not in(2,3)"; DataTable dt_one = DAL.DBHelper.ExecuteDataTable(sqq); double ipn = Convert.ToDouble(dt_one.Rows[0]["XFON"].ToString()); D_AccountBLL.AddAccountWithdraw(zcbm, ipn, D_AccountSftype.MemberTypeBd, D_Sftype.baodanFTC, D_AccountKmtype.RechargeByOnline, DirectionEnum.AccountsIncreased, "同意申请充值FTC,充值到账:" + ipn + ""); } } if (plsh.SelectedValue == "3") { sqll = "update MemberCashXF set XFState=3,ps='" + beizhu.Text + "' where " + sql1 + ""; } int con = DBHelper.ExecuteNonQuery(sqll); if (con >= 1) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('处理成功!')</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('处理失败!')</script>"); } BtnConfirm_Click(null, null); }
/// <summary> /// 删除会员复销信息 /// </summary> /// <param name="strId">报单编号</param> /// <returns></returns> public string DelMembersDeclaration(string orderId, double totalPv, string number, int except, string storeId, double lackproductmoney) { string info = null; MemberOrderModel order = MemberOrderDAL.GetMemberOrder(orderId); using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); #region 处理组合商品库存 /* * List<MemberDetailsModel> groupItemList2 = new AddOrderBLL().GetDetails(orderId); * List<OrderProduct3> oldSmallItem = new List<OrderProduct3>(); * for (int i = 0; i < groupItemList2.Count; i++) * { * if (groupItemList2[i].IsGroupItem != "") * { * oldSmallItem = new AddMemberInfomDAL().GetSamllItemList(groupItemList2[i].ProductId.ToString()); * for (int j = 0; j < oldSmallItem.Count; j++) * { * int hasOnly = new AddOrderDataDAL().SmallItemIsOnlyInGroup(oldSmallItem[j].Id, orderId); * if (hasOnly <= 0) * { * oldSmallItem[j].Count *= groupItemList2[i].Quantity; * int never = new AddOrderDataDAL().updateStore10(storeId, oldSmallItem[j], tran); * if (never <= 0) * { * tran.Rollback(); * conn.Close(); * conn.Dispose(); * info = BLL.Translation.Translate("001730", "抱歉!系统异常!"); * return info; * } * } * * } * } * }*/ #endregion //如果该订单不存在 if (!BrowsememberordersDAL.CheckOrderIdExists(tran, orderId)) { info = BLL.Translation.Translate("001661", "抱歉,该订单不存在!"); tran.Rollback(); conn.Close(); conn.Dispose(); return(info); } //删除复消单 if (order.DefrayState == 1) { if (lackproductmoney > 0) { D_AccountBLL.AddAccount(storeId, lackproductmoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金返还,订单号为【" + orderId + "】", tran); } } else if (order.DefrayState == 2) { string electronicaccountid = order.ElectronicaccountId;; if (lackproductmoney > 0) { IsElecPay(tran, order); D_AccountBLL.AddAccount(storeId, lackproductmoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金返还,订单号为【" + orderId + "】", tran); D_AccountBLL.AddAccount(electronicaccountid, lackproductmoney, D_AccountSftype.MemberType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金返还,订单号为【" + orderId + "】", tran); } } if (order.DefrayState == 1) { int result = new AddOrderDataDAL().Js_delfuxiao(number, totalPv, except, order.DefrayState, tran); } try { new AddOrderDataDAL().Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); tran.Commit(); } catch (Exception) { tran.Rollback(); info = BLL.Translation.Translate("001730", "抱歉!系统异常!"); } finally { conn.Close(); conn.Dispose(); } } return(info); }