public ActionResult CompleteOrder() { var myCart = getMyShoppingCart(); User myUser = new UserBLL().getUserByEmail(User.Identity.Name); if(myUser == null) SetSessionMessage(View(), SESSIONMESSAGE.FAIL, "Something went wrong. Please try again"); var myOrder = new Order(); myOrder.User = myUser; myOrder.DateTime = DateTime.Now; myOrder.Items = new List<OrderLine>(); var itemTransaction = new ItemBLL(); foreach(var item in myCart.Items) { item.InStock--; itemTransaction.Update(item); var orderLine = new OrderLine() { Amount = 1, Discount = 0, Item = item }; myOrder.Items.Add(orderLine); } var updatedOrder = new OrderBLL().Insert(myOrder); if(updatedOrder == null) SetSessionMessage(View(), SESSIONMESSAGE.FAIL, "Something went wrong. The order is not registered"); myCart.EmptyCart(); return SetSessionMessage(RedirectToAction("ListAll", "DisplayItems", new { area = "Common" }), SESSIONMESSAGE.SUCCESS, "The order is registered"); }
public ActionResult DatHangThanhCong() { OrderBLL _getorder = new OrderBLL(); OrderCartSuccess mpdel = new OrderCartSuccess(); if (Request.Cookies["IdOrder"] != null) { var _IdOrder = JsonConvert.DeserializeObject <int>(Request.Cookies["IdOrder"].Value); mpdel = _getorder.SelectOrderById(_IdOrder); } return(View(mpdel)); }
protected override void PageLoad() { base.PageLoad(); this.user = UserBLL.ReadUserMore(base.UserID); this.userGradeName = UserGradeBLL.ReadUserGradeCache(base.GradeID).Name; this.dt = UserBLL.UserIndexStatistics(base.UserID); OrderSearchInfo order = new OrderSearchInfo(); order.UserID = base.UserID; int count = -2147483648; this.orderList = OrderBLL.SearchOrderList(1, 10, order, ref count); }
//private OrderGridCL ConvertOrderToGrid(OrderCL activeOrders) //{ // string addressType = ""; // int addressTypeId = addressBLL.getAddressById(activeOrders.addressId).addressTypeId; // if(addressTypeId==0) // { // addressType = "Shipping Address"; // } // if(addressTypeId==1) // { // addressType = "Billing Address"; // } // if(addressTypeId==2) // { // addressType = "Permanent Address"; // } // OrderGridCL activeOrderDetails = new OrderGridCL() // { // addressLine1 = addressBLL.getAddressById(activeOrders.addressId).addressLine1, // addressLine2 = addressBLL.getAddressById(activeOrders.addressId).addressLine2, // addressLine3 = addressBLL.getAddressById(activeOrders.addressId).addressLine3, // address = addressBLL.getAddressById(activeOrders.addressId).addressLine1 + "," + addressBLL.getAddressById(activeOrders.addressId).addressLine2 + "," + addressBLL.getAddressById(activeOrders.addressId).addressLine3 + "," + addressBLL.getCityById(addressBLL.getAddressById(activeOrders.addressId).cityId).cityName + "," + addressBLL.getCityById(addressBLL.getAddressById(activeOrders.addressId).cityId).stateName + "," + addressBLL.getCityById(addressBLL.getAddressById(activeOrders.addressId).cityId).countryName + ",", // addressType = addressType, // cityId = addressBLL.getAddressById(activeOrders.addressId).cityId, // country = addressBLL.getCityById(addressBLL.getAddressById(activeOrders.addressId).cityId).countryName, // dateCreated = activeOrders.dateCreated, // dateModified = activeOrders.dateModified, // id = activeOrders.id, // isDeleted = activeOrders.isDeleted, // memberName = cartBLL.getMemberbyCartId(activeOrders.cartId).name, // orderStatus = addressBLL.getStatusById(activeOrders.statusId).name, // productName = cartBLL.getProductbyCartId(activeOrders.cartId).name, // productQty = cartBLL.getCartProductByCartId(activeOrders.cartId).quantity.ToString(), // shippingCharge = activeOrders.shippingCharge, // shippingDescription = activeOrders.description, // stateId = addressBLL.getCityById(addressBLL.getAddressById(activeOrders.addressId).cityId).stateId, // taxAmt = activeOrders.taxAmount, // totalAmt = activeOrders.totalAmount, // }; // return activeOrderDetails; //} protected void btnUpdate_Click(object sender, EventArgs e) { OrderCL orderCL = new OrderCL(); orderCL.id = id; orderCL.description = txtShippingDescription.Text; orderCL.statusId = Convert.ToInt32(ddlShippingStatus.SelectedValue); OrderBLL orderBLL = new OrderBLL(); OrderCL newOrderCL = orderBLL.updateShippingDetails(orderCL); txtShippingDescription.Text = newOrderCL.description; ddlShippingStatus.SelectedValue = newOrderCL.statusId.ToString(); }
private void LoadData() { dt = new DataTable(); // get data for dt OrderBLL orderBLL = new OrderBLL(); dt = orderBLL.getOrders(id_Transaction); DataView view = dt.DefaultView; view.Sort = "ProductName DESC"; lblTotal.Text = "Total : " + dt.Compute("SUM(Total)", "") + "$"; dgvDetails.DataSource = view; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindData(); AddSubNav("订单管理-OrderManager.aspx"); var model = OrderBLL.GetOrderView(OrderNum); if (model != null) { ltMsg.Text = "当前处理的订单号:" + model.OrderNum + " 下单人:" + model.AddMemberRealName + " 参团人数:" + model.BuyNum; } } }
public void 代码生成器测试() { var bll = OrderBLL.GetInstance(); OrderDto dto = new OrderDto(); Guid guid = new Guid("A7A17660-6AB5-4BF3-A892-07E344A7C210"); var model = bll.SelectModel(guid); Debug.Print(bll.SelectModel(guid).OrderFrom); Debug.Print("返回:" + OrderBLL.GetInstance().Add(dto).ToString()); Debug.Print("返回:" + OrderBLL.GetInstance().Add(dto).ToString()); //Assert.AreEqual() }
private void SelectMenuItemControl_OnRemove(SelectMenuItemControl sender) { DialogResult dr = MessageBox.Show("Are you sure to delete food '" + sender.MenuItem.Name + "'?", "Confirm", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { // remove food OrderBLL orderBLL = new OrderBLL(); orderBLL.RemoveFood(this.order, sender.OrderDetail); this.flowLayoutPanelRight.Controls.Remove(sender); this.calculateFoodPrice(); } }
public static void Init() { string connectionString = ConfigurationManager.ConnectionStrings["LiteCommerce"].ConnectionString; //TODO : Khởi tạo các BLL Khi cần sử dụng CatalogBLL.Initialize(connectionString); EmployeeBLL.Initialize(connectionString); CountryBLL.Initialize(connectionString); AttributeBLL.Initialize(connectionString); ProductAttributeBLL.Initialize(connectionString); UserAccountBLL.Initialize(connectionString); OrderBLL.Initialize(connectionString); }
public MyResult GetList([FromQuery] OrderInfoParam param) { int total; List <OrderInfo> roleList = OrderBLL.GetOrderList(param, out total); var result = new { total, list = roleList }; return(MyResult.OK(result)); }
protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e) { string command = e.CommandName.ToString(); string orderNum = e.CommandArgument.ToString(); var model = OrderBLL.SelectOrder(orderNum); if (model == null) { BindData(); return; } if (command == "EditData") { Response.Redirect("OrderDetailEdit.aspx?OrderNum=" + orderNum); } else if (command == "SumitData") { model.OrderStatus = OrderStatus.Submited; OrderBLL.UpdateOrder(model); MessageBox.Show("提交成功!"); } else if (command == "CancelData") { model.OrderStatus = OrderStatus.Canceled; OrderBLL.UpdateOrder(model); MessageBox.Show("取消成功!"); } else if (command == "PayData") { //支付成功 //设置订单状态,已付款 //写入消费历史 //增加会员点数 string msg = ""; bool success = OrderBLL.PaySuccessHandler(orderNum, CurrentMember.UserName, model.TotalMoney, out msg); if (success) { MessageBox.Show("支付成功!"); } else { //MessageBox.Show("支付失败!"); Response.Write(msg); } } else if (command == "DetailData") { Response.Redirect("MyOrderDetail.aspx?OrderNum=" + orderNum); } BindData(); }
//public void Clear() //{ // OrderID = 0; // imgOrder.ImageUrl = "none"; // txtDate.Text = ""; // txtNote.Text = ""; // txtDept.Text = ""; // txtRoom.Text = ""; // txtBed.Text = ""; // txtDiagnosis.Text = ""; // txtPatientCode.Text = ""; // txtTransfusionNote.Text = ""; // People1.PeopleID = Guid.Empty; // GridViewPack.DataBind(); // CurrentDIN = ""; // imgCurrentDIN.ImageUrl = "none"; //} public void LoadOrder() { Order e = new Order(); if (OrderID == 0) { imgOrder.ImageUrl = "none"; People1.PeopleID = Guid.Empty; } else { e = OrderBLL.Get(OrderID); if (e.Type == Order.TypeX.ForOrg) { Response.Redirect(RedBloodSystem.Url4Order4Org + "key=" + e.ID.ToString()); } else if (e.Type == Order.TypeX.ForCR) { imgOrder.ImageUrl = BarcodeBLL.Url4Order(e.ID); People1.PeopleID = e.People != null?e.PeopleID.GetValueOrDefault() : Guid.Empty; } } txtNote.Text = e.Note; if (e.Date != null) { txtDate.Text = e.Date.ToStringVN_Hour(); } else { txtDate.Text = ""; } txtDept.Text = e.FullDepartment; txtRoom.Text = e.Room; txtBed.Text = e.Bed; txtDiagnosis.Text = e.Diagnosis; txtPatientCode.Text = e.PatientCode; txtTransfusionNote.Text = e.TransfusionNote; GridViewPack.DataBind(); btnUpdate.Enabled = e.Status == Order.StatusX.Init; CurrentDIN = ""; imgCurrentDIN.ImageUrl = "none"; GridViewSum.DataBind(); }
/// <summary> /// 隐藏订单 /// </summary> private void DeleteOrder() { string result = "ok"; int orderID = RequestHelper.GetQueryString <int>("OrderID"); int userID = RequestHelper.GetQueryString <int>("UserID"); OrderInfo order = OrderBLL.Read(orderID); order.IsDelete = 1;//隐藏订单 OrderBLL.Update(order); ResponseHelper.Write(result); ResponseHelper.End(); }
protected override void PageLoad() { base.PageLoad(); if ((ShopConfig.ReadConfigInfo().AllowAnonymousAddCart == 1) && (base.UserID == 0)) { ResponseHelper.Redirect("/User/Login.aspx"); ResponseHelper.End(); } int queryString = RequestHelper.GetQueryString <int>("ID"); this.order = OrderBLL.ReadOrder(queryString, base.UserID); this.payPlugins = PayPlugins.ReadPayPlugins(this.order.PayKey); base.Title = "¶©µ¥Íê³É"; }
protected bool isPL = true; //是否已评论 /// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); user = UserBLL.ReadUserMore(base.UserId); userGradeName = UserGradeBLL.Read(base.GradeID).Name; int orderID = RequestHelper.GetQueryString <int>("ID"); order = OrderBLL.Read(orderID, base.UserId); orderDetailList = OrderDetailBLL.ReadList(orderID); #region 加载订单下产品 string strProductID = string.Empty; foreach (OrderDetailInfo orderDetail in orderDetailList) { if (strProductID == string.Empty) { strProductID = orderDetail.ProductId.ToString(); } else { strProductID += "," + orderDetail.ProductId.ToString(); } } if (strProductID != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductId = strProductID; productList = ProductBLL.SearchList(productSearch); } #endregion #region 判断是否已评论 List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count]; int pi = 0; foreach (ProductInfo item in productList) { ProductCommentSearchInfo psi = new ProductCommentSearchInfo(); psi.ProductId = item.Id; psi.UserId = base.UserId; psi.OrderID = orderID; listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi); if (listPinfoArr[pi].Count <= 0) { isPL = false; } } #endregion if (isPL) { Response.Redirect("/User/OrderDetail.html?ID=" + orderID); } }
protected bool isPL = true;//是否已评论 protected override void PageLoad() { base.PageLoad(); //检查用户的待付款订单是否超时失效,超时则更新为失效状态 OrderBLL.CheckOrderPayTime(base.UserId); int orderId = RequestHelper.GetQueryString <int>("id"); userGradeName = UserGradeBLL.Read(base.GradeID).Name; order = OrderBLL.Read(orderId, base.UserId); if (order.Id <= 0) { ScriptHelper.AlertFront("订单不存在", "/user/index.html"); } //礼品 if (order.GiftId > 0) { gift = FavorableActivityGiftBLL.Read(order.GiftId); } orderDetailList = OrderDetailBLL.ReadList(orderId); int[] productIds = orderDetailList.Select(k => k.ProductId).ToArray(); if (productIds.Length > 0) { int count = 0; productList = ProductBLL.SearchList(1, productIds.Length, new ProductSearchInfo { InProductId = string.Join(",", productIds) }, ref count); } #region 判断是否已评论 List <ProductCommentInfo>[] listPinfoArr = new List <ProductCommentInfo> [productList.Count]; int pi = 0; foreach (ProductInfo item in productList) { ProductCommentSearchInfo psi = new ProductCommentSearchInfo(); psi.ProductId = item.Id; psi.UserId = base.UserId; psi.OrderID = orderId; listPinfoArr[pi] = ProductCommentBLL.SearchProductCommentList(psi); if (listPinfoArr[pi].Count <= 0) { isPL = false; } } #endregion Title = "我的订单"; }
protected void btn_Submit_Click(object sender, EventArgs e) { string Oid = "DD" + DateTime.Now.ToString("yyyyMMddMMss"); Orders order = new Orders() { OID = Oid, MID = Convert.ToInt32(Session["Mid"]), ODate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")), OConsignee = this.consignee_0.Value, OAddress = this.oaddress.Value, OTelephone = this.tel_0.Value, OSumPrice = Convert.ToInt32(this.txtSumPrice.Value), OState = 1, }; bool ck = OrderBLL.AddOrder(order) > 0? true :false; if (ck) { RepeaterItemCollection items = repgoods.Items; foreach (RepeaterItem item in items) { Label bid = (Label)item.FindControl("bBID"); Label tid = (Label)item.FindControl("bTID"); Label price = (Label)item.FindControl("price"); TextBox lbcount = (TextBox)item.FindControl("lbcount"); OrderDetails o = new OrderDetails() { OID = Oid, BID = Convert.ToInt32(bid.Text), BPrice = Convert.ToDouble(price.Text), BCount = Convert.ToInt32(lbcount.Text) }; bool cko = OrderBLL.AddOrderDetails(o) > 0 ? true : false; if (cko) { bool ckd = OrderBLL.DeleteTrade(Convert.ToInt32(tid.Text)) > 0 ? true : false; if (ckd) { OrderBLL.UpdateBcount(Convert.ToInt32(lbcount.Text), Convert.ToInt32(bid.Text)); } } } Response.Redirect("done.aspx?oid=" + Oid); } }
public static void Init() { // lay chuoi ket noi webconfig string connectionString = ConfigurationManager.ConnectionStrings["LiteCommerce"].ConnectionString; // Khoi tao cac DLL khi can su dung den CatalogBLL.Initialize(connectionString); // them khoi tao UserAccountBLL.Initialize(connectionString); //OrderBLL OrderBLL.Initialize(connectionString); }
private void LoadData() { dt = new DataTable(); // get data for dt OrderBLL orderBLL = new OrderBLL(); dt = orderBLL.getOrders(IDTrans); DataView view = dt.DefaultView; view.Sort = "Quantity DESC"; dgvDetails.DataSource = dt; }
/// <summary> /// 发货 /// </summary> protected void Ship() { bool flag = true; string msg = string.Empty; try { int orderId = RequestHelper.GetForm <int>("orderid"); DateTime date = RequestHelper.GetForm <DateTime>("date"); string shippingnumber = RequestHelper.GetForm <string>("shippingnumber"); if (orderId <= 0) { flag = false; msg = "请求参数错误"; } if ((date - DateTime.Now).Days < 0) { flag = false; msg = "配送日期不规范"; } if (string.IsNullOrEmpty(shippingnumber)) { flag = false; msg = "配送单号不能为空"; } OrderInfo order = OrderBLL.Read(orderId); if (order.OrderStatus == (int)OrderStatus.Shipping) { int startOrderStatus = order.OrderStatus; order.OrderStatus = (int)OrderStatus.HasShipping; order.ShippingNumber = shippingnumber; order.ShippingDate = date; //更新商品库存数量 ProductBLL.ChangeSendCountByOrder(order.Id, ChangeAction.Plus); OrderBLL.AdminUpdateOrderAddAction(order, "", (int)OrderOperate.Send, startOrderStatus); flag = true; } } catch (Exception ex) { flag = false; msg = ex.Message; } finally { Response.Clear(); Response.Write(JsonConvert.SerializeObject(new { ok = flag, msg = msg })); Response.End(); } }
protected void SubmitButton_Click(object sender, EventArgs e) { int orderId = RequestHelper.GetQueryString <int>("Id"); OrderInfo order = OrderBLL.Read(orderId); string action = RequestHelper.GetQueryString <string>("Action"); switch (action) { case "Shipping": string regionID = RegionID.ClassID; int shippingID = RequestHelper.GetForm <int>("ShippingID"); if (regionID == string.Empty || shippingID <= 0) { ScriptHelper.Alert("收货地区和配送方式不能为空"); } if (order.RegionId != regionID || order.ShippingId != shippingID) { order.ShippingId = shippingID; order.RegionId = regionID; order.ShippingMoney = OrderBLL.ReadOrderShippingMoney(order); } order.OrderNote = OrderNote.Text; order.Consignee = Consignee.Text; order.Address = Address.Text; order.ZipCode = ZipCode.Text; order.Tel = Tel.Text; order.Email = Email.Text; order.Mobile = Mobile.Text; order.ShippingDate = Convert.ToDateTime(ShippingDate.Text); order.ShippingNumber = ShippingNumber.Text; break; case "Other": order.OrderNote = OrderNote.Text; break; case "Money": order.OtherMoney = Convert.ToDecimal(OtherMoney.Text); break; default: break; } CheckAdminPower("UpdateOrder", PowerCheckType.Single); OrderBLL.Update(order); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Order"), order.Id); string alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl); }
protected override void PageLoad() { base.PageLoad(); int id = RequestHelper.GetQueryString <int>("id"); order = OrderBLL.Read(id); topNav = 0; if (RequestHelper.GetForm <string>("action").ToLower() == "shipping") { Ship(); } }
private void TxtNum_TextChanged(object sender, EventArgs e) { string a = ((TextBox)sender).Text; OrderPrice = OrderOnThisPage.CalculateTotalPrice(); OrderBLL.SetOrderTotalPrice(OrderOnThisPage); txtOrderPrice.Text = OrderPrice.ToString("F2"); ExtraPrice = 0; txtExtraPrice.Text = ExtraPrice.ToString("F2"); OffPrice = 0; txtOffPrice.Text = OffPrice.ToString("F2"); TotalPrice = OrderPrice + ExtraPrice - OffPrice; txtTotalPrice.Text = TotalPrice.ToString("F2"); }
private void FrmAdmin_Load(object sender, EventArgs e) { SayWelcome(um); tmrSaat.Enabled = true; ListUsers(UserBLL.GetUsers()); ListEmployees(EmployeeBLL.GetEmployees()); AddEmployeesToUser(EmployeeBLL.GetEmployees()); AddCategoriesToFood(); ListFoods(FoodBLL.GetFoods()); PaintTables(TableBLL.GetTables()); MasalariDoldur(TableBLL.GetTables()); PozisyonlarıDoldur(); SiparisListele(OrderBLL.GetOrders()); }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] == null || Request["orderid"] == null) { Response.Redirect("/login.aspx"); } int OrderID = int.Parse(Request["orderid"]); OrderOnThisPage = OrderBLL.GetOrderByID(OrderID); if (OrderOnThisPage.status == OrderStatus.UnPaid) { Response.Redirect("/login.aspx"); } if ((int)Session["uid"] != OrderOnThisPage.user.id) { Response.Redirect("/login.aspx"); } AddressRowManage.SetAddress(OrderOnThisPage.address); txtComment.Text = OrderOnThisPage.comment; txtStatus.Text = OrderOnThisPage.GetStatusString(); // 基本信息 txtDateTime.Text = OrderOnThisPage.dateTime.ToString(); txtOrderID.Text = OrderOnThisPage.id.ToString(); txtUserID.Text = OrderOnThisPage.user.id.ToString(); // 价格信息 OrderPrice = OrderOnThisPage.CalculateTotalPrice(); OrderBLL.SetOrderTotalPrice(OrderOnThisPage); txtOrderPrice.Text = OrderPrice.ToString("F2"); ExtraPrice = 0; txtExtraPrice.Text = ExtraPrice.ToString("F2"); OffPrice = 0; txtOffPrice.Text = OffPrice.ToString("F2"); TotalPrice = OrderPrice + ExtraPrice - OffPrice; txtTotalPrice.Text = TotalPrice.ToString("F2"); AddressRowManage.Click += AddressRowManage_Click; // 创建控件 orderBookContent.Controls.Clear(); foreach (BookOrderModel bookOrder in OrderOnThisPage.books) { OrderBookRow bookRow = (OrderBookRow)LoadControl("~/Controls/OrderBookRow.ascx"); bookRow.SetBook(bookOrder, OrderOnThisPage); bookRow.SetReadOnly(); orderBookContent.Controls.Add(bookRow); bookRow.txtNum.TextChanged += TxtNum_TextChanged;; } }
private void OrderOperate() { string content = string.Empty; int queryString = RequestHelper.GetQueryString <int>("OrderID"); int num2 = RequestHelper.GetQueryString <int>("OrderStatus"); switch (num2) { case 1: case 2: case 5: { OrderInfo order = OrderBLL.ReadOrder(queryString, base.UserID); if (order.ID == 0) { content = "不是属于当前用户的订单"; } else { int orderStatus; if ((num2 == 2) || (num2 == 1)) { orderStatus = order.OrderStatus; order.OrderStatus = 3; ProductBLL.ChangeProductOrderCountByOrder(queryString, ChangeAction.Minus); OrderBLL.UserUpdateOrderAddAction(order, "用户取消订单", 3, orderStatus); } else { int point = OrderBLL.ReadOrderSendPoint(order.ID); if (point > 0) { UserAccountRecordBLL.AddUserAccountRecord(0M, point, ShopLanguage.ReadLanguage("OrderReceived").Replace("$OrderNumber", order.OrderNumber), order.UserID, order.UserName); } orderStatus = order.OrderStatus; order.OrderStatus = 6; OrderBLL.UserUpdateOrderAddAction(order, "用户确认收货", 5, orderStatus); } } break; } default: content = "订单状态错误"; break; } ResponseHelper.Write(content); ResponseHelper.End(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; if (context.Session["id"] != null) { string temp = File.ReadAllText(context.Server.MapPath("drugstore_admin_order.html")); if (context.Request.Form["goods_number"] != null) { int i = OrderBLL.SendOrder(context.Request.Form["goods_number"].ToString()); } List <OrdersModel> orderList = new List <OrdersModel>(); if (context.Request.Form["name"] == null) { orderList = OrderBLL.GetOrderByIsend(); } else { orderList = OrderBLL.GetOrderByName(context.Request.Form["name"].ToString()); } StringBuilder sb = new StringBuilder(); if (orderList != null) { foreach (OrdersModel item in orderList) { sb.AppendFormat("<div class='panel panel-default'><div class='panel-heading'><b>{0}</b>订单号: <span>{1}</span> <span class='pull-right'>是否发货:{5}</span><span class='pull-right'>买家ID:{2}</span><span class='pull-right'> </span><span class='pull-right'>手机:{3}</span><span class='pull-right'> </span><span class='pull-right'>{4}</span> </div><table class='table table-bordered'><thead><tr><td>#</td><td>药品名</td><td>治疗症状</td><td>数量</td></tr></thead><tbody>", item.Ordertime, item.Ordernumber, item.Orderusersid.ToString(), item.Orderphone, item.Orderadress, item.OrderIssend); List <GoodsorderModel> dt1 = GoodsOrderBLL.GetGoodsOrderListById(item.Orderid); foreach (GoodsorderModel item1 in dt1) { GoodModel goods = GoodsBLL.GetAGoodDetail(item1.Gdod_goods_id); //dt2.Rows[0].item[""] sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td></tr>", goods.GoodsId, goods.GoodsName, goods.GoodsEffect, item1.Gdod_order_count); } sb.AppendFormat("</tbody></table></div> "); } } temp = temp.Replace("@admin", context.Session["admin_name"].ToString()); temp = temp.Replace("@content", sb.ToString()); context.Response.Write(temp); } else { context.Response.Redirect("~/admin_login.html"); } }
/// <summary> /// 审核按钮点击方法 /// </summary> protected void CheckButton_Click(object sender, EventArgs e) { OrderInfo order = ButtoStart(); #region 拼团单,未拼满或者拼团失败不能通过审核 if (order.IsActivity == (int)OrderKind.GroupBuy) { var groupBuy = GroupBuyBLL.Read(order.FavorableActivityId); if (!(groupBuy.StartTime <= DateTime.Now && groupBuy.EndTime >= DateTime.Now && groupBuy.SignCount >= groupBuy.Quantity)) { ScriptHelper.Alert("拼团未成功,暂不能通过审核"); } } #endregion int startOrderStatus = order.OrderStatus; //确认付款,收款时间 order.PayDate = RequestHelper.DateNow; order.ShippingNumber = ShippingNumber.Text; order.ShippingDate = Convert.ToDateTime(ShippingDate.Text); //更新商品库存数量 ProductBLL.ChangeSendCountByOrder(order.Id, ChangeAction.Plus); //自提:现场审核提货,完成 if (order.SelfPick == 1) { order.OrderStatus = (int)OrderStatus.ReceiveShipping; #region 提货码状态置为1(无效) PickUpCodeBLL.UsePickCodeByOrder(order.Id); #endregion #region 完成订单给分销商返佣 //订单实际支付金额 decimal paid_money = OrderBLL.ReadNoPayMoney(order); //购买人 var user = UserBLL.Read(order.UserId); //购买者有推荐人 且 实际支付金额大于0才进行返佣 if (user.Recommend_UserId > 0 && paid_money > 0) { RebateBLL.RebateToDistributor(user, paid_money, order.Id); } #endregion } else {//配送:进入配货状态 order.OrderStatus = (int)OrderStatus.Shipping; } ButtonEnd(order, Note.Text, OrderOperate.Check, startOrderStatus); }
public ActionResult Input(Order model, int pageCurrent = 1) { try { //Kiểm tra tính hợp lệ của dử liệu if (string.IsNullOrEmpty(model.ShipAddress)) { ModelState.AddModelError("ShipAddress", "*"); } if (string.IsNullOrEmpty(model.ShipCity)) { ModelState.AddModelError("ShipCity", "*"); } if (string.IsNullOrEmpty(model.ShipCountry)) { ModelState.AddModelError("ShipCountry", "*"); } if (string.IsNullOrEmpty(model.Status)) { ModelState.AddModelError("Status", "*"); } if (model.Freight <= -1) { ModelState.AddModelError("Freight", "*"); } if (string.IsNullOrEmpty((model.ShipperID).ToString())) { ModelState.AddModelError("ShipperID", "*"); } if (!ModelState.IsValid) { SetAlert("Update order fail , pls check fields ", "warning"); return(View(model)); } // : Lưu dữ liệu vào DB OrderBLL.UpdateOrder(model); SetAlert("Updated order #" + model.OrderID + " success !", "success"); return(RedirectToAction("Index", "Order", new { idUpdated = model.OrderID, page = @pageCurrent })); } catch (Exception ex) { // ko nen lam dieu nay => tranparent error return(Content(ex.Message + " : " + ex.StackTrace)); } }
private void btnSave_Click(object sender, EventArgs e) { OrderBLL orderBLL = new OrderBLL(); if (this.checkBox1.Checked) { orderBLL.AddVAT(this.Order, null); } else { orderBLL.AddVAT(this.Order, this.numericUpDown1.Value); } this.DialogResult = DialogResult.OK; this.Close(); }
public MResult <string> OrderPaymentSuccess(string sid, string token, string guid, string user_id, string uid, string getdata, string postdata) { var result = new MResult <string>(); try { result = OrderBLL.OrderPaymentSuccess(SystemType, UserId, Uid, getdata, postdata); } catch (Exception) { result.status = MResultStatus.ExceptionError; result.msg = "处理数据出错!"; } return(result); }
public JsonResult GetMyOrders(int id) { var orders = new OrderBLL().GetList().Where(x => x.User.UserID == id); return this.Json(orders); }
public JsonResult GetOrderDetail(int id) { var order = new OrderBLL().GetById(id); return Json(order); }
public ActionResult Bills(Order model) { var bll = new OrderBLL(); model.TotalPrice = bll.GetBills(model); return View(model); }