/// <summary> /// 分析购物条件 /// </summary> /// <param name="mode"></param> /// <param name="prevJine"></param> /// <param name="notEnProMoney">用户选择货物不足时,计算出的不足数量*不足数量单价</param> /// <param name="orderID"></param> /// <param name="storeID"></param> /// <param name="list"></param> /// <param name="selectValue"></param> public static string CheckOption(bool isEdit, double notEnProMoney, string orderID, string storeID, IList <MemberDetailsModel> list, string selectValue, out double storeLeftMoney2, out double prvMoney2, out bool judge) { judge = true; //storeDataDAL数据类对象 StoreDataDAL storeDataDAL = new StoreDataDAL(); //上次报单金额 double prevMoney = 0; //支付状态 int defreyState = 0; //错误信息 string msg = null; //如果是编辑 if (isEdit) { //补回上次该报单上传不足货物时补交的钱 prevMoney += new AddOrderDataDAL().NeedReturnMoney(orderID, storeID); } //需要修改 double storeLeftMoney = storeDataDAL.GetLeftRegisterMemberMoney(storeID) + prevMoney; //将店剩余金额带出方法 storeLeftMoney2 = storeLeftMoney; //将上次报单的费用带出方法 prvMoney2 = prevMoney; //判断是否已经注册 //得到 double currentMoney = new RegistermemberBLL().getZongJing(list); double bottonLine = new AddOrderBLL().GetBottomLine(); //如果报单额不足 if (notEnProMoney > storeLeftMoney) { if (selectValue == "1") { msg = "alert('" + BLL.Translation.Translate("006018", "对不起,您的报单额不足!") + "');"; judge = false; } } //没有库存 if (currentMoney < bottonLine) { msg = "alert('" + BLL.Translation.Translate("006019", "对不起,报单金额必须大于等于报单底线") + " " + bottonLine + "');"; judge = false; } return(msg); }
/// <summary> /// 刷新后保存用户输入的数量 /// </summary> public void savePageDisp() { string status = null; //获取用户选择的商品 List <int> list = new RegistermemberBLL().GetProductID(); status = "<script language='javascript'>"; for (int i = 0; i < list.Count; i++) { //读取用户输入的数量 int pdtNum; string numStr = Request["N" + list[i].ToString()]; if (numStr == null) { numStr = "0"; } if (numStr != "") { try { pdtNum = Convert.ToInt32(numStr); } catch { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001559", "对不起,订单数量只能输入数字!") + "');", true); return; } } else { pdtNum = 0; } if (pdtNum > 0) { status = status + "Form1.N" + list[i].ToString() + ".value=" + pdtNum.ToString() + ";"; } } status = status + "</script>"; this.Label1.Text = status; }
public void ReaderMemberInfo(string bianhao, string OrderId) { MemberInfoModel mim = new MemberInfoModel(); DataTable dtmb = RegistermemberBLL.Getcontryofmember(bianhao); if (dtmb != null && dtmb.Rows.Count > 0) { Txtyb.Text = dtmb.Rows[0]["postcode"].ToString(); mim.PostalCode = dtmb.Rows[0]["postalCode"].ToString(); mim.HomeTele = dtmb.Rows[0]["homeTele"].ToString(); mim.MobileTele = dtmb.Rows[0]["MobileTele"].ToString(); mim.Email = dtmb.Rows[0]["Email"].ToString(); } DataTable dtorder = RegistermemberBLL.Getorderinfoofmember(OrderId); if (dtorder != null && dtorder.Rows.Count > 0) { CountryCity2.SelectCountry(dtorder.Rows[0]["Country"].ToString(), dtorder.Rows[0]["Province"].ToString(), dtorder.Rows[0]["City"].ToString(), dtorder.Rows[0]["Xian"].ToString()); Txtdz.Text = Encryption.Encryption.GetDecipherAddress(dtorder.Rows[0]["ConAddress"].ToString()); mim.Address = Encryption.Encryption.GetDecipherAddress(dtorder.Rows[0]["ConAddress"].ToString()); mim.CPCCode = dtorder.Rows[0]["ccpccode"].ToString(); ViewState["cpccode"] = dtorder.Rows[0]["ccpccode"].ToString(); ddth.SelectedValue = dtorder.Rows[0]["sendType"].ToString(); Ddzf.SelectedValue = dtorder.Rows[0]["DefrayType"].ToString(); ViewState["DefrayType"] = dtorder.Rows[0]["DefrayType"].ToString(); if (dtorder.Rows[0]["defrayType"].ToString() == "2") { this.txtdzbh.Text = dtorder.Rows[0]["electronicAccountId"].ToString(); } DDLSendType.SelectedValue = dtorder.Rows[0]["SendWay"].ToString(); } Session["mim"] = mim; }
/// <summary> /// 取得用户所选的商品集合 /// </summary> /// <returns></returns> public IList <MemberDetailsModel> AddMemberDetails() { /*************************************************************************************/ //for (int i = 0; i < productModelList.Count; i++) //{ #region //object pNumber = Request["N" + productModelList[i].ProductID]; //int ptNum = 0; //if (pNumber != null) //{ // try // { // ptNum = Convert.ToInt32(pNumber); // } // catch // { // // return null; // } // if (ptNum > 0) // { // if (productModelList[i].IsCombineProduct == 1) { hasGroupItem = "true"; } else { } // arrayList.Add(new RegistermemberBLL().GetUserChooseProduct(ptNum, productModelList[i])); // } //} //else //{ // ptNum = 0; //} #endregion //} double totalMoney = 0.00; double totalPv = 0.00; ViewState["StateCount"] = false;//声明一个状态,判断选择的产品数量是否超出库存 //获取用户选择商品id集合 List <MemberDetailsModel> details = new List <MemberDetailsModel>(); //获取商品集合 List <ProductModel> productModelList = new RegistermemberBLL().GetProductModelList(); //用户选择商品到总商品集合里去匹配 for (int i = 0; i < productModelList.Count; i++) { string productid = productModelList[i].ProductID.ToString(); string productName = productModelList[i].ProductName.ToString(); string numStr = Request["N" + productid]; if (numStr == null) { numStr = "0"; } //读取用户输入的数量 double pdtNum; if (numStr != "") { try { pdtNum = Convert.ToInt32(numStr); } catch { return(null); } } else { pdtNum = 0; } // 读取用户输入的订货信息 if (pdtNum > 0) { //保存订单信息和汇总信息 double price = Convert.ToDouble(productModelList[i].PreferentialPrice); double pv = Convert.ToDouble(productModelList[i].PreferentialPV); totalMoney += price * pdtNum; totalPv += pv * pdtNum; MemberDetailsModel md = new MemberDetailsModel(); md.Price = (decimal)price; md.Pv = (decimal)pv; md.Quantity = (int)pdtNum; md.ProductId = (int)productModelList[i].ProductID; md.ProductName = productName; details.Add(md); //判断不可销售的产品是否超出库存 if (MemberOrderAgainBLL.GetIsSellByProId(Convert.ToInt32(productModelList[i].ProductID)) == "1") { int shuliang = md.Quantity; if (IsEdit()) { DataTable dtdetail = MemberOrderAgainBLL.GetMemberDetailsByOrderID(GetOrderId()); for (int j = 0; j < dtdetail.Rows.Count; j++) { if (dtdetail.Rows[j]["productid"].ToString() == productModelList[i].ProductID.ToString()) { shuliang = shuliang - Convert.ToInt32(dtdetail.Rows[j]["Quantity"]); } } } if (MemberOrderAgainBLL.GetCountByProIdAndStoreId(Convert.ToInt32(productModelList[i].ProductID), GetStoreId()) + shuliang < 0) { ViewState["StateCount"] = true; } } } } ViewState["TotalMoney"] = totalMoney; ViewState["TotalPv"] = totalPv; return(details); }
/// <summary> /// 确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void go_Click(object sender, EventArgs e) { //获取用户选择商品的总钱和总积分 IList <MemberDetailsModel> choseProList = AddMemberDetails(); decimal SumMoney = Convert.ToDecimal(ViewState["TotalMoney"]); // Convert.ToDecimal(new RegistermemberBLL().getZongJing(choseProList)); decimal SumPv = Convert.ToDecimal(ViewState["TotalPv"]); // Convert.ToDecimal(new RegistermemberBLL().getZongPv(choseProList)); string orderID = MemberOrderAgainBLL.GetOrderInfo(IsEdit(), GetOrderId()); //获取报单号 MemberOrderModel momberorder = AddOrdrer(orderID, SumMoney, SumPv); //需要修改session取得期数,需要修改 if (!new RegistermemberBLL().IsMaxQiShu(CommonDataBLL.getMaxqishu())) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001543", "只可对最大期数据进行操作") + "');", true); return; } //编号不能为空 if (Txtbh.Text == "") { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001547", "编号不能为空!") + "');", true); return; } if (panel2.Visible) { //验证国家省份城市是否选择 if (CountryCity1.Country == "" || CountryCity1.Province == "" || CountryCity1.City == "")//|| CountryCity1.Country == "请选择" || CountryCity1.Province == "请选择" || CountryCity1.City == "请选择") { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');", true); return; } } if (panel2.Visible) { //详细地址不能为空 if (Txtdz.Text == "") { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("006933", "对不起,请填写详细地址!") + "');", true); return; } } //编号是否存在 if (new MemberOrderAgainBLL().CheckNuberIsExist(this.Txtbh.Text.Trim()) <= 0) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001549", "对不起,该编号不存在!") + "');", true); return; } //得到用户选择商品总金额和总积分 if (choseProList.Count == 0) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001550", "对不起,您还没有输入订货数量信息!") + "');", true); return; } if (Convert.ToBoolean(ViewState["StateCount"])) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("007039", "对不起,您选择了停售产品,并且超出了店铺库存数量!") + "');", true); return; } //电子钱包密码是否正确 if (this.rdPayType.SelectedValue.ToString() == "2") { //用户编号不能为空 if (txtdzbh.Text == "") { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001551", "对不起,您输入的用户编号!") + "');", true); return; } //电子账户密码不能为空 if (txtdzbh.Text == "") { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001552", "对不起,您输入的电子账户密码!") + "');", true); return; } //验证电子账户密码 if (!MemberOrderAgainBLL.CheckEctPassWord(txtdzbh.Text, Encryption.Encryption.GetEncryptionPwd(txtdzbh.Text, txtdzmima.Text))) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001554", "对不起,您输入的电子账户密码不正确!") + "');", true); return; } } //分析购物条件 double PrevMoney = 0; double StoreLeftMoney = 0; bool judge = true; double notEnoughmoney = new RegistermemberBLL().CheckMoneyIsEnough(choseProList, GetStoreId(), GetOrderId()); string checkResult = MemberOrderAgainBLL.CheckOption(IsEdit(), notEnoughmoney, orderID, GetStoreId(), choseProList, this.rdPayType.SelectedValue.ToString(), out StoreLeftMoney, out PrevMoney, out judge); if (checkResult != null) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", checkResult, true); return; } //检查公司逻辑库存 IList <MemberDetailsModel> porList = CommonDataBLL.GetNewOrderDetail1(choseProList); for (int i = 0; i < porList.Count; i++) { int left = BLL.CommonClass.CommonDataBLL.GetLeftLogicProductInventory(Convert.ToInt32(porList[i].ProductId)); if (left < choseProList[i].Quantity) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("005967", "对不起,公司库存不够") + "!" + porList[i].ProductName + GetTran("005970", "库存数只有") + ":" + left + "');", true); return; } } //电子钱包是否足够 if (this.rdPayType.SelectedValue == "2") { //需要修改 double elcMoney = Convert.ToDouble(CommonDataBLL.EctBalance(this.txtdzbh.Text.Trim())); //如果电子金额少于用户订单总额 if (elcMoney < Convert.ToDouble(momberorder.TotalMoney)) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001528", "用户") + this.txtdzbh.Text + GetTran("001529", "的电子钱包不够本次报单!") + "');", true); return; } } //不足货物的钱 momberorder.LackProductMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreId(), notEnoughmoney));//获得标准币种 //添加订单,跟新会员业绩,和该店库存报单的费用 if (MemberOrderAgainBLL.AddOrderData(IsEdit(), momberorder, choseProList)) { if (!IsEdit()) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001556", "报单成功!") + "');location.href='MemberOrderAgain.aspx';", true); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("000222", "修改成功!") + "');location.href='BrowseMemberOrders.aspx';", true); } } else { if (!IsEdit()) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("001557", "报单失败!") + "');", true); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('" + GetTran("000225", "修改失败!") + "');", true); } } }
protected void StartRecord_click(object sender, EventArgs e) { ConsigneeInfo cinfo = null; var member = Session["Member"]; if (member != null) { cinfo = MemberInfoModifyBll.getconsigneeInfo(member.ToString(), true); if (cinfo == null) { ScriptHelper.SetAlert(Page, "请先选择收货地址!", "PhoneSettings/SetConAddress.aspx?type=" + type + "&&url=AddLsOrder"); return; } } else { Response.Redirect("~/MemberMobile/Index.aspx"); return; } string count = DBHelper.ExecuteScalar("select count(*) from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString() + " and odType=" + luo.OrderType).ToString(); if (count == "0" && Session["UserType"].ToString() != "1") { ScriptHelper.SetAlert(Page, GetTran("007430", "您至少要选择一种产品") + "!", "ShopingList.aspx"); return; } else { IList <MemberDetailsModel> choseProList = new List <MemberDetailsModel>(); OrderDeal od = new OrderDeal(); OrderFinalModel ofm = new OrderFinalModel(); ofm.SendWay = 1;//收货途径 会员收货 if (Session["EditOrderID"] != null) { OrderFinalModel model = new OrderFinalModel(); ofm = od.GetDataModelFx(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay); ofm.Assister = ""; } else { if (luo.OrderType == 21 || luo.OrderType == 11 || luo.OrderType == 31) { ofm = od.GetDataModel(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay); if (new RegistermemberBLL().CheckNumberTwice(ofm.Number) != null) { ScriptHelper.SetAlert(Page, GetTran("007432", "会员编号已存在") + "!"); AgainTime.Value = "0"; DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString()); return; } string placement = new RegistermemberBLL().GetHavePlacedOrDriect(ofm.Number, "", ofm.Placement, ofm.Direct); if (placement != null) { ScriptHelper.SetAlert(Page, placement); AgainTime.Value = "0"; DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString()); return; } if (ofm.Placement != "8888888888") { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + ofm.Placement + "' and District=" + ofm.District + "").ToString() != "0") { ScriptHelper.SetAlert(Page, GetTran("007433", "安置人所选区位已有人安置") + "!"); AgainTime.Value = "0"; DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString()); return; } } } else { ofm = od.GetDataModelFx(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay); if (!MemberInfoDAL.IsMemberExist(ofm.Number)) { ScriptHelper.SetAlert(Page, GetTran("000725", "会员编号不存在") + "!"); AgainTime.Value = "0"; return; } ofm.Assister = ""; } if (luo.OrderType == 21 || luo.OrderType == 11) { if (Convert.ToDouble(ofm.TotalMoney) < SetParametersBLL.GetMemOrderLineOrderBaseLine()) { ScriptHelper.SetAlert(Page, GetTran("000000", "会员注册金额不能低于") + SetParametersBLL.GetMemOrderLineOrderBaseLine().ToString("f2") + "!"); AgainTime.Value = "0"; return; } } } ofm.StoreID = "8888888888"; ofm.Type = 2;// 运货方式 邮寄 //Convert.ToInt32(this.ddth.SelectedValue); //if (lblOdType.Text == GetTran("004008", "注册报单")) //{ // ofm.IsAgain = 0; //} //else //{ ofm.IsAgain = 1; //} ofm.OrderType = 12; double yfStr = 0; //地址 if (cinfo != null) { ofm.CCPCCode = cinfo.CPCCode; ofm.ConTelPhone = cinfo.MoblieTele; ofm.ConMobilPhone = cinfo.MoblieTele; ofm.ConPost = ""; ofm.Consignee = Encryption.Encryption.GetEncryptionName(cinfo.Consignee); ofm.ConZipCode = cinfo.ConZipCode; ofm.ConAddress = Encryption.Encryption.GetEncryptionAddress(cinfo.Address); } //ofm.ConCity.Country = this.CountryCity2.Country; //ofm.ConCity.Province = this.CountryCity2.Province; //ofm.ConCity.City = this.CountryCity2.City; //ofm.ConCity.Xian = this.CountryCity2.Xian; //ofm.ConAddress = Encryption.Encryption.GetEncryptionAddress(this.Txtdz.Text); //ofm.CCPCCode = DAL.CommonDataDAL.GetCPCCode(CountryCity2.Country, CountryCity2.Province, CountryCity2.City, CountryCity2.Xian); yfStr = 0; //ofm.ConTelPhone = txtOtherPhone.Text.Trim(); //ofm.ConMobilPhone = txtOtherPhone.Text.Trim(); //Txtyddh.Text.Trim(); //ofm.CarryMoney = Convert.ToDecimal(yfStr); //ofm.ConPost = ""; //ofm.Consignee = Encryption.Encryption.GetEncryptionName(txtConName.Text.Trim()); //ofm.ConZipCode = txtPostCode.Text; //ofm.Number = txtMemBh.Text; //产品总费用、年费、运费、应付总金额 double pdtMoney = 0; //double.Parse(this.ltPrice.Text); double CarriageMoney = 0; //运费 ofm.CarryMoney = decimal.Parse("0.00"); var dayPrice = CommonDataBLL.GetMaxDayPrice(); decimal yfje = Convert.ToDecimal(ofm.TotalMoney / Convert.ToDecimal(dayPrice)); ofm.TotalMoney = yfje + Convert.ToDecimal(CarriageMoney); //运费类型 //if (ddth.SelectedValue == "1")//自提 //{ // ofm.CarryMoney = decimal.Parse("0.00"); // this.txtYunfei.Text = ofm.CarryMoney.ToString(); //} //else //{ // this.txtYunfei.Text = ofm.CarryMoney.ToString(); // ofm.TotalMoney = Convert.ToDecimal(ofm.TotalMoney) + Convert.ToDecimal(CarriageMoney);//加运费 //} ofm.OrderExpect = CommonDataBLL.getMaxqishu(); ofm.StandardcurrencyMoney = yfje; ofm.TotalPv = 0; ofm.PaymentMoney = yfje; ofm.LevelInt = 1; ofm.StoreID = "8888888888"; ofm.InvestJB = yfje; //投资石斛积分币数量 ofm.PriceJB = Convert.ToDecimal(dayPrice); //石斛积分当前市价 ofm.OrderID = registermemberBLL.GetOrderInfo("add", null); if (Session["EditOrderID"] != null) { int zhifuZt = Convert.ToInt32(DBHelper.ExecuteScalar("select defraystate from memberorder where orderid='" + Session["EditOrderID"] + "'")); if (zhifuZt == 1) { ScriptHelper.SetAlert(Page, "该单已支付!不能修改!"); return; } SqlConnection conn = new SqlConnection(DBHelper.connString); conn.Open(); SqlTransaction tran = conn.BeginTransaction(); ofm.OrderID = Session["EditOrderID"].ToString(); new AddOrderDataDAL().Del_Horder(Session["EditOrderID"].ToString(), tran); Boolean flag = new DAL.AddOrderDataDAL().AddFinalOrderNoInfo(ofm, tran); if (flag) { //p_content.Visible = false; Session.Remove("mbreginfo"); Session.Remove("fxMemberModel"); Session.Remove("LUOrder"); Session.Remove("OrderType"); Session.Remove("EditOrderID"); Session.Remove("MemberUpgradeStore"); Session["MemberInfo_NP"] = ofm.Number + "," + ofm.Number; //储存会员的编号 tran.Commit(); conn.Close(); conn.Dispose(); DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + ofm.Number + "' and mType=" + Session["UserType"].ToString());//订单提交成功后,删除购物车 if (Session["UserType"].ToString() == "1") { int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 1, 1, 1, "管理员", "", 4, -1, 1, 1, "", 0, ""); if (val == 0) { ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000222", "修改成功") + "');location.href='../company/BrowseMemberOrders.aspx';</script>", false); } else { ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("007435", "修改成功自动支付失败") + "!');location.href='../company/BrowseMemberOrders.aspx';</script>", false); } } else if (Session["UserType"].ToString() == "2") { if (ofm.IsAgain == 0) { //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';</script>", false); //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';", true); } else { //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/viewfuxiao.aspx';</script>", false); //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';", true); } } else { if (ofm.IsAgain == 0) { //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';</script>", false); //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';", true); } else { //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/memberorder.aspx';</script>", false); //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';", true); Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + ""); } } } else { tran.Rollback(); conn.Close(); conn.Dispose(); ScriptHelper.SetAlert(Page, GetTran("000225", "修改失败")); } } else { Boolean flag = new DAL.AddOrderDataDAL().AddFinalOrder(ofm); if (flag) { //p_content.Visible = false; Session.Remove("mbreginfo"); Session.Remove("fxMemberModel"); Session.Remove("LUOrder"); Session.Remove("OrderType"); Session.Remove("EditOrderID"); Session.Remove("MemberUpgradeStore"); Session["MemberInfo_NP"] = ofm.Number + "," + ofm.Number; //储存会员的编号 DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString()); //订单提交成功后,删除购物车 if (Session["UserType"].ToString() == "1") { int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 1, 1, 1, "管理员", "", 5, -1, 1, 1, "", 0, ""); if (val == 0) { PublicClass.SendMsg(1, ofm.OrderID, ""); ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "购买成功") + "');location.href='../company/BrowseMemberOrders.aspx';</script>", false); } else { ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "报单成功,支付失败,店铺账户余额不足") + "!');location.href='../company/BrowseMemberOrders.aspx';</script>", false); } } else if (Session["UserType"].ToString() == "2") { if (ofm.IsAgain == 0) { //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true); Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + ""); } else { Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + ""); //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true); //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';</script>" , false);//+ // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/viewfuxiao.aspx';" } } else { if (ofm.IsAgain == 0) { Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + ""); //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true); //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../membermobile/browsememberorders.aspx';</script>", false); } else { Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + ""); //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true); //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');" // + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" + // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../membermobile/memberorder.aspx';</script>", false); } } } else { ScriptHelper.SetAlert(Page, GetTran("001557", "报单失败!")); } } } }
/// <summary> /// 查找邮编 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdCode_Click(object sender, EventArgs e) { string result = new RegistermemberBLL().GetAddressCode(this.CountryCity1.Xian.ToString()); this.PostolCode.Text = result; }
private void GetOldMemberData(string bianhao) { //MemberInfoModifyBll mf = new MemberInfoModifyBll(); MemberInfoModel member = MemberInfoModifyBll.getMemberInfo(bianhao); if (member != null) { this.LblBh.Text = member.Number; this.LblBh.ForeColor = Color.Silver; //解密姓名 this.labName.Text = Encryption.Encryption.GetDecipherName(CommonDataBLL.quanjiao(member.Name)); Txtlm.Text = member.PetName; Txtyb1.Text = member.PostalCode; //解密地址 this.txtdizhi.Text = Encryption.Encryption.GetDecipherAddress(member.Address); Txtjtdh.Text = Encryption.Encryption.GetDecipherTele(member.HomeTele); if (this.Txtjtdh.Text.Trim() == "") { this.Txtjtdh.Text = GetTran("000028", "电话号码"); this.Txtjtdh.Style.Add("color", "gray"); } Txtbgdh.Text = Encryption.Encryption.GetDecipherTele(member.OfficeTele); if (this.Txtbgdh.Text.Trim() == "") { this.Txtbgdh.Text = GetTran("000028", "电话号码"); this.Txtbgdh.Style.Add("color", "gray"); } Txtyddh.Text = Encryption.Encryption.GetDecipherTele(member.MobileTele); Txtczdh.Text = Encryption.Encryption.GetDecipherTele(member.FaxTele); if (this.Txtczdh.Text.Trim() == "") { this.Txtczdh.Text = GetTran("000028", "电话号码"); this.Txtczdh.Style.Add("color", "gray"); } IList <string> strBankInfo = new GroupRegisterBLL().GetBankValue(member.BankCode); if (strBankInfo.Count > 0) { foreach (ListItem li in ddlCountry.Items) { if (li.Value == strBankInfo[1].Substring(0, 2)) { li.Selected = true; break; } } ViewState["bankcode"] = strBankInfo[1]; } txtbankbrachname.Text = member.Bankbranchname; if (member.BCPCCode != "") { List <string> BankArea = new RegistermemberBLL().ChoseArea(member.BCPCCode); //解密银行地址并且读出银行详细地址 UserControl_CountryCity countrycity1 = Page.FindControl("CountryCity2") as UserControl_CountryCity; //取得该会员地址 CityModel bankArea = DAL.CommonDataDAL.GetCPCCode(member.BCPCCode); countrycity1.SelectCountry(bankArea.Country, bankArea.Province, bankArea.City, bankArea.Xian); } List <string> GetCardType = new GroupRegisterBLL().GetCardType(member.PaperType.PaperTypeCode); lblzhengjian.Text = GetCardType[0]; UserControl_CountryCity countrycity = Page.FindControl("CountryCity1") as UserControl_CountryCity; //取得该会员地址 CityModel MemberArea = DAL.CommonDataDAL.GetCPCCode(member.CPCCode); countrycity.SelectCountry(MemberArea.Country, MemberArea.Province, MemberArea.City, MemberArea.Xian); //生日需要修改 lblBirthday.Text = (Convert.ToDateTime(member.Birthday).Year + "-" + (Convert.ToDateTime(member.Birthday)).Month + "-" + (Convert.ToDateTime(member.Birthday)).Day); //解密开户名 this.labkaihuming.Text = Encryption.Encryption.GetDecipherName(member.BankBook) == "" ? Encryption.Encryption.GetDecipherName(member.Name) : Encryption.Encryption.GetDecipherName(member.BankBook); //卡号解密 this.labkahao.Text = Encryption.Encryption.GetDecipherCard(member.BankCard); if (Convert.ToInt32(member.Sex) == 0) { this.labSex.Text = GetTran("000095", "女"); } else { this.labSex.Text = GetTran("000094", "男"); } //解密证件号 this.labzhengjianhaoma.Text = Encryption.Encryption.GetDecipherNumber(member.PaperNumber); Txtbz.Text = member.Remark; } }
/// <summary> /// 购买矿机 /// </summary> /// <param name="chosenum"></param> /// <returns></returns> public void GetRegSendPost() { int chosenum = Convert.ToInt32(hidetp.Value); if (Session["Member"] == null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('未登录!');</script>", false); return; //未登录 } string number = Session["Member"].ToString(); int cc = Convert.ToInt32(DBHelper.ExecuteScalar("select count(0) from memberorder where DefrayState=1 and isactive=0 and ordertype<>0 and number='" + number + "' ")); if (cc > 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('您有未激活的矿机,请激活后再升级!'); setTimeout(function(){ window.location.href='orderlist.aspx'},2000); </script>", false); return; } int re = 0; ///获取usdt账户 int lv = 0; //檢測是否有未支付的單子 如果有則走未支付的訂單 double ddmm = 0; string orderid = ""; //DataTable ddt = DBHelper.ExecuteDataTable("select top 1 OrderID,TotalMoney from memberorder where DefrayState=0 order by id "); //if (ddt != null && ddt.Rows.Count > 0) //{ // DataRow dr = ddt.Rows[0]; // ddmm = Convert.ToDouble(dr["TotalMoney"]); // orderid = dr["orderid"].ToString(); // return; //} //清除未支付订单 DBHelper.ExecuteNonQuery(@" insert into memberorderdel(id,[Number],[OrderID],[StoreID],[TotalMoney] ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum] ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee] ,[CCPCCode],[ConCity],[ConAddress] ,[ConZipCode],[ConTelphone] ,[ConMobilPhone],[ConPost] ,[DefrayType],[PayMoney] ,[PayCurrency],[StandardCurrency] ,[StandardCurrencyMoney],[OperateIP] ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype] ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney] ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned] ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning] ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB] ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle]) select id,[Number],[OrderID],[StoreID],[TotalMoney] ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum] ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee] ,[CCPCCode],[ConCity],[ConAddress] ,[ConZipCode],[ConTelphone] ,[ConMobilPhone],[ConPost] ,[DefrayType],[PayMoney] ,[PayCurrency],[StandardCurrency] ,[StandardCurrencyMoney],[OperateIP] ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype] ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney] ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned] ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning] ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB] ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle] from MemberOrder where DefrayState = 0 and number ='" + number + "' "); //删除未支付的订单 DBHelper.ExecuteNonQuery("delete from memberorder where DefrayState=0 and number='" + number + "' "); DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select LevelInt from memberinfo where Number='" + number + "'"); if (dt_one.Rows != null && dt_one.Rows.Count > 0) { lv = Convert.ToInt32(dt_one.Rows[0]["LevelInt"]);//获取账户等级 } double zhye = 0; int jd = Common.GetcurJieDuan();//获取阶段状态 if ((lv == 1 || (lv == 0 && chosenum > 1)) && jd == 1) { zhye = CommandAPI.GetActMoney(); } if (chosenum < 0 || chosenum > 8 || lv > chosenum) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('请选择矿机!');</script>", false); return; } //选择购买的矿机 ConfigModel cm = ConfigDAL.GetConfig(); double ttmoney = 0; double ttpv = 0; int ordertype = 22; // 0 第一次购买 1 补差升级 int isagain = 0; double yymoney = 0; // int ispay = 0; ///支付状态 if (lv == 0) { ordertype = 22; //抢购20u } if (lv == 1 || (lv == 0 && chosenum > 1)) { ordertype = 23; //购买 } if (lv == 2) { yymoney = cm.Para2; } if (lv == 3) { yymoney = cm.Para3; } if (lv == 4) { yymoney = cm.Para4; } if (lv == 5) { yymoney = cm.Para5; } if (lv == 6) { yymoney = cm.Para6; } if (lv == 7) { yymoney = cm.Para7; } if (lv == 7) { ordertype = 25; //复投 } if (chosenum == 1) { ttmoney = cm.Para1; ttpv = 0; } //20u 不计算业绩 if (chosenum == 2) { ttmoney = cm.Para2 - yymoney; ttpv = cm.Para2 - yymoney; } if (chosenum == 3) { ttmoney = cm.Para3 - yymoney; ttpv = cm.Para3 - yymoney; } if (chosenum == 4) { ttmoney = cm.Para4 - yymoney; ttpv = cm.Para4 - yymoney; } if (chosenum == 5) { ttmoney = cm.Para5 - yymoney; ttpv = cm.Para5 - yymoney; } if (chosenum == 6) { ttmoney = cm.Para6 - yymoney; ttpv = cm.Para6 - yymoney; } if (chosenum == 7) { ttmoney = cm.Para7 - yymoney; ttpv = cm.Para7 - yymoney; } //if (chosenum == 8) { ttmoney = cm.Para28 - yymoney; ttpv = cm.Para28 - yymoney; } if (yymoney > 0) { isagain = 1; ordertype = 24; } //升级 DataTable dtmb = DBHelper.ExecuteDataTable("select pointAin-pointAout as ablc,pointbin-pointbout as bblc,pointcin-pointcout as cblc,pointdin-pointdout as dblc,pointein-pointeout as eblc from memberinfo where number='" + number + "'"); DataTable conp = DBHelper.ExecuteDataTable("select CoinIndex ,coinnewprice from CoinPlant order by id "); double ablc = 0; double bblc = 0; double cblc = 0; double dblc = 0; double eblc = 0; double cap = 0; double cbp = 0; double ccp = 0; double cdp = 0; double cep = 0; if (dtmb != null && dtmb.Rows.Count > 0) { DataRow dr = dtmb.Rows[0]; ablc = Convert.ToDouble(dr["ablc"]); bblc = Convert.ToDouble(dr["bblc"]); cblc = Convert.ToDouble(dr["cblc"]); dblc = Convert.ToDouble(dr["dblc"]); eblc = Convert.ToDouble(dr["eblc"]); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false); return; } if (conp != null && conp.Rows.Count > 0) { foreach (DataRow item in conp.Rows) { string s = item["CoinIndex"].ToString(); if (s == "CoinA") { cap = Convert.ToDouble(item["coinnewprice"]); } if (s == "CoinB") { cbp = Convert.ToDouble(item["coinnewprice"]); } if (s == "CoinC") { ccp = Convert.ToDouble(item["coinnewprice"]); } if (s == "CoinD") { cdp = Convert.ToDouble(item["coinnewprice"]); } if (s == "CoinE") { cep = Convert.ToDouble(item["coinnewprice"]); } } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false); return; } double aneed = 0; double bneed = 0; double cneed = 0; double eneed = 0; if (lv > 0) { if (jd == 1) { if (zhye < ttmoney) { //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false); //return; }//余额不足 else if (jd == 2 || jd == 3) { aneed = ttmoney / cap; if (aneed > ablc) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false); return; } ; //余额不足 } else if (jd == 4 || jd == 5) { aneed = (ttmoney * 0.5) / cap; bneed = (ttmoney * 0.5) / cbp; if (aneed > ablc || bneed > bblc) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false); return; }//余额不足 } else if (jd == 6 || jd == 7) { aneed = (ttmoney * 0.2) / cap; bneed = (ttmoney * 0.3) / cbp; cneed = (ttmoney * 0.5) / ccp; if (aneed > ablc || bneed > bblc || cneed > cblc) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script> showsuc('账户余额不足!');</script>", false); return; }//余额不足 } } if (jd > 0 && chosenum > 1) /// 如果是20u以上 则需要额外支付 5% 的E { eneed = (ttmoney * 0.05) / cep; //if (eneed > eblc) //{ // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('火星币余额不足,请先去抢购兑换!');</script>", false); // return; //} //余额不足 Session["Eneed"] = eneed; } } RegistermemberBLL registermemberBLL = new RegistermemberBLL(); orderid = registermemberBLL.GetOrderInfo("add", null); int maxexpt = ConfigDAL.GetMaxExpectNum(); Boolean flag = new AddOrderDataDAL().AddOrderInfo(number, orderid, maxexpt, isagain, ttmoney, ttpv, ordertype); Session["choselv"] = chosenum; //保存当前选中级别 if (flag) //插入订单成功 开始支付 { if (jd == 1 && chosenum > 1) //说明是第一阶段的所有购买都 必须使用USDT买 { Session["orderid"] = orderid; string postf = CommandAPI.GetFunction(orderid, ttmoney.ToString(), "recast.aspx", RadioButtonList1.SelectedValue); ClientScript.RegisterStartupScript(this.GetType(), "", postf, false); return; } else { //本地支付开始 int r = MemberOrderDAL.PayOrder(number, orderid, aneed, bneed, cneed, eneed, chosenum, "使用本地币种账户支付"); if (r == 1) { //销毁 if (aneed > 0) { CommandAPI.Destruction("A", aneed); } if (bneed > 0) { CommandAPI.Destruction("B", bneed); } if (cneed > 0) { CommandAPI.Destruction("C", cneed); } // if (eneed > 0) CommandAPI.Destruction("E", eneed); if (eneed > 0) { int ee = MemberOrderDAL.payOrderEcoin(number, orderid, eneed, "E币支付,激活成功"); if (ee == 1) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买矿机激活成功!');</script>", false); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('支付成功,请使用E币激活矿机!'); setTimeout(function(){ window.location.href='orderlist.aspx'},3000); </script>", false); } } ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买成功!');</script>", false); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买失败!');</script>", false); return; } } } }
public static string AuditingOrder(string orderid) { string error = ""; //返回错误信息 MemberOrderModel mo = MemberOrderDAL.GetMemberOrder(orderid); //获取报单信息 List <MemberDetailsModel> list = ViewFuXiaoBLL.GetDetails(mo.OrderId); //获取订单明细 //判断报单是否支付 if (mo.DefrayState != 0) { return(BLL.Translation.Translate("000987", "报单不可重复确认"));// "报单不可重复确认!"; } //验证店铺钱是否够支付保单 double notEnoughmoney = new RegistermemberBLL().CheckMoneyIsEnough(list, mo.StoreId); double storeLeftMoney = new StoreDataDAL().GetLeftRegisterMemberMoney(mo.StoreId); if (storeLeftMoney < notEnoughmoney) { return(BLL.Translation.Translate("006018", "对不起,您的报单额不足!"));// "报单不可重复确认!"; } //更改--报单信息 mo.RemittancesId = MYDateTime.ToYYMMDDHHmmssString(); mo.DefrayState = 1; mo.PayExpect = CommonDataBLL.getMaxqishu(); //double notEnoughmoney = new RegistermemberBLL().CheckMoneyIsEnough(list, mo.StoreId); IList <MemberDetailsModel> listnew = CommonDataBLL.GetNewOrderDetail1(list); for (int i = 0; i < list.Count; i++) { int left = BLL.CommonClass.CommonDataBLL.GetLeftLogicProductInventory(Convert.ToInt32(listnew[i].ProductId)); if (left < listnew[i].Quantity) { return(BLL.Translation.Translate("005967", "对不起,公司库存不够") + "!" + listnew[i].ProductName + BLL.Translation.Translate("005970", "库存数只有") + ":" + left); } } //转化汇率 notEnoughmoney = new RegistermemberBLL().ChangeNotEnoughMoney(mo.StoreId, notEnoughmoney); double EnoughProductMoney = Convert.ToDouble(new RegistermemberBLL().getEnoughProductMoney(list, mo.StoreId)); mo.EnoughProductMoney = Convert.ToInt32(EnoughProductMoney); mo.LackProductMoney = Convert.ToInt32(notEnoughmoney); //拆分组合产品 IList <MemberDetailsModel> md = BLL.CommonClass.CommonDataBLL.GetNewOrderDetail1(list); System.Web.HttpContext.Current.Application.UnLock(); System.Web.HttpContext.Current.Application.Lock(); using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //更新会员订单信息 if (!CommonDataBLL.ConfirmMembersOrder(tran, mo.OrderId, mo.PayExpect, mo.EnoughProductMoney, mo.LackProductMoney)) { tran.Rollback(); System.Web.HttpContext.Current.Application.UnLock(); return(BLL.Translation.Translate("000993", "确认失败")); } //更新店铺库存 foreach (MemberDetailsModel memberDetailsModel in list) { //循环根据订单明细跟新库存 int result = ViewFuXiaoBLL.UptStock(tran, memberDetailsModel.StoreId, memberDetailsModel.ProductId, memberDetailsModel.Quantity, memberDetailsModel.NotEnoughProduct); //如果该店铺无盖商品记录,则在店库存表中加记录 if (result <= 0) { new BrowseMemberOrdersBLL().updateStore2(memberDetailsModel, tran); } if (memberDetailsModel.NotEnoughProduct > 0) { if (!CommonDataBLL.ConfirmMembersDetails(tran, memberDetailsModel.ProductId, mo.OrderId, memberDetailsModel.NotEnoughProduct)) { tran.Rollback(); System.Web.HttpContext.Current.Application.UnLock(); return(BLL.Translation.Translate("000993", "确认失败")); } } } //处理公司逻辑库存 int sd = new DAL.AddOrderDataDAL().updateStoreL(tran, md); //报单生成订单 Insert_OrderGoods(list, mo, tran); if (mo.DefrayType == 1) { if (Convert.ToDouble(mo.LackProductMoney) > 0) { //记录对账单明细 BLL.Logistics.D_AccountBLL.AddAccount(mo.StoreId, Convert.ToDouble(mo.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.Declarations, DirectionEnum.AccountReduced, "会员【" + mo.Number + "】报单现金扣除额,订单号为【" + mo.OrderId + "】", tran); } } if (mo.DefrayType == 2) { //记录对账单明细 BLL.Logistics.D_AccountBLL.AddAccount(mo.ElectronicaccountId, Convert.ToDouble(mo.TotalMoney), D_AccountSftype.MemberType, D_AccountKmtype.Declarations, DirectionEnum.AccountReduced, "会员【" + mo.Number + "】用会员【" + mo.ElectronicaccountId + "】电子货币报单,订单号为【" + mo.OrderId + "】", tran); BLL.Logistics.D_AccountBLL.AddAccount(mo.StoreId, Convert.ToDouble(mo.TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.Declarations, DirectionEnum.AccountsIncreased, "会员【" + mo.Number + "】用会员【" + mo.ElectronicaccountId + "】电子货币报单转入,订单号为【" + mo.OrderId + "】", tran); if (Convert.ToDouble(mo.LackProductMoney) > 0) { BLL.Logistics.D_AccountBLL.AddAccount(mo.StoreId, Convert.ToDouble(mo.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.Declarations, DirectionEnum.AccountReduced, "会员【" + mo.Number + "】报单现金扣除额,订单号为【" + mo.OrderId + "】", tran); } //更新电子账户余额 AddOrderDataDAL.UpdateECTPay(tran, mo.ElectronicaccountId, mo.LackProductMoney); //更新店铺汇款 new AddOrderDataDAL().Add_Remittances(tran, Convert.ToDouble(mo.LackProductMoney), mo.StoreId); //插入汇款信息 new AddOrderDataDAL().AddDataTORemittances(tran, mo); } //更新店铺报单款 new AddOrderDataDAL().updateStore3(mo.StoreId, tran, Convert.ToDouble(mo.LackProductMoney)); //判断是否是注册的会员 if (mo.IsAgain == 0) { //获取会员信息 MemberInfoModel mi = MemberOrderDAL.GetMemberInfo(orderid, tran); //更新会员业绩,会员进入网络图 new AddOrderDataDAL().Upt_UpdateNew1(mi, tran); //激活会员 int resultActive = new GroupRegisterBLL().uptIsActive(mi.Number, tran); } //实时更新会员级别 CommonDataBLL.SetMemberLevel(tran, mo.Number, mo.OrderId); //提交事务 tran.Commit(); } catch (Exception ex) { string sga = ex.Message; error = BLL.Translation.Translate("000993", "确认失败");// "确认失败!"; tran.Rollback(); } finally { conn.Close(); conn.Dispose(); System.Web.HttpContext.Current.Application.UnLock(); } } return(error); }
//报单调用的类 public void SaveHOrder(SqlTransaction tran, IList <MemberDetailsModel> list, MemberOrderModel memberOrderModel) { RegistermemberBLL RegistermemberBLL = new RegistermemberBLL(); //添加对账单 if (memberOrderModel.DefrayType == 2) { BLL.Logistics.D_AccountBLL.AddAccount(memberOrderModel.ElectronicaccountId, Convert.ToDouble(memberOrderModel.TotalMoney), D_AccountSftype.MemberType, D_AccountKmtype.Declarations, DirectionEnum.AccountReduced, "会员【" + memberOrderModel.Number + "】用会员【" + memberOrderModel.ElectronicaccountId + "】电子货币报单,订单号为【" + memberOrderModel.OrderId + "】", tran); BLL.Logistics.D_AccountBLL.AddAccount(memberOrderModel.StoreId, Convert.ToDouble(memberOrderModel.TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountsIncreased, "会员【" + memberOrderModel.Number + "】用会员【" + memberOrderModel.ElectronicaccountId + "】电子货币报单转入,订单号为【" + memberOrderModel.OrderId + "】", tran); // 电子帐户支付 IsElecPay(tran, memberOrderModel); } AddOrderDataDAL addOrderDataDAL = new AddOrderDataDAL(); //插入memberOrder表 addOrderDataDAL.INSERT_H_Order(memberOrderModel, tran); foreach (Model.MemberDetailsModel mDetails in list) { //插入订单明细 addOrderDataDAL.insert_MemberOrderDetails(memberOrderModel, mDetails, tran); //未支付报单不算库存 if (memberOrderModel.DefrayState == 1) { //更新减去店库存 int result = 0; result = addOrderDataDAL.updateStore(memberOrderModel.StoreId, mDetails, tran); ////添加该类型的记录,用负数表示 if (result <= 0) { addOrderDataDAL.updateStore2(memberOrderModel.StoreId, mDetails, tran); } } } if (memberOrderModel.DefrayState == 1) { //报单生成订单 int count = 0; decimal totalMoney = 0; decimal totalPv = 0; foreach (MemberDetailsModel mDetails in list) { if (mDetails.NotEnoughProduct > 0) { totalMoney += mDetails.NotEnoughProduct * mDetails.Price; totalPv += mDetails.NotEnoughProduct * mDetails.Pv; count++; } } if (count > 0) { string orderId = ""; orderId = BLL.Logistics.OrderGoodsBLL.GetNewOrderID(); //自动为店铺生成要货申请单 OrderGoodsMedel storeItem = GetOrderModel(orderId, memberOrderModel, tran, totalMoney, totalPv); //插入要货申请单明细 OrderSubmit(memberOrderModel.OrderId.ToString(), list, storeItem, tran); } int sd = addOrderDataDAL.updateStoreL(tran, memberOrderModel.OrderId); //添加对账单 if (memberOrderModel.DefrayType == 1 || memberOrderModel.DefrayType == 2) { if (Convert.ToDouble(memberOrderModel.LackProductMoney) > 0) { BLL.Logistics.D_AccountBLL.AddAccount(memberOrderModel.StoreId, Convert.ToDouble(memberOrderModel.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.Declarations, DirectionEnum.AccountReduced, "会员【" + memberOrderModel.Number + "】报单现金扣除额,订单号为【" + memberOrderModel.OrderId + "】", tran); } } //增加该店铺的总报单的费用(累计) addOrderDataDAL.updateStore3(memberOrderModel.StoreId, tran, Convert.ToDouble(memberOrderModel.LackProductMoney)); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string id = e.CommandArgument.ToString(); if (e.CommandName.ToString() == "Detail") { Response.Redirect("MemberCash.aspx?id=" + id); } else if (e.CommandName.ToString() == "Del") { DataTable dt = RegistermemberBLL.QueryWithdraw(id); if (dt.Rows.Count > 0) { if (RegistermemberBLL.GetAuditState(int.Parse(id)) == 1) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007174", "该申请单已经审核,不可以删除!") + ")');</script>"); bind(); return; } if (RegistermemberBLL.GetAuditState(int.Parse(id)) == 2) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007986", "该申请单已经开始处理,不可以删除!") + "');</script>"); bind(); return; } if (RegistermemberBLL.GetAuditState(int.Parse(id)) == 3) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007987", "该申请单已经是账号错误,不可以删除!") + "');</script>"); bind(); return; } using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { if (!DAL.ECTransferDetailDAL.DeleteWithdraw(tran, int.Parse(id), Convert.ToDouble(dt.Rows[0]["WithdrawMoney"].ToString()), dt.Rows[0]["number"].ToString())) { tran.Rollback(); ScriptHelper.SetAlert(Page, GetTran("000417", "删除失败!")); bind(); return; } else { tran.Commit(); ScriptHelper.SetAlert(Page, GetTran("000749", "删除成功!")); bind(); } } catch { tran.Rollback(); ScriptHelper.SetAlert(Page, GetTran("000417", "删除失败!")); bind(); } } } else { ScriptHelper.SetAlert(Page, GetTran("000861", "不能重复删除!")); } } }
/// <summary> /// 确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void go_Click(object sender, EventArgs e) { //验证店铺编号 if (TxtStore.Text == "" || TxtStore.Text == null) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006026", "店铺编号不能为空!") + "');", true); return; } //获取用户选择商品的总钱和总积分 IList <MemberDetailsModel> choseProList = AddMemberDetails(); decimal SumMoney = Convert.ToDecimal(ViewState["TotalMoney"]); //Convert.ToDecimal(new RegistermemberBLL().getZongJing(choseProList)); decimal SumPv = Convert.ToDecimal(ViewState["TotalPv"]); //Convert.ToDecimal(new RegistermemberBLL().getZongPv(choseProList)); string orderID = MemberOrderAgainBLL.GetOrderInfo(IsEdit(), GetOrderId()); //获取报单号 MemberOrderModel momberorder = AddOrdrer(orderID, SumMoney, SumPv); //验证店铺是否存在 if (!MemberOrderAgainBLL.CheckStore(TxtStore.Text)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006027", "店铺编号不存在!") + "');", true); return; } //需要修改session取得期数,需要修改 if (!new RegistermemberBLL().IsMaxQiShu(CommonDataBLL.getMaxqishu())) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001543", "只可对最大期数据进行操作") + "');", true); return; } //得到用户选择商品总金额和总积分 if (choseProList.Count == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001550", "对不起,您还没有输入订货数量信息!") + "');", true); return; } if (Convert.ToBoolean(ViewState["StateCount"])) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("007039", "对不起,您选择了停售产品,并且超出了店铺库存数量!") + "');", true); return; } if (panel2.Visible) { //验证国家省份城市是否选择 if (CountryCity1.Country == "" || CountryCity1.Province == "" || CountryCity1.City == "")//|| CountryCity1.Country == "请选择" || CountryCity1.Province == "请选择" || CountryCity1.City == "请选择") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');", true); return; } } if (panel2.Visible) { //详细地址不能为空 if (Txtdz.Text == "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("006933", "对不起,请填写详细地址!") + "');", true); return; } } double notEnoughmoney = new RegistermemberBLL().CheckMoneyIsEnough(choseProList, GetStoreId(), orderID); //不足货物的钱 momberorder.LackProductMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreId(), notEnoughmoney));//获得标准币种 //添加订单,跟新会员业绩,和该店库存报单的费用 if (MemberOrderAgainBLL.AddOrderData(IsEdit(), momberorder, choseProList)) { if (!IsEdit()) { double totalmoney = Convert.ToDouble(SumMoney); double totalcomm = 0; double zongMoney = totalmoney + totalcomm; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "var formobj=document.createElement('form');" + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(momberorder.OrderId, 1, 1) + "';" + "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='MemberOrder.aspx';", true); //购物车的session if (Session["proList"] != null) { Session.Remove("proList"); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("000222", "修改成功!") + "');location.href='membertrade.aspx';", true); } } else { if (!IsEdit()) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("001557", "报单失败!") + "');", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('" + GetTran("000225", "修改失败!") + "');", true); } } }
public OrderFinalModel GetDataModelFx1(int mType, string storeid, out IList <MemberDetailsModel> choseProList, int flag) { OrderFinalModel ofm = new OrderFinalModel(); LetUsOrder luo = new LetUsOrder(); luo.SetVlaue(); //OrderFinalModel ofm2 = ((OrderFinalModel)HttpContext.Current.Session["fxMemberModel"]); RegistermemberBLL registermemberBLL = new RegistermemberBLL(); MemberInfoModel mim = new MemberInfoModel(); mim.Number = luo.MemBh; mim.StoreID = storeid; int OType = luo.OrderType; ofm.Number = luo.MemBh; ofm.Placement = ""; ofm.Direct = ""; ofm.ExpectNum = CommonDataBLL.getMaxqishu(); ofm.OrderID = ofm.OrderID = new RegistermemberBLL().GetOrderInfo("add", null); ofm.StoreID = storeid; ofm.Name = ""; ofm.PetName = ""; ofm.LoginPass = ""; ofm.AdvPass = ""; ofm.LevelInt = 1; ofm.RegisterDate = DateTime.Now; ofm.Birthday = DateTime.Now; ofm.Sex = 0; ofm.HomeQuhao = ""; ofm.HomeTele = ""; ofm.OfficeQuhao = ""; ofm.OfficeTele = ""; ofm.OfficeFjh = ""; ofm.MobileTele = ""; ofm.FaxQuhao = ""; ofm.FaxTele = ""; ofm.FaxFjh = ""; ofm.CPCCode = ""; ofm.Address = ""; ofm.PostalCode = ""; ofm.PaperType.PaperTypeCode = ""; ofm.PaperNumber = ""; ofm.BankCode = ""; ofm.BankAddress = ""; ofm.BankCard = ""; ofm.BCPCCode = ""; ofm.BankBook = ""; ofm.Remark = ""; ofm.ChangeInfo = ""; ofm.Healthy = 1; ofm.PhotoPath = ""; ofm.PhotoW = 0; ofm.PhotoH = 0; ofm.Email = ""; ofm.IsBatch = 0; ofm.Language = 1; ofm.OperateIp = ""; ofm.OperaterNum = ""; ofm.District = 1; ofm.Answer = ""; ofm.Question = ""; ofm.Error = ""; ofm.Bankbranchname = ""; ofm.Flag = flag; //memberorder开始 DataTable dt11 = GetMoneyAndProMess(mim.Number, mType, OType); if (dt11.Rows.Count > 0) { ofm.TotalMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(mim.StoreID, Convert.ToDouble(dt11.Rows[0]["TotalPriceAll"]))); ofm.TotalPv = Convert.ToDecimal(dt11.Rows[0]["TotalPvAll"]); } else { ofm.TotalMoney = 0; ofm.TotalPv = 0; } ofm.PayExpect = ofm.ExpectNum; ofm.OrderExpect = ofm.ExpectNum; //ofm.IsAgain = ofm2.IsAgain; ofm.OrderDate = DateTime.Now.ToUniversalTime(); ofm.DefrayState = 0; //ofm2.DefrayState; ofm.OrderType = OType; // ofm.Type //ofm.OrderType ofm.CCPCCode ofm.ConAddress ofm.ConTelPhone ofm.ConMobilPhone ofm.ConPost //ofm.Consignee ofm.ConZipCode ofm.SendWay 不在此处理 ofm.RemittancesId = ""; ofm.ElectronicaccountId = ""; ofm.DefrayType = -1;//ofm2.DefrayType; ofm.PayCurrency = -1; ofm.PayMoney = 0; ofm.StandardCurrency = MemberOrderAgainBLL.GetBzTypeId(mim.StoreID); ofm.StandardcurrencyMoney = Convert.ToDecimal(dt11.Rows[0]["TotalPriceAll"]); ofm.CarryMoney = 0; ofm.IsreceiVables = 0; ofm.IsRetail = 0; ofm.DeclareMoney = 0; ofm.PaymentMoney = 0; DataTable dt22 = GetProMess(mim.Number, mType, OType); choseProList = AddMemberDetails(dt22); if (ofm.SendWay == 0) { ofm.EnoughProductMoney = Convert.ToDecimal(registermemberBLL.getEnoughProductMoney(choseProList, mim.StoreID)); double notEnoughmoney = registermemberBLL.CheckMoneyIsEnough(choseProList, mim.StoreID); ofm.LackProductMoney = Convert.ToDecimal(registermemberBLL.ChangeNotEnoughMoney(mim.StoreID, notEnoughmoney)); } else { ofm.EnoughProductMoney = 0; ofm.LackProductMoney = ofm.TotalMoney; } if (dt22.Rows.Count > 0) { string proNum = ""; string proId = ""; string notProList = ""; for (int i = 0; i < dt22.Rows.Count; i++) { proNum += dt22.Rows[i]["proNum"].ToString() + ","; proId += dt22.Rows[i]["proId"].ToString() + ","; notProList += choseProList[i].NotEnoughProduct.ToString() + ","; } ofm.ProductIDList = proId; ofm.QuantityList = proNum; ofm.NotEnoughProductList = notProList; } else { ofm.ProductIDList = ","; ofm.QuantityList = ","; ofm.NotEnoughProductList = ","; } return(ofm); }
protected void btnOk_Click(object sender, EventArgs e) { string number = this.labBh.Text; string placement = SearchPlacement_DoubleLines1.Placement; string direct = DisposeString.DisString(this.txtDirect.Text, "'", "").Trim(); string oldplacement = ViewState["placement"].ToString(); string olddirect = ViewState["direct"].ToString(); string storeid = ViewState["storeid"].ToString(); if (placement == "" || direct == "") { lblmessage.Text = GetTran("000716", "推荐编号或安置编号都不能为空!"); return; } if (ChangeTeamBLL.CheckNum(direct)) { lblmessage.Text = GetTran("000717", "推荐编号不存在!"); return; } if (ChangeTeamBLL.CheckNum(placement)) { lblmessage.Text = GetTran("000718", "安置编号不存在!"); return; } string topMemberId = BLL.CommonClass.CommonDataBLL.getManageID(3); int district = Convert.ToInt32(ViewState["district"]);; if (placement != topMemberId) { int flag_xiou = ChangeTeamBLL.GetPlacementCount(placement, number); if (flag_xiou >= 2) { ScriptHelper.SetAlert(Page, GetTran("000000", "此安置编号下已经安置了两个人!")); return; } if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=" + direct + "").ToString() != "0") { district = AddOrderDataDAL.GetDistrict(placement, 1); if (district == 1) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=2").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else if (district == 2) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=1").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } RegistermemberBLL registermemberBLL = new RegistermemberBLL(); string CheckMember = registermemberBLL.CheckMemberInProc(number, placement, direct, storeid); CheckMember = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember); if (CheckMember != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false); return; } string p_info = registermemberBLL.GetHavePlacedOrDriect(number, "", placement, direct); if (p_info != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + p_info + "');</script>", false); return; } //判断该编号是否有安置,推荐 string GetError = registermemberBLL.GetError(direct, placement); if (GetError != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetError + "');</script>", false); return; } string GetError1 = new AjaxClass().CheckNumberNetAn(direct, placement); if (GetError1 != null && GetError1 != "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false); return; } #region 安置推荐人必须要激活 if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + direct + "'")) == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "招商编号未激活!") + "');</script>", false); return; } if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + placement + "'")) == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "互助编号未激活!") + "');</script>", false); return; } #endregion } bool ispass = false; if (ViewState["placement"].ToString() != placement || ViewState["direct"].ToString() != direct) { Application.Lock(); string msg = ChangeTeamBLL.UpdateNet(number, placement, direct, oldplacement, olddirect, district, ChangeTeamBLL.GetFlag(number), out ispass); Application.UnLock(); ScriptHelper.SetAlert(Page, msg); } else { ScriptHelper.SetAlert(Page, this.GetTran("000000", "推荐、安置人编号未变化!")); } }
protected void btnEditProduct_Click(object sender, EventArgs e) { if (CountryCity2.CheckFill() == false) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请选择地址!')</script>"); return; } if (Txtdz.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请填写地址!')</script>"); return; } string OrderId = Request.QueryString["OrderID"].ToString(); string bianhao = Request.QueryString["Number"].ToString(); SqlDataReader hydr = DAL.DBHelper.ExecuteReader("select PayCurrency,DefrayType from MemberOrder where orderid='" + OrderId + "'"); string fukuanMode = ""; int bizhong = 0; if (hydr.Read()) { fukuanMode = hydr["DefrayType"].ToString(); bizhong = Convert.ToInt32(hydr["PayCurrency"]); hydr.Close(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('订单不存在')</script>"); return; } string error = ""; //获取用户选择商品的集合 IList <MemberDetailsModel> choseProList = AddMemberDetails(); if (choseProList == null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000294", "抱歉!购货数量必须输入数字!") + "');</script>", false); return; } if (choseProList.Count == 0 && Request.QueryString["tp"] == "-1") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000296", "抱歉!您还没有选择商品!") + "');</script>", false); return; } if (Convert.ToBoolean(ViewState["StateCount"])) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007039", "对不起,您选择了停售产品,并且超出了店铺库存数量!") + "');</script>", false); return; } //获得总的购货金额和pv double TotalMoney = registermemberBLL.getZongJing(choseProList); double SumPv = registermemberBLL.getZongPv(choseProList); double bottonLine = new BLL.Registration_declarations.AddOrderBLL().GetBottomLine(); double ce = TotalMoney - bottonLine; if (ce < 0) { ScriptHelper.SetAlert(Page, "报单金额必须大于" + bottonLine.ToString()); return; } //无货总金额 double notEnoughmoney = registermemberBLL.CheckMoneyIsEnough(choseProList, GetStoreID(), OrderId); //if (Ddzf.SelectedValue != "2") //{ // if (notEnoughmoney > Convert.ToDouble(ViewState["dpm"])) // { // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('店铺报单额不够!')</script>"); // return; // } //} if (this.Ddzf.SelectedValue.ToString() == "2") { string elcNumber = this.txtdzbh.Text.Trim().ToLower(); string elcPassword = Encryption.Encryption.GetEncryptionPwd(this.txtdzmima.Text, elcNumber); string CheckEctResult = registermemberBLL.CheckEctPassWord(this.Ddzf.SelectedValue, elcNumber, elcPassword); if (CheckEctResult != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckEctResult + "');</script>", false); return; } //需要修改 double elcMoney = Convert.ToDouble(CommonDataBLL.EctBalance(txtdzbh.Text.Trim())); //如果电子金额少于用户订单总额 if (elcMoney < Convert.ToDouble(TotalMoney)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001528", "用户") + this.txtdzbh.Text.Trim() + GetTran("001529", "的电子钱包不够本次报单!") + "');</script>", false); return; } } //有货总金额 double EnoughProductMoney = 0.00;//Convert.ToDouble(registermemberBLL.getEnoughProductMoney(choseProList, GetStoreID())); int qs = BLL.CommonClass.CommonDataBLL.getMaxqishu(); List <MemberDetailsModel> lmdm = new List <MemberDetailsModel>(); lmdm = (List <MemberDetailsModel>)choseProList; if (Session["mim"] != null) { MemberInfoModel mim = (MemberInfoModel)Session["mim"]; MemberOrderModel mom = new MemberOrderModel(); mom.Number = bianhao; mom.OrderId = OrderId; mom.StoreId = GetStoreID(); mom.TotalMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreID(), Convert.ToDouble(TotalMoney)));// Convert.ToDecimal(TotalMoney); mom.TotalPv = Convert.ToDecimal(SumPv); DataTable dtoinfo = RegistermemberBLL.Getmominfoofmember(OrderId); if (dtoinfo != null && dtoinfo.Rows.Count > 0) { mom.CarryMoney = Convert.ToDecimal(dtoinfo.Rows[0]["CarryMoney"]); mom.OrderExpect = Convert.ToInt32(dtoinfo.Rows[0]["OrderExpectNum"]); mom.PayExpect = Convert.ToInt32(dtoinfo.Rows[0]["PayExpectNum"]); mom.Err = ""; mom.IsAgain = Convert.ToInt32(dtoinfo.Rows[0]["IsAgain"]); mom.OrderDate = Convert.ToDateTime(dtoinfo.Rows[0]["OrderDate"]); //DateTime.Now; mom.Remark = ""; mom.DefrayState = Convert.ToInt32(dtoinfo.Rows[0]["DefrayState"]); mom.Consignee = dtoinfo.Rows[0]["Consignee"].ToString(); mom.RemittancesId = dtoinfo.Rows[0]["RemittancesId"].ToString(); mom.ElectronicaccountId = dtoinfo.Rows[0]["ElectronicaccountId"].ToString(); mom.OrderType = Convert.ToInt32(dtoinfo.Rows[0]["OrderType"]); mom.IsreceiVables = Convert.ToInt32(dtoinfo.Rows[0]["DefrayState"]); } CityModel cm = new CityModel(); cm.Country = CountryCity2.Country; cm.Province = CountryCity2.Province; cm.City = CountryCity2.City; cm.Xian = CountryCity2.Xian; mom.ConCity = cm; mom.CCPCCode = mim.CPCCode; mom.ConAddress = Encryption.Encryption.GetEncryptionAddress(Txtdz.Text.Trim()); mom.ConZipCode = mim.PostalCode; mom.ConTelPhone = mim.HomeTele; mom.ConMobilPhone = mim.MobileTele; mom.ConPost = mim.Email; mom.DefrayType = Convert.ToInt32(Ddzf.SelectedValue); mom.DefrayType = Convert.ToInt32(ViewState["DefrayType"]); mom.PayMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreID(), Convert.ToDouble(TotalMoney)) / MemberOrderAgainBLL.GetBzHl(Convert.ToInt32(DropCurrency.SelectedValue)));//Convert.ToDecimal(TotalMoney); mom.PayCurrency = Convert.ToInt32(DropCurrency.SelectedValue); mom.StandardCurrency = MemberOrderAgainBLL.GetBzTypeId(GetStoreID()); mom.StandardcurrencyMoney = Convert.ToDecimal(TotalMoney); mom.OperateIp = Request.UserHostAddress; mom.OperateNumber = GetStoreID(); mom.SendType = Convert.ToInt32(ddth.SelectedValue); if (mom.DefrayState == 0) { mom.PaymentMoney = 0; } else { mom.PaymentMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreID(), Convert.ToDouble(TotalMoney)) / MemberOrderAgainBLL.GetBzHl(Convert.ToInt32(DropCurrency.SelectedValue))); } mom.ReceivablesDate = Convert.ToDateTime(DBHelper.ExecuteScalar("select ReceivablesDate from MemberOrder where OrderID='" + OrderId + "'")); //DateTime.Now; mom.EnoughProductMoney = Convert.ToDecimal(EnoughProductMoney); mom.LackProductMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(GetStoreID(), Convert.ToDouble(notEnoughmoney))); //获得标准币种Convert.ToDecimal(notEnoughmoney); mom.SendWay = Convert.ToInt32(DDLSendType.SelectedValue); if (Ddzf.SelectedValue == "2") { mom.ElectronicaccountId = this.txtdzbh.Text.Trim(); } if (mom.OperateNumber.Trim().Length == 0) { if (Session["Company"] != null) { mom.OperateNumber = "管理员:" + Session["Company"].ToString(); } } string aa = MemberOrderBLL.UpdateMemberOrder(OrderId, lmdm, mom, GetStoreID()); if (aa == "1") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功');window.location.href=window.location.href+'&date='+new Date().getTime()</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改失败')</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('登录超时,请重新登录');window.location.href='index.aspx'</script>"); } }