protected void Page_Load(object sender, EventArgs e) { UserInfo.GetUserInfo(out as_Cus_code, out as_Cus_Name); if (!string.IsNullOrEmpty(Request.QueryString["goocode"]))//是否修改购物车 { string aa = ""; aa = Request.QueryString["goocode"]; if (aa.IndexOf('|') > 0) { try { string[] k = aa.Split('|'); if (int.Parse(k[1]) < 1000) { Shoping.UpdateShopCar(k[0], k[1], "Change"); } } catch { } } } if (!IsPostBack) { if (!UserInfo.SureUserWinxin(Request.QueryString["userweixinid"])) { Response.Redirect("Error.aspx"); } Hashtable Hash = Shoping.GetHash(); if (Hash.Count == 0) { P_Err.Visible = true; P_Good.Visible = false; } CustomerModel Model = new CustomerModel(); CustomerDAL DAL = new CustomerDAL(); Model = DAL.GetModel(as_Cus_code); Txt_Phone.Text = Model.Phone; Txt_receiveaddr.Text = Model.Cus_Address; txt_trafficadd.Text = Model.Cus_TrafficeAddr; Of_bind_ShopCar(); } }
private void of_bindGetmain(string as_OrderNO, string type) { string StrSql = "SELECT getdetail.detaildiscountrate,getdetail.disbeforeprice,getdetail.num,goodsno.goo_code," + "getdetail.havepack,goodsno.goo_name,getdetail.sequence,getdetail.HaveSendNum," + "goodsno.goo_no,getdetail.detaildiscountrate,goodsno.content," + "goodsno.spec,getdetail.memo," + "getdetail.num-isnull(getdetail.havesendnum,0) as cp_notsendnum," + "getdetail.num/isnull(specnum,1) as orderPiece," + "getdetail.HaveSendNum/isnull(specnum,1) as HaveSendPiece," + "(getdetail.num-isnull(getdetail.havesendnum,0))/isnull(specnum,1) as NotSendPiece " + "FROM getdetail ,getmain,goodsno " + "WHERE ( getdetail.goo_code = goodsno.goo_code ) " + "and getdetail.orderno=getmain.orderno " + "and getdetail.Orderno=@Orderno " + "order by sequence"; GysoftParameter[] Pa = { new GysoftParameter("@Orderno", as_OrderNO) }; DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, StrSql, Pa); if (type == "show") { GV_Getdetail.DataSource = dt; GV_Getdetail.DataBind(); } if (type == "Replenishment") { for (int li_rows = 0; li_rows < dt.Rows.Count; li_rows++) { string ls_GooCode = dt.Rows[li_rows]["goo_code"].ToString(); Decimal lde_Num = 0; try { lde_Num = Convert.ToDecimal(dt.Rows[li_rows]["num"].ToString()); } catch { ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('数量有误!')", true); return; } Shoping.UpdateShopCar(ls_GooCode, lde_Num, "Change"); } } }
private void SaveMun() { for (int li_rows = 0; li_rows < Rep_GoodsNo.Items.Count; li_rows++) { TextBox lTxt_Num = Rep_GoodsNo.Items[li_rows].FindControl("txt_num") as TextBox; if (lTxt_Num.Text.Trim() == "") { continue; } string ls_GooCode = lTxt_Num.Attributes["GooCode"].ToString(); Decimal lde_Num = 0; try { lde_Num = Convert.ToDecimal(lTxt_Num.Text); } catch { ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('数量有误!')", true); return; } Shoping.UpdateShopCar(ls_GooCode, lde_Num, "Change"); } }
/// <summary> /// 保存到购物车 /// </summary> private void SaveMun(DataTable ad_tab) { for (int i = 0; i < ad_tab.Rows.Count; i++) { if (!string.IsNullOrEmpty(ad_tab.Rows[i][0].ToString()) && !string.IsNullOrEmpty(ad_tab.Rows[i][1].ToString())) { string ls_GooCode = Dyeing_GooCode(Request.QueryString["goodtype"], ad_tab.Rows[i][0].ToString()); Decimal lde_Num = 0; if (Request.Form[i] != "") { try { lde_Num = Convert.ToDecimal(ad_tab.Rows[i][1].ToString()); } catch { ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('数量有误!')", true); return; } Shoping.UpdateShopCar(ls_GooCode, lde_Num, "Change"); } } } Shoping.GetHash(); }