protected void Page_Load(object sender, EventArgs e) { if (Session["ShoppingList"] == null) { Response.Write("<script>alert('資料有誤');location.href='index.aspx';</script>"); Response.End(); } else { ship_free = classlib.Get_ship_free(); DeliveryPrice = classlib.Get_DeliveryPrice(); List <ShoppingList> Shoppinglist = new List <ShoppingList>(); Shoppinglist = Session["ShoppingList"] as List <ShoppingList>; RepeaterList.DataSource = Shoppinglist; RepeaterList.DataBind(); foreach (ShoppingList idx in Shoppinglist) { //if (idx.p_id == "30" || idx.p_id == "31" || idx.p_id == "30" || idx.p_id == "33" || idx.p_id == "34" || idx.p_id == "35") //{ // free_gift = "<div class=\"box-row\"><div class=\"boxrow-img\"><img src = \"upload/44-1.jpg\" width=\"90\" height =\"60\"></div><div class=\"boxrow-name\">【贈品】21oz美國霜降嫩肩牛排</div>"; // free_gift += "<div class=\"boxrow-unit\">$0</div><div class=\"boxrow-input\"> 1 </div> <div class=\"boxrow-subtotal\">$ 0 </div></div>"; //} amount += (idx.price * idx.num); } if (amount >= ship_free) { DeliveryPrice = 0; } totalprice = amount + DeliveryPrice; } }
private void QueryStuControl_SelectClassName(string className) { ////dlDataStuInfo.DataSource = null; RepeaterList.DataSource = new StudentServer().GetStudentByClassName(className); RepeaterList.DataBind(); ViewState["ClassName"] = className; //throw new NotImplementedException(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["ShoppingList"] == null || Session["orderData"] == null) { Response.Write("<script>alert('資料有誤');location.href='index.aspx';</script>"); Response.End(); } else { amount = 0; ship_free = classlib.Get_ship_free(); DeliveryPrice = classlib.Get_DeliveryPrice(); List <ShoppingList> Shoppinglist = new List <ShoppingList>(); Shoppinglist = Session["ShoppingList"] as List <ShoppingList>; RepeaterList.DataSource = Shoppinglist; RepeaterList.DataBind(); //foreach (ShoppingList idx in Shoppinglist) //{ // if (idx.p_id == "30" || idx.p_id == "31" || idx.p_id == "30" || idx.p_id == "33" || idx.p_id == "34" || idx.p_id == "35") // { // free_gift = "<div class=\"box-row\"><div class=\"boxrow-img\"><img src = \"upload/44-1.jpg\" width=\"90\" height =\"60\"></div><div class=\"boxrow-name\">【贈品】21oz美國霜降嫩肩牛排</div>"; // free_gift += "<div class=\"boxrow-unit\">$0</div><div class=\"boxrow-input\"> 1 </div> <div class=\"boxrow-subtotal\">$ 0 </div></div>"; // } //} foreach (ShoppingList idx in Shoppinglist) { amount += (idx.price * idx.num); } discountTxt = classlib.Get_coupon_price("", Session["discount_no"].ToString(), amount.ToString()); if (discountTxt == "-1" || discountTxt == "-2" || discountTxt == "") { discountTxt = ""; } else { discountprice = int.Parse(discountTxt); } if (amount >= ship_free) { DeliveryPrice = 0; } totalprice = amount + DeliveryPrice - discountprice; List <orderData> orderData = new List <orderData>(); orderData = Session["orderData"] as List <orderData>; foreach (orderData idx in orderData) { receivetime = idx.receiveTime; paymode = idx.paymode; username = idx.ordname; phone = idx.ordphone; gender = idx.ordgender; invoice = idx.invoice; contents = idx.contents; shipname = idx.shipname; shipphone = idx.shipphone; shipgender = idx.shipgender; shipaddress = idx.shipzip + classlib.Get_countyName(idx.shipcountyid) + classlib.Get_cityName(idx.shipcityid) + idx.shipaddress; string id = idx.shipcityid; if (id.IndexOf("-") != -1) { id = id.Substring(0, id.IndexOf("-")); } invoice = idx.invoice; email = idx.ordemail; password = idx.password; address = idx.ordzip + classlib.Get_countyName(idx.ordcountyid) + classlib.Get_cityName(idx.ordcityid) + idx.ordaddress; companyno = idx.companyno; title = idx.title; birthday = idx.birthday; } paymode = Session["paymode"].ToString(); if (paymode == "1") { paymode = "線上刷卡"; } if (paymode == "2") { paymode = "轉帳匯款"; } if (paymode == "3") { paymode = "貨到付款"; } if (receivetime == "1") { receivetime = "不指定時間 "; } if (receivetime == "2") { receivetime = "13:00前 "; } if (receivetime == "3") { receivetime = "14:00-18:00 "; } if (receivetime == "4") { receivetime = "17:00-20:00 "; } if (invoice == "2") { invoice = "二聯式發票"; } if (invoice == "3") { invoice = "三聯式發票"; } } }