protected void Page_Load(object sender, EventArgs e) { hidCompId.Value = CompID.ToString(); if (!IsPostBack) { DataBinds(); if (KeyID != 0) { List <Hi.Model.BD_Distributor> Ldis = new Hi.BLL.BD_Distributor().GetList("", "auditstate=2 and isnull(IsEnabled,0)=1 and isnull(dr,0)=0 and SMID = " + KeyID + " and CompID=" + CompID, ""); if (Ldis.Count > 0) { tbdis.Attributes["style"] = "display:block;"; } else { tbdis.Attributes["style"] = "display:none;"; } Rpt_Dis.DataSource = Ldis; Rpt_Dis.DataBind(); for (int i = 0; i < Ldis.Count; i++) { hidselectDis.Value += Ldis[i].ID + ","; } hidselectDis.Value = hidselectDis.Value.TrimEnd(','); } } }
/// <summary> /// 搜索按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { txtDisAreaBox.CompID = CompID.ToString(); string strWhere = Where(); ViewState["strWhere"] = strWhere; Bind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtqy.CompID = CompID.ToString(); Bind(); } }
protected void Page_Load(object sender, EventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>$(\".txt_txtTypename\").css(\"width\", \"120px\");</script>"); if (!IsPostBack) { this.hidCompId.Value = this.CompID.ToString(); //厂商id this.divGoodsName.InnerText = disBing(CompID.ToString()); //下拉商品的动态加载隐藏 } }
/// <summary> /// 分页控件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Pager_PageChanged(object sender, EventArgs e) { txtDisType.CompID = CompID.ToString(); page = Pager.CurrentPageIndex.ToString(); string strWhere = Where(); ViewState["strWhere"] = strWhere; Bind(); }
public string page = "1";//默认初始页 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string CmopId = CompID.ToString(); //txtDisArea.CompID = CmopId; this.txtPager.Value = "12"; Bind(); } }
public string page = "1";//默认初始页 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtDisAreaBox.CompID = CompID.ToString(); if (Request.QueryString["page"] != null) { page = Request.QueryString["page"].ToString(); Pager.CurrentPageIndex = Convert.ToInt32(page); } } }
public void Bind() { string goodsids = new Hi.BLL.BD_DisCollect().GetGoodsIDs(this.DisID); if (string.IsNullOrEmpty(goodsids)) { goodsids = "0"; } string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } strwhere += " and isnull(dr,0)=0 and id in (" + goodsids + ") and IsEnabled=1 and ISOffline=1"; Pager.PageSize = 12; //根据代理商ID获取可采购的商品ID集合 List <Common.GoodsID> gl = Common.DisEnAreaGoodsID(this.DisID.ToString(), CompID.ToString()); string GoodsId = string.Empty; if (gl != null && gl.Count > 0) { foreach (Common.GoodsID item in gl) { GoodsId += item.goodsID + ","; } strwhere += " and ID not in(" + GoodsId.Substring(0, GoodsId.Length - 1) + ")"; } else { //strwhere += " and ID=0"; } //List<Hi.Model.BD_Goods> orders = new Hi.BLL.BD_Goods().GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts); string sql = string.Format(@"select *,(select Inventory from BD_GoodsInfo where ID=g.ViewInfoID) infoInve,(select BarCode from BD_GoodsInfo where ID=g.ViewInfoID) BarCode from BD_Goods as g left join (select prod.GoodsID as proGoodsID from BD_Promotion as pro left join BD_PromotionDetail as prod on pro.ID=prod.ProID where pro.CompID={0} and ISNULL(pro.dr,0)=0 and (pro.ProStartTime<=GETDATE() and DATEADD(D,1,pro.ProEndTime)>GETDATE()) and ISNULL(pro.IsEnabled,0)=1 group by prod.GoodsID) as b on b.proGoodsID=g.ID where 1=1 {1} and CompID= {0} and isnull(IsEnabled,0)=1 and IsOffline=1 and isnull(dr,0)=0 order by b.proGoodsID desc,g.CreateDate desc", this.CompID, strwhere); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptfavorite.DataSource = dt; this.rptfavorite.DataBind(); }
public decimal ztf = 0; //180-总计 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string CreateDate = "0"; if (Common.GetCompService(CompID.ToString(), out CreateDate) == "0") { Response.Redirect("../SysManager/Service.aspx", true); } this.txtPager.Value = Common.PageSize; //默认本周 ViewState["strwhere2"] = Where2(); Bind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定推荐商品 BindTopGoods(); //绑定联系人 PrincipalBind(); //绑定新闻 NewsBind(); Hid_UserCompKey.Value = Common.DesEncrypt(CompID.ToString(), Common.EncryptKey); } top1.IsHiddenLeft = true; BindShowJson = "var Showoption = { \"btnBanner\": \".banner-edit\",\"btnRecommend\": \".adMenu-edit\",\"btnFiveImg\": \".adImg-edit\",\"btnContact\": \".contact-edit\" }; \n var RequesType = { Query:0,Submit:1,Action:2 };"; }
public int pretype = 0; //支付类型 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string CreateDate = "0"; if (Common.GetCompService(CompID.ToString(), out CreateDate) == "0") { Response.Redirect("../SysManager/Service.aspx", true); } this.txtPager.Value = Common.PageSize; if (Request.QueryString["type"] == null) { this.txtCreateDate.Value = DateTime.Now.AddDays(1 - DateTime.Now.Day).ToString("yyyy-MM-dd"); this.txtECreateDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); } else { if (Request.QueryString["type"] + "" == "1") { this.txtCreateDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); this.txtECreateDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); } } //修改支付流程新增详情页面 start if (Request["Paymnetid"] != null) { paymentid = Convert.ToInt32(Common.DesDecrypt(Request["Paymnetid"].ToString(), Common.EncryptKey)); } if (Request["pretype"] != null) { pretype = Convert.ToInt32(Common.DesDecrypt(Request["pretype"].ToString(), Common.EncryptKey)); } //修改支付流程新增详情页面 end //不排除管理员的权限验证 if (!Common.HasRightAll(this.CompID, this.UserID, "1030")) { this.DelAll.Visible = false; } ViewState["strwhere"] = Where(); Bind(); } }
public decimal te = 0; //退货金额总计 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string CreateDate = "0"; if (Common.GetCompService(CompID.ToString(), out CreateDate) == "0") { Response.Redirect("../SysManager/Service.aspx", true); } this.txtPager.Value = Common.PageSize; //默认本周 this.txtBCreateDate.Value = DateTime.Now.AddDays(Convert.ToDouble((1 - Convert.ToInt16(DateTime.Now.DayOfWeek)))).ToString("yyyy-MM-dd"); this.txtECreateDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); Bind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IsShow = OrderInfoType.rdoOrderAudit("订单明细是否显示店铺商品", 0).ToInt(0); IsInve = OrderInfoType.rdoOrderAudit("商品是否启用库存", CompID).ToInt(0); hidCompID.Value = CompID.ToString(); hidUserType.Value = this.TypeID.ToString(); hidPicpath.Value = Common.GetWebConfigKey("OssImgPath") + "company/" + CompID + "/"; if (!string.IsNullOrEmpty(Request["top"])) { top = Request["top"].ToInt(0); } if (top == 0) { navigation2.Attributes.Add("href", "orderBuy.aspx"); } else if (top == 2) { navigation2.Attributes.Add("href", "../Order/OrderAuditList.aspx"); } else if (top == 3) { navigation2.Attributes.Add("href", "../Order/OrderShipList.aspx"); } else if (top == 4)//线下付款成功,刷新页面 { ClientScript.RegisterStartupScript(this.GetType(), "payshowTop", "<script>TopShow();</script>"); } databind(); } }
protected void Btn_Save(object sender, EventArgs e) { string OgCode = string.Empty; LPayOpen = new Hi.BLL.PAY_OpenAccount().GetList("", " isnull(dr,0)=0 and CompID=" + CompID + " and DisID=0", ""); BLL.Service.OpenAccountParame OPB = new BLL.Service.OpenAccountParame(); IPubnetwk IPT = new IPubnetwk(); IPT.Timeout = 2500; if (LPayOpen.Count > 0) { LPayOpen[0].AccName = txtAccName.Value.Trim(); LPayOpen[0].AccountName = txtAccountName.Value.Trim(); LPayOpen[0].AccountNature = ddlAccountNature.SelectedValue.ToInt(0); LPayOpen[0].DocumentType = ddlDocumentType.SelectedValue; LPayOpen[0].DocumentCode = txtDocumentCode.Value.Trim(); LPayOpen[0].OrgCode = txtOrgCode.Value.Trim(); LPayOpen[0].BusinessLicense = txtBusinessLicense.Value.Trim(); LPayOpen[0].AccAddress = txtAccAddress.Value.Trim(); LPayOpen[0].Sex = ddlSex.SelectedValue.ToInt(0); if (txtNationality.Value.Trim() != "") { LPayOpen[0].Nationality = txtNationality.Value.Trim(); } LPayOpen[0].PhoneNumbe = txtPhoneNumbe.Value.Trim(); LPayOpen[0].Phone = txtPhone.Value.Trim(); LPayOpen[0].Email = txtEmail.Value.Trim(); LPayOpen[0].Fax = txtFax.Value.Trim(); LPayOpen[0].Postcode = txtPostcode.Value.Trim(); LPayOpen[0].ts = DateTime.Now; LPayOpen[0].modifyuser = UserID; //开销户接口信息 OPB.msghd_trdt = DateTime.Now.ToString("yyyyMMdd"); OPB.srl_ptnsrl = Common.Number_repeat("1"); LPayOpen[0].vdef1 = OPB.srl_ptnsrl; OPB.cltacc_cltno = LPayOpen[0].AccNumver; OPB.cltacc_subno = ""; OPB.cltacc_cltnm = LPayOpen[0].AccName; OPB.cltacc_pwd = ""; OPB.clt_nm = LPayOpen[0].AccountName; OPB.clt_kd = LPayOpen[0].AccountNature.ToString(); OPB.clt_cdtp = LPayOpen[0].DocumentType; OPB.clt_cdno = LPayOpen[0].DocumentCode; OPB.clt_orgcd = LPayOpen[0].OrgCode; OPB.clt_bslic = LPayOpen[0].BusinessLicense; OPB.clt_gender = LPayOpen[0].Sex.ToString(); OPB.clt_nationality = "CHN"; OPB.clt_telno = LPayOpen[0].PhoneNumbe; OPB.clt_faxno = LPayOpen[0].Fax; OPB.clt_mobno = LPayOpen[0].Phone; OPB.clt_email = LPayOpen[0].Email; OPB.clt_postno = LPayOpen[0].Postcode; OPB.clt_addr = LPayOpen[0].AccAddress; if (LPayOpen[0].State != 1) { OPB.fcflg = "1"; } else { OPB.fcflg = "2"; } OPB.acctp = "1"; try { string Result = IPT.trd11000(new JavaScriptSerializer().Serialize(OPB)); JsonData jData = null; try { jData = JsonMapper.ToObject(Result); } catch { throw new Exception(Result); } if (jData != null) { if (jData["msghd_rspcode"].ToString() == "000000") { LPayOpen[0].State = 1; if (new Hi.BLL.PAY_OpenAccount().Update(LPayOpen[0])) { Response.Redirect("SpendingUserInfo.aspx", false); } } else { lblMsg.InnerText = "开销户修改失败," + jData["msghd_rspmsg"].ToString() + ""; lblMsg.Visible = true; } } } catch (Exception ex) { lblMsg.InnerText = "开销户修改失败," + ex.Message + ""; lblMsg.Visible = true; } } else { OgCode = ConfigurationManager.AppSettings["OrgCode"] + CompID.ToString(); if (Common.OenAExistsAttribute("AccNumver", OgCode.Trim())) { lblMsg.InnerText = "开销户账户号已存在,请修改。"; lblMsg.Visible = true; return; } Hi.Model.PAY_OpenAccount model = new Hi.Model.PAY_OpenAccount(); model.CompID = CompID; model.State = (int)Enums.Pay_OpenState.失败; model.AccNumver = OgCode; model.AccName = txtAccName.Value.Trim(); model.AccountName = txtAccountName.Value.Trim(); model.AccountNature = ddlAccountNature.SelectedValue.ToInt(0); model.DocumentType = ddlDocumentType.SelectedValue; model.DocumentCode = txtDocumentCode.Value.Trim(); model.OrgCode = txtOrgCode.Value.Trim(); model.BusinessLicense = txtBusinessLicense.Value.Trim(); model.AccAddress = txtAccAddress.Value.Trim(); model.Sex = ddlSex.SelectedValue.ToInt(0); if (txtNationality.Value.Trim() != "") { model.Nationality = txtNationality.Value.Trim(); } model.PhoneNumbe = txtPhoneNumbe.Value.Trim(); model.Phone = txtPhone.Value.Trim(); model.Email = txtEmail.Value.Trim(); model.Fax = txtFax.Value.Trim(); model.Postcode = txtPostcode.Value.Trim(); model.ts = DateTime.Now; model.modifyuser = UserID; //开销户接口信息 OPB.msghd_trdt = DateTime.Now.ToString("yyyyMMdd"); OPB.srl_ptnsrl = Common.Number_repeat("1"); model.vdef1 = OPB.srl_ptnsrl; OPB.cltacc_cltno = model.AccNumver; OPB.cltacc_subno = ""; OPB.cltacc_cltnm = model.AccName; OPB.cltacc_pwd = ""; OPB.clt_nm = model.AccountName; OPB.clt_kd = model.AccountNature.ToString(); OPB.clt_cdtp = model.DocumentType; OPB.clt_cdno = model.DocumentCode; OPB.clt_orgcd = model.OrgCode; OPB.clt_bslic = model.BusinessLicense; OPB.clt_gender = model.Sex.ToString(); OPB.clt_nationality = "CHN"; OPB.clt_telno = model.PhoneNumbe; OPB.clt_faxno = model.Fax; OPB.clt_mobno = model.Phone; OPB.clt_email = model.Email; OPB.clt_postno = model.Postcode; OPB.clt_addr = model.AccAddress; OPB.fcflg = "1"; OPB.acctp = "1"; try { string Result = IPT.trd11000(new JavaScriptSerializer().Serialize(OPB)); JsonData jData = null; try { jData = JsonMapper.ToObject(Result); } catch { throw new Exception(Result); } if (jData != null) { if (jData["msghd_rspcode"].ToString() == "000000") { model.State = (int)Enums.Pay_OpenState.成功; if (new Hi.BLL.PAY_OpenAccount().Add(model) > 0) { Response.Redirect("SpendingUserInfo.aspx", false); } } else { lblMsg.InnerText = "开户失败," + jData["msghd_rspmsg"].ToString() + ""; lblMsg.Visible = true; } } } catch (Exception ex) { lblMsg.InnerText = "开户失败," + ex.Message; lblMsg.Visible = true; } } }
protected void btn_Save(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { if (Common.CompExistsAttribute("CompName", txtCompName.Value.Trim(), CompID.ToString())) { JScript.AlertMsgOne(this, "该厂商名称已存在!", JScript.IconOption.错误); return; } comp.ShortName = Common.NoHTML(txtShortName.Value.Trim()); comp.CompName = Common.NoHTML(txtCompName.Value.Trim()); comp.creditCode = Common.NoHTML(txtLicence.Value.Trim()); comp.Tel = Common.NoHTML(txtTel.Value.Trim()); comp.Fax = Common.NoHTML(txtFax.Value.Trim()); comp.Zip = Common.NoHTML(txtZip.Value.Trim()); comp.Account = Common.NoHTML(txtAccount.Value.Trim()); comp.OrganizationCode = Common.NoHTML(txtOrcode.Value.Trim()); comp.Legal = Common.NoHTML(txtLegal.Value.Trim()); comp.Identitys = Common.NoHTML(txtIdentitys.Value.Trim()); comp.LegalTel = Common.NoHTML(txtLegalTel.Value.Trim()); comp.HotShow = rdHotShowYes.Checked ? 1 : 0; comp.QQ = Common.NoHTML(QQ.Value.Trim()); //comp.FinanceCode = txtFinanceCode.Value.Trim(); //comp.FinanceName = txtFinanceName.Value.Trim(); if (txtPrincipal.Value.Trim() == "") { comp.Principal = Common.NoHTML(txtUserTrueName.Value.Trim()); } else { comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); } if (txtPhone.Value.Trim() == "") { comp.Phone = Common.NoHTML(txtUserPhone.Value.Trim()); } else { comp.Phone = Common.NoHTML(txtPhone.Value.Trim()); } comp.ManageInfo = Common.NoHTML(txtInfo.Value.Trim()); comp.IndID = txtIndusName.SelectedValue.ToInt(0); if (HidFfileName.Value != "") { if (string.IsNullOrEmpty(comp.Attachment)) { comp.Attachment = Common.NoHTML(HidFfileName.Value); } else { comp.Attachment += "," + Common.NoHTML(HidFfileName.Value); } } comp.Address = Common.NoHTML(txtAddress.Value.Trim()); comp.ts = DateTime.Now; comp.modifyuser = UserID; if (new Hi.BLL.BD_Company().Update(comp)) { List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("", " isnull(dr,0)=0 and compid='" + CompID + "' and utype=4", ""); if (user2.Count > 0) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID); if (user != null) { // List<Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and compid='" + CompID + "' and type=4", ""); // if (user.Count > 0) //{ user.ts = DateTime.Now; user.modifyuser = UserID; user.TrueName = txtUserTrueName.Value; new Hi.BLL.SYS_Users().Update(user); } Response.Redirect("CompServiceInfo.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.hidType2.Value = Request.QueryString["type"] + ""; this.hidDisID.Value = this.DisID.ToString(); this.hidKeyId.Value = KeyID.ToString(); StringBuilder strwhere = new StringBuilder(); Fanli = OrderInfoType.rdoOrderAudit("订单支付返利是否启用", CompID).ToInt(0); this.hidFanl.Value = Fanli.ToString(); LoginModel logUser = Session["UserModel"] as LoginModel; Common.ListComps(this.ddrComp, this.UserID.ToString(), this.CompID.ToString()); this.hidCompId.Value = this.ddrComp.Value.ToString(); decimal CreditAmount = 0; if (BLL.Common.GetCredit(this.hidCompId.Value.ToString().ToInt(0), logUser.DisID, out CreditAmount)) { decimal GetSumAmount = OrderInfoType.GetSumAmount(logUser.DisID.ToString(), this.hidCompId.Value.ToString(), KeyID); if (GetSumAmount >= CreditAmount) { this.Msg.InnerHtml = "您的授信额度(" + CreditAmount + ")已用完或超出!无法下单"; this.Btn.InnerHtml = "<a href=\"javascript:; \" class=\"gray-btn2\">取消</a>"; } else { this.Msg.InnerHtml = ""; } } else { this.Msg.InnerHtml = ""; } // isbate = OrderInfoType.rdoOrderAudit("订单支付返利是否启用", CompID).ToInt(0); //if (Fanli == 0) //{ // this.trbate.Visible = false; // this.rebate.Visible = false; //} //商品是否启用库存 IsInve = OrderInfoType.rdoOrderAudit("商品是否启用库存", this.CompID).ToInt(0); if (IsInve == 0) { strwhere.AppendFormat("and info.Inventory>0"); } DataTable dt = SqlHelper.Query(SqlHelper.LocalSqlServer, SelectGoodsInfo.Returnsql(CompID.ToString(), DisID.ToString(), strwhere.ToString(), "1")).Tables[0]; List <int> infoidl = new List <int>(); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow item in dt.Rows) { int id = item["ID"].ToString().ToInt(0);//BD_goodsInfo表的ID infoidl.Add(id); } } //获取商品价格 List <BLL.gDprice> l = BLL.Common.GetPrice(CompID, DisID, infoidl); if (l != null && l.Count > 0) { foreach (var item in l) { DataRow[] dr = dt.Select(" ID=" + item.goodsInfoId); if (dr.Length > 0) { //获取的价格大于促销价时、取促销价 dr[0]["pr"] = item.FinalPrice; dr[0]["typeTinkerPrice"] = item.typePrice; dr[0]["disTinkerPrice"] = item.disPrice; dr[0]["disProPr"] = item.bpPrice; } } } this.divGoodsName.InnerText = ConvertJson.ToJson2(dt); //代理商列表 List <Hi.Model.BD_Distributor> list = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compid=" + this.CompID, ""); this.divDisList.InnerText = ConvertJson.ToJson(Common.FillDataTable(list)); if (KeyID != 0) { if (Request.QueryString["type"] + "" != "2") { Hi.Model.DIS_Order model = new Hi.BLL.DIS_Order().GetModel(KeyID); //判断订单是否可以修改 企业下单订单已审未支付,代理商下单企业不能修改 if (model.OState > (int)Enums.OrderState.待审核) { JScript.AlertAndRedirect("订单已被其他人修改,请刷新后再重新操作!", "orderdetail.aspx?top=1&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)); return; } } else { this.hidType.Value = Request.QueryString["type"] + ""; } Bind(); } else { if ((Request.QueryString["type"] + "") == "1") { this.hidType.Value = Request.QueryString["type"] + ""; ShopCart(); } } } }
/// <summary> /// 提交订单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnPrn_Click(object sender, EventArgs e) { Hi.Model.DIS_Order OrderInfoModel = OrderBll.GetModel(KeyID); string GoodsName = string.Empty; string GoodMome = string.Empty; if (OrderInfoModel != null) { //判断订单明细是否有商品数据为0的 List <Hi.Model.DIS_OrderDetail> ld = OrderDetailBll.GetList("", " OrderID=" + KeyID, ""); if (ld != null) { if (ld.Count > 0) { foreach (Hi.Model.DIS_OrderDetail item in ld) { if (item.GoodsNum <= 0) { //订单存在有商品数量小于等于0的商品 JScript.AlertMsgOne(this, "订单明细数据不正确,无法提交!", JScript.IconOption.错误); return; } //判断商品是否可购买 if (OrderInfoType.IsGoodsShip(this.DisID, item.GoodsinfoID, item.vdef1.ToInt(0), CompID.ToString(), out GoodsName, out GoodMome) == 1) { JScript.AlertMsgOne(this, "订单商品:" + GoodsName + "," + GoodMome + ",不能提交!", JScript.IconOption.错误); return; } } } else { //没有商品明细 JScript.AlertMsgOne(this, "订单明细数据不正确,无法提交!", JScript.IconOption.错误); return; } } if (OrderInfoModel.OState == (int)Enums.OrderState.未提交 || OrderInfoModel.OState == (int)Enums.OrderState.退回) { int OState = (int)Enums.OrderState.待审核; string sql = string.Empty; if (OrderInfoModel.IsAudit == 1) { //无需审核 OState = (int)Enums.OrderState.已审; sql = " update [DIS_Order] set [OState]=" + OState + ",[AuditDate]='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where ID=" + KeyID; } else { sql = " update [DIS_Order] set [OState]=" + OState + " where ID=" + KeyID; } if (OrderBll.UpdateOrderState(sql)) { Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单提交", ""); new Common().GetWxService("1", KeyID.ToString(), "1"); if (OrderInfoModel.IsAudit == 1) { //无需审核 if (OrderInfoModel.Otype == (int)Enums.OType.赊销订单) { ClientScript.RegisterStartupScript(GetType(), "", "<script>location.href=location.href;</script>"); return; } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>location.href='pay/Pay.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey) + "';</script>"); //Response.Redirect("pay/Pay.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)); return; } } else { //需审核 //Bind(); JScript.AlertMethod(this, "您已成功提交,请等待审核!", JScript.IconOption.正确, "function (){ location.replace('" + ("neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)) + "'); }"); //Response.Redirect("OrderInfo.aspx?KeyID=" + KeyID); } } } else { JScript.AlertMsgOne(this, "订单状态不正确,不能进行提交!", JScript.IconOption.错误); } } else { JScript.AlertMsgOne(this, "数据不存在!", JScript.IconOption.错误); } }
/// <summary> /// 数据绑定 /// </summary> public void DataBinds() { int pageCount = 0; int Counts = 0; string disName = this.txtDisName.Value.Trim(); Pager.PageSize = txtPageSize.Value.ToInt(0); DataTable dt = new Hi.BLL.YZT_FCmaterials().getDataTable(Pager.PageSize, Pager.CurrentPageIndex, CompID.ToString(), disName, out pageCount, out Counts); this.Rpt_Distribute.DataSource = dt; this.Rpt_Distribute.DataBind(); Pager.RecordCount = dt.Rows.Count; page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 修改是绑定的数据 /// </summary> public void Bind() { //判断是否有权限 if (!Common.PageCompOperable("Order", KeyID, CompID)) { Response.Redirect("../../NoOperable.aspx"); return; } Hi.Model.DIS_Order OrderInfoModel = new Hi.BLL.DIS_Order().GetModel(KeyID); if (OrderInfoModel != null) { hidts.Value = OrderInfoModel.ts.ToString(); //时间戳 this.divGoodsName.InnerText = disBing(CompID.ToString(), OrderInfoModel.DisID.ToString()); //筛选商品 Hi.Model.BD_Distributor model = new Hi.BLL.BD_Distributor().GetModel(OrderInfoModel.DisID); this.txtDisName.Value = model.DisName; //代理商名称 this.txtDisName.Disabled = true; //只读 this.hidDisID.Value = OrderInfoModel.DisID.ToString(); //代理商ID if (Request["type"] + "" != "2" || Fanli == 1) { this.txtRebate.Value = OrderInfoModel.bateAmount.ToString(); //返利金额 } this.txtDate.Value = OrderInfoModel.ArriveDate.ToString("yyyy-MM-dd") == "0001-01-01" ? "" : OrderInfoModel.ArriveDate.ToString("yyyy-MM-dd"); //交货日期 this.lblPsType.InnerText = OrderInfoModel.GiveMode; //配送方式 this.lblPsType2.InnerText = OrderInfoModel.GiveMode == "送货" ? "自提" : "送货"; this.hidPsType.Value = OrderInfoModel.GiveMode; //配送方式 this.OrderNote.Value = OrderInfoModel.Remark; //订单备注 this.hidAdder.Value = OrderInfoModel.Address; //地址 this.hidAddName.Value = OrderInfoModel.Principal; //联系人 this.hidAddPhone.Value = OrderInfoModel.Phone; //联系人电话 this.hrAdder.Value = OrderInfoModel.AddrID.ToString(); //收货地址id this.hrOrderFj.Value = OrderInfoModel.Atta; //附件文件 string str10 = decimal.Parse(string.Format("{0:N2}", OrderInfoModel.PostFee.ToString())).ToString("0.00"); //运费 this.lblPostFee.InnerText = str10; //运费 this.hidPostFree.Value = str10; //运费 //附件 string str3 = string.Empty; //附件信息 if (OrderInfoModel.Atta.ToString() != "") { StringBuilder li = new StringBuilder(); string[] atta = OrderInfoModel.Atta.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries); if (atta.Length > 0) { foreach (var item in atta) { string[] att = item.Split(new string[] { "^^" }, StringSplitOptions.RemoveEmptyEntries); li.AppendFormat("<li> <a href=\"javascript:;\" class=\"name\">{0}(大小:{4}KB)</a><a href=\"javascript:;\" class=\"bule del\" tip=\"{3}\" orderid=\"{1}\">删除</a><a href=\"{2}\" target=\"_blank\" class=\"bule\">下载</a></li>", att[0] + att[1].Substring(att[1].LastIndexOf(".")), KeyID, Common.GetWebConfigKey("ImgViewPath") + "OrderFJ/" + item, item, OrderType.GetSize(item)); } } str3 = li.ToString(); } //收货信息 string str = "收货人:" + OrderInfoModel.Principal + ",联系电话:" + OrderInfoModel.Phone + ",收货地址:" + OrderInfoModel.Address; string price = string.Empty;//返利总金额 if (Request.QueryString["type"] + "" == "2") { //再次购买时获取返利总金额 price = OrderType.GetRebate(0, OrderInfoModel.DisID); } else { //其他获取返利总金额 price = OrderType.GetRebate(KeyID, OrderInfoModel.DisID); } //可用返利金额 string str4 = "可用返利¥ <label id=\"lblRebate\">" + string.Format("{0:N2}", price.ToString()) + "</label><i class=\"sus-i seebate\"></i>"; List <Hi.Model.DIS_OrderDetail> ll = new Hi.BLL.DIS_OrderDetail().GetList("", "isnull(dr,0)=0 and orderId=" + KeyID, ""); if (ll.Count > 0) { string html = string.Empty; //绑定的商品数据 int index = 0; //索引 string str8 = "0.00"; //商品小计 foreach (Hi.Model.DIS_OrderDetail obj in ll) { Hi.Model.BD_GoodsInfo model2 = new Hi.BLL.BD_GoodsInfo().GetModel(obj.GoodsinfoID); string kc = string.Empty; decimal newprice = obj.AuditAmount; //判断修改和再次购买时的价格 显示的 decimal newprice2 = obj.GoodsPrice; //判断修改和再次购买时的价格 隐藏的 str8 = decimal.Parse(string.Format("{0:N2}", obj.sumAmount)).ToString("0.00"); //判断修改和再次购买时的小计价格 // decimal str88 = 0;//判断修改和再次购买时的小计价格 隐藏的 if (Request.QueryString["type"] + "" == "2") { //再次 购买时获取库存 kc = model2.Inventory.ToString(); // newprice2 = newprice = BLL.Common.GetGoodsPrice(this.CompID, OrderInfoModel.DisID, obj.GoodsinfoID); // str8 = decimal.Parse(string.Format("{0:N2}", newprice * obj.GoodsNum)).ToString("0.00"); } else { //其他获取库存 kc = (model2.Inventory + obj.GoodsNum + obj.ProNum.ToDecimal(0)).ToString(); } string pic = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(model2.GoodsID)).Pic; //图片 string str6 = IsInve == 0 ? "" : "display:none"; //是否显示库存 string str7 = string.Empty; //是否促销 str7 = SelectGoodsInfo.protitle(obj.ProID, obj.Protype, obj.Unit); // ConvertJson.IsCx(dt.Rows[0]["proTypes"].ToString(), dt.Rows[0]["proType"].ToString(), dt.Rows[0]["proGoodsPrice"].ToString(), dt.Rows[0]["proDiscount"].ToString(), dt.Rows[0]["unit"].ToString()); //SelectGoodsInfo.protitle(obj.ProID, obj.Protype, obj.Unit); string Digits = OrderInfoType.rdoOrderAudit("订单下单数量是否取整", this.CompID); //小数位数 decimal num = decimal.Parse(string.Format("{0:N4}", (obj.GoodsNum).ToString("#,####" + Digits))); //购买数量 string str9 = obj.Remark; //goodsInfoid备注 if (obj.Remark != null && obj.Remark.Length > 6) { str9 = obj.Remark.Substring(0, 6) + "..."; } string strremark = string.Empty;//鼠标移上去时显示的备注 if (obj.Remark != "") { strremark = "<div class=\"divremark" + index + "\">" + str9 + "</div><div class=\"cur\">" + obj.Remark + "</div>"; } // decimal zxprice = BLL.Common.GetGoodsPrice(this.CompID, OrderInfoModel.DisID, obj.GoodsinfoID); html += "<tr trindex=\"" + index + "\" trindex2=\"" + index + "\" id=\"" + obj.ID + "\" tip=\"" + obj.GoodsinfoID + "\"><td class=\"t8\"><div class=\"addg\"><a href=\"javascript:;\" class=\"minus2\"></a><a href=\"javascript:;\" class=\"add2\"></a></div></td><td><div class=\"sPic\"><a class=\"opt-i2\"></a><span><a href=\"javascript:;\"><img src=\"" + Common.GetPicURL(pic, "resize200") + "\" width=\"60\" height=\"60\"></a></span><a href=\"javascript:;\" class=\"code\">商品编码:" + obj.GoodsCode + str7 + "</a><a href=\"javascript:;\" class=\"name\">" + GetGoodsName(obj.GoodsName, obj.GoodsInfos, "1") + "<i>" + GetGoodsName(obj.GoodsName, obj.GoodsInfos, "2") + "</i></a></div></td><td><div class=\"tc\">" + obj.Unit + "</div></td><td><input type=\"text\" tip2=\"" + index + "\" class=\"boxs divprice" + index + "\" value=\"" + decimal.Parse(string.Format("{0:N2}", newprice)).ToString("0.00") + "\" maxlength=\"9\" ><input type=\"hidden\" class=\"hidPrice\" value=\"" + decimal.Parse(string.Format("{0:N2}", newprice2)).ToString("0.00") + "\" /></td><td style=\"" + str6 + "\"><div class=\"tc\"><input type=\"hidden\" id=\"hidInventory_" + index + "\" value=\"" + decimal.Parse(string.Format("{0:N2}", kc)).ToString(Digits) + "\" />" + decimal.Parse(string.Format("{0:N2}", kc)).ToString(Digits) + "</div></td><td><div class=\"sl divnum\" tip=\"" + obj.GoodsinfoID + "\" tip2=\"" + index + "\"><a href=\"javascript:void(0);\" class=\"minus\">-</a><input type=\"text\" class=\"box txtGoodsNum txtGoodsNum" + index + "\" onfocus=\"InputFocus(this)\" onkeyup='KeyInt2(this)' maxlength=\"9\" value=\"" + num + "\"><a href=\"javascript:void(0);\" class=\"add\">+</a></div></td><td><div class=\"tc lblTotal_" + index + "\">¥" + str8 + "</div></td><td><div class=\"tc alink\"><a href=\"javascript:;\" class=\"aremark" + index + "\">" + (obj.Remark == "" ? "添加" : "编辑") + "</a>" + strremark + "</div></td></tr>"; index++; } this.lblTotalAmount.InnerText = decimal.Parse(string.Format("{0:N2}", OrderInfoModel.TotalAmount)).ToString("0.00"); //商品总额 string str2 = string.Empty; //开票信息 List <Hi.Model.DIS_OrderExt> l = new Hi.BLL.DIS_OrderExt().GetList("", "orderID=" + KeyID, ""); if (l.Count > 0) { foreach (Hi.Model.DIS_OrderExt item in l) { this.hrOrderInv.Value = item.DisAccID; //开票Id this.hidLookUp.Value = item.Rise; //发票抬头 this.hidBank.Value = item.OBank; //开会银行 this.hidContext.Value = item.Content; //发票内容 this.hidAccount.Value = item.OAccount; //开户帐号 this.hidRegNo.Value = item.TRNumber; //纳税人登记号 if (item.IsOBill == 0) { str2 = "不开票"; this.hidVal.Value = "0"; } else if (item.IsOBill == 1 && item.OAccount == "" && item.TRNumber == "" && item.OBank == "") { str2 = "发票抬头:" + item.Rise + ",发票内容:" + item.Content; this.hidVal.Value = "1"; } else { str2 = "发票抬头:" + item.Rise + ",发票内容:" + item.Content + ",开户银行:" + item.OBank + ",开户账户:" + item.OAccount + ",纳税人登记号:" + item.TRNumber; this.hidVal.Value = "2"; } this.lblCux.InnerText = decimal.Parse(string.Format("{0:N2}", item.ProAmount.ToString())).ToString("0.00");//订单促销 } } if (Convert.ToDecimal(str8) < 0) { str8 = "0.00"; } if (Request["type"] + "" != "2" || Fanli == 1) { this.lblFanl.InnerText = decimal.Parse(string.Format("{0:N2}", OrderInfoModel.bateAmount.ToString())).ToString("0.00");//返利金额 } ClientScript.RegisterStartupScript(this.GetType(), "adder", "<script>$(function(){$(\".site .site-if\").text(\"" + str + "\");$(\".invoice .in-if\").text(\"" + str2 + "\");$(\".attach .list\").html(\"" + str3.Replace("\"", "'") + "\");$(\".edit-ok .txt\").html(\"" + str4.Replace("\"", "'") + "\"); $(\".tabLine table tbody\").html(\"" + html.Replace("\"", "'") + "\"); $(\"#lblYFPrice\").text(\"" + decimal.Parse(string.Format("{0:N2}", (Request["type"] + "" == "2" && Fanli == 0 ? OrderInfoModel.AuditAmount + OrderInfoModel.bateAmount : OrderInfoModel.AuditAmount))).ToString("0.00") + "\"); $(\".jxs-box .opt-i\").hide();})</script>"); } } }