private void CreateGuiGe(int proID) { GoodsSpecify.DelByProID(proID); if (base.Request.Form.AllKeys.Contains("gg_name") && base.Request.Form.AllKeys.Contains("gg_hh") && base.Request.Form.AllKeys.Contains("gg_xsj") && base.Request.Form.AllKeys.Contains("gg_memberprice") && base.Request.Form.AllKeys.Contains("gg_kc") && base.Request.Form.AllKeys.Contains("gg_alarmnum")) { string[] array = base.Request.Form["gg_name"].Split(new char[] { ',' }); string[] array2 = base.Request.Form["gg_hh"].Split(new char[] { ',' }); string[] array3 = base.Request.Form["gg_xsj"].Split(new char[] { ',' }); string[] array4 = base.Request.Form["gg_memberprice"].Split(new char[] { ',' }); string[] array5 = base.Request.Form["gg_kc"].Split(new char[] { ',' }); string[] array6 = base.Request.Form["gg_alarmnum"].Split(new char[] { ',' }); if (array2.Length > 0) { for (int i = 0; i < array2.Length; i++) { string text = string.Empty; for (int j = 0; j < this.goodsClass.GeiGeSets.Count; j++) { text = text + array[i * this.goodsClass.GeiGeSets.Count + j] + ","; } GoodsSpecify.Add(new GoodsSpecifyInfo { Specification = text.TrimEnd(new char[] { ',' }), ProID = proID, ProductSN = array2[i], PreviewImg = string.Empty, SellPrice = WebUtils.GetDecimal(array3[i]), Stock = WebUtils.GetInt(array5[i]), MemberPriceSet = array4[i].Replace("逗号", ","), PromotePrice = 0.0m, AlarmNum = WebUtils.GetInt(array6[i]), Sort = 99, Lang = base.cultureLang, AutoTimeStamp = System.DateTime.Now }); } } } }
private void InitGuiGe(GoodsClassInfo goodsClass, ProductInfo pro) { if (goodsClass.AutoID == pro.ClassID) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); System.Collections.Generic.IList <GoodsSpecifyInfo> list = GoodsSpecify.GetList(1000, " ProID=" + pro.AutoID, "AutoID asc"); foreach (GoodsSpecifyInfo current in list) { stringBuilder.Append("<tr>"); int num = 0; string[] array = current.Specification.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { string text = array[i]; stringBuilder.Append(string.Concat(new string[] { "<td class='ggname' style='background:#ffa;position:relative;' onclick=\\\"createMenu(this,'", goodsClass.GeiGeSets[num].GuiGeValue, "')\\\"><span>", text, "</span><input type='hidden' name='gg_name' value='", text, "' /></td>" })); num++; } string gUID = StringUtils.GetGUID(); stringBuilder.Append(string.Concat(new object[] { "<td><input type='text' value='", current.ProductSN, "' name='gg_hh' class='input-txt' style='width:120px;' /></td><td><input type='text' value='", current.SellPrice.ToString("f2"), "' name='gg_xsj' class='input-txt' style='width:60px;' /><input type='hidden' name='gg_memberprice' id='", gUID, "'/> <a href='javascript:;' onclick=\\\"$.dialog.open('MemberPrice.aspx?Module=", base.CurrentModuleCode, "&type=guige&opid=", current.AutoID, "&price=", current.SellPrice.ToString("f2"), "&retid=", gUID, "&action=Modify',{title:'Chỉnh sửa giá thành viên',width:580,height:430},false);\\\" >giá thành viên</a></td><td><input type='text' value='", current.Stock, "' name='gg_kc' class='input-txt' style='width:60px;' /></td><td><input type='text' value='", current.AlarmNum, "' name='gg_alarmnum' class='input-txt' style='width:60px;' /></td><td><a href='javascript:;' onclick='$(this).parent().parent().remove();'>Remove</a></td>" })); stringBuilder.Append("</tr>"); } this.JsonForGuiGeInitValue = stringBuilder.ToString().Trim(); } }
protected void Page_Load(object sender, System.EventArgs e) { this.strType = WebUtils.GetQueryString("type"); this.proInit = Product.GetDataById(base.OpID); this.guige = GoodsSpecify.GetDataById(base.OpID); this.decBasePrice = WebUtils.GetQueryDecimal("price"); if (!base.IsPostBack) { this.BindData(); } }
private void GetGoodsAttr() { GoodsSpecifyInfo goodsSpecifyInfo = GoodsSpecify.Get(WebUtils.GetQueryInt("proid"), WebUtils.GetQueryString("attrpath")); if (goodsSpecifyInfo != null) { base.Response.Write(JsonUtils.ObjectToJson <GoodsSpecifyInfo>(goodsSpecifyInfo)); } else { base.Response.Write("{\"ret\":\"fail\",\"status\":0,\"msg\":\"Chúng tôi không tìm thấy bất kỳ dữ liệu\"}"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; if (base.IsPost) { this.Action = WebUtils.GetFormString("action").ToLower(); OrdersInfo dataById = Orders.GetDataById(WebUtils.GetFormInt("oid")); if (!string.IsNullOrEmpty(this.Action) && dataById != null) { string action = this.Action; if (action != null) { if (!(action == "sign")) { if (!(action == "cancel")) { if (action == "delete") { if (dataById != null && dataById.OrderStatus >= 99) { Orders.Delete(dataById.AutoID); OrderItem.DeleteItemByOrderID(dataById.AutoID); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } } else if (dataById != null && dataById.OrderStatus <= 1) { System.Collections.Generic.IList <OrderItemInfo> listByOID = OrderItem.GetListByOID(dataById.AutoID); if (listByOID.Count > 0) { foreach (OrderItemInfo current in listByOID) { Orders.ReBackStock(Product.GetDataById(current.ProID), GoodsSpecify.Get(current.ProID, current.GuiGePath), current.Quantity); } } OrderAction.AddLog(dataById, base.UserName, "会员[" + base.UserName + "]取消了订单"); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } else if (dataById != null && dataById.OrderStatus == 11) { dataById.GoodsServedTime = System.DateTime.Now; dataById.OrderFinishTime = System.DateTime.Now; dataById.OrderStatus = 99; if (Orders.Update(dataById)) { OrderAction.AddLog(dataById, base.UserName, "会员[" + base.UserName + "]签收了订单"); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } } } else { Orders.CancelExpireOrder(base.UserID); Orders.AutoSignOrder(base.UserID); this.Condition = this.Condition + " 1=1 AND UserID=" + base.UserID.ToString(); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); System.DateTime dateTime = WebUtils.GetQueryDatetime("filter_dtstart"); System.DateTime dateTime2 = WebUtils.GetQueryDatetime("filter_dtend"); if (dateTime == new System.DateTime(1900, 1, 1)) { dateTime = System.DateTime.Now.AddYears(-1); } if (dateTime2 == new System.DateTime(1900, 1, 1)) { dateTime2 = System.DateTime.Now; } if (dateTime2 < dateTime) { dateTime2 = dateTime.AddMonths(1); } if (dateTime2 > dateTime.AddYears(5)) { dateTime2 = dateTime.AddYears(5); this.Alert("仅允许查询5年之内的数据"); } int queryInt = WebUtils.GetQueryInt("filter_status", -1); int queryInt2 = WebUtils.GetQueryInt("filter_ordertype", -1); string queryString = WebUtils.GetQueryString("filter_searchkey"); base.Put("filter_dtstart", dateTime.ToString("yyyy-MM-dd")); base.Put("filter_dtend", dateTime2.ToString("yyyy-MM-dd")); base.Put("filter_status", queryInt); base.Put("filter_ordertype", queryInt2); base.Put("filter_searchkey", queryString); stringBuilder.Append(string.Concat(new string[] { " AND OrderAddTime between CONVERT(datetime,'", dateTime.ToString("yyyy-MM-dd"), " 00:00:00') and CONVERT(datetime,'", dateTime2.ToString("yyyy-MM-dd"), " 23:59:59') " })); if (queryInt != -1) { if (queryInt == 12) { stringBuilder.Append(" AND OrderStatus>11 and OrderStatus<=99 and exists(select 1 from shop_OrderItem where OrderID=shop_Orders.AutoID and IsEva=0) "); } else { stringBuilder.Append(" AND OrderStatus= " + queryInt); } } if (queryInt2 != -1) { stringBuilder.Append(" AND OrderType= " + queryInt2); } if (!string.IsNullOrEmpty(queryString)) { stringBuilder.Append(" AND OrderNo like '%" + queryString + "%' "); } this.Condition += stringBuilder.ToString(); this.UrlPattern = string.Concat(new object[] { UrlRewrite.Get("myorders_url"), "?filter_dtstart=", dateTime.ToString("yyyy-MM-dd"), "&filter_dtend=", dateTime2.ToString("yyyy-MM-dd"), "&filter_status=", queryInt, "&filter_ordertype=", queryInt2, "&filter_searchkey=", queryString, "&page=$page" }); OrderStatusSTAT orderStatusSTAT = new OrderStatusSTAT(base.UserID); base.Put("AllCount", orderStatusSTAT.AllCount); base.Put("DaiFKCount", orderStatusSTAT.WaitPayCount); base.Put("DaiFHCount", orderStatusSTAT.WaitSendGoodsCount); base.Put("DaiSHCount", orderStatusSTAT.WaitSignGoodsCount); base.Put("DaiPJCount", orderStatusSTAT.WaitEvaCount); base.Put("SuccessCount", orderStatusSTAT.SuccessCount); base.AutoPageing <OrdersInfo>(new OrdersInfo()); base.UsingClient("user/我的订单.html"); } }
private void UpdateOrder(eumOrderAction action) { OrdersInfo dataById = Orders.GetDataById(base.OpID); dataById.LastModifyTime = System.DateTime.Now; string strEventContent = string.Empty; string @string = WebUtils.GetString(this.txtRemark.Text); if (string.IsNullOrEmpty(@string)) { base.ShowMsg("请填写本次操作事由"); } else { switch (action) { case eumOrderAction.Audit: dataById.OrderStatus = 1; dataById.OrderAuditTime = System.DateTime.Now; break; case eumOrderAction.ChangeAmount: dataById.OrderTotalAmount = WebUtils.GetDecimal(this.newamount.Text); strEventContent = "管理员[" + base.AccountName + "]修改订单价格为:" + dataById.OrderTotalAmount.ToString("f2"); break; case eumOrderAction.Pay: { SinGooCMS.Payments.PaymentInfo byPayCode = Payment.GetByPayCode(this.paymenttype.SelectedValue); dataById.PayID = ((byPayCode == null) ? -1 : byPayCode.AutoID); dataById.PayName = ((byPayCode == null) ? "无" : byPayCode.PayName); dataById.OrderStatus = 10; dataById.OrderPayTime = System.DateTime.Now; strEventContent = "管理员[" + base.AccountName + "]已收款,收款方式为:" + dataById.PayName; break; } case eumOrderAction.SendGoods: { SinGooCMS.Plugin.KuaidiComInfo kuaidiComInfo = KuaidiCom.Get(this.kuaidicompany.SelectedValue); dataById.ShippingID = ((kuaidiComInfo == null) ? -1 : kuaidiComInfo.AutoID); dataById.ShippingName = ((kuaidiComInfo == null) ? "无" : kuaidiComInfo.CompanyName); dataById.ShippingNo = WebUtils.GetString(this.shippingno.Text); dataById.OrderStatus = 11; dataById.GoodsSendTime = System.DateTime.Now; strEventContent = string.Concat(new string[] { "管理员[", base.AccountName, "]已发货,发件方式为:", dataById.ShippingName, "(快递单号:", dataById.ShippingNo, ")" }); break; } case eumOrderAction.SignGoods: dataById.OrderStatus = 99; dataById.GoodsServedTime = System.DateTime.Now; strEventContent = "管理员[" + base.AccountName + "]代签收"; break; case eumOrderAction.Cancel: dataById.OrderStatus = 101; strEventContent = "管理员[" + base.AccountName + "]关闭了订单"; break; } if (Orders.Update(dataById)) { System.Collections.Generic.IList <OrderItemInfo> listByOID = OrderItem.GetListByOID(dataById.AutoID); if (eumOrderAction.Cancel == action) { if (listByOID.Count > 0) { foreach (OrderItemInfo current in listByOID) { Orders.ReBackStock(Product.GetDataById(current.ProID), GoodsSpecify.Get(current.ProID, current.GuiGePath), current.Quantity); } } } if (eumOrderAction.SendGoods == action) { UserInfo dataById2 = SinGooCMS.BLL.User.GetDataById(dataById.UserID); this.SendMsgOnFH(dataById, dataById2); this.SendEmailOnFH(dataById, dataById2); this.SendMobileOnFH(dataById, dataById2); new MsgService(SinGooCMS.BLL.User.GetDataById(dataById.UserID)).SendGoodsFH(dataById, dataById.ShippingName, dataById.ShippingNo); } if (eumOrderAction.SignGoods == action) { foreach (OrderItemInfo current in listByOID) { ProductInfo dataById3 = Product.GetDataById(current.ProID); if (dataById3 != null) { AccountDetail.AddIntegral(base.LoginUser, 1, (double)(dataById3.GiveIntegral * current.Quantity), string.Concat(new object[] { "成功购买商品[", current.ProName, "] x ", current.Quantity, ",获得赠送积分" })); } } } SinGooCMS.BLL.OrderAction.AddLog(dataById, base.AccountName, strEventContent, @string); base.ClientScript.RegisterClientScriptBlock(base.GetType(), "alertandredirect", "<script>$.dialog.open.origin.location.reload();</script>"); } else { base.ShowMsg("Thao tác thất bại"); } } }
protected void Page_Load(object sender, System.EventArgs e) { this.strCartID = this.shop.GetCartID(); this.strAction = WebUtils.GetQueryString("action").ToLower(); this.strIds = WebUtils.GetQueryString("ids"); if (!string.IsNullOrEmpty(this.strAction)) { string text = this.strAction; if (text != null) { if (!(text == "del")) { if (!(text == "clear")) { if (!(text == "plus")) { if (!(text == "minus")) { if (text == "quantity") { int queryInt = WebUtils.GetQueryInt("num", 1); CartInfo cart = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart != null) { GoodsSpecifyInfo dataById = GoodsSpecify.GetDataById(cart.GoodsAttr); int stock = cart.Product.Stock; if (dataById != null) { stock = dataById.Stock; } if (queryInt > stock) { cart.Quantity = stock; } else if (queryInt < 1) { cart.Quantity = 1; } else { cart.Quantity = queryInt; } cart.SubTotal = cart.Price * cart.Quantity; Cart.Update(cart); } } } else { CartInfo cart2 = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart2 != null) { if (cart2.Quantity > 1) { cart2.Quantity--; } cart2.SubTotal = cart2.Price * cart2.Quantity; Cart.Update(cart2); } } } else { CartInfo cart3 = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart3 != null) { GoodsSpecifyInfo dataById = GoodsSpecify.GetDataById(cart3.GoodsAttr); int stock = cart3.Product.Stock; if (dataById != null) { stock = dataById.Stock; } if (cart3.Quantity < stock) { cart3.Quantity++; } cart3.SubTotal = cart3.Price * cart3.Quantity; Cart.Update(cart3); } } } else { Cart.ClearByCartID(this.strCartID); } } else if (!string.IsNullOrEmpty(this.strIds)) { Cart.Delete(this.strIds); } } base.Response.Redirect(UrlRewrite.Get("cart_url")); } else { System.Collections.Generic.IList <CartInfo> listByCartNo = Cart.GetListByCartNo(this.strCartID); foreach (CartInfo current in listByCartNo) { this.decTotalMoney += current.Quantity * current.Price; } base.Put("totalamount", this.decTotalMoney); base.UsingClient("购物车.html"); } }