protected void imgorder_Click(object sender, ImageClickEventArgs e) { OrderBLL orderbll = new OrderBLL(); tbOrders orders = new tbOrders() { Address = txtAddress.Text.Trim(), createdate = DateTime.Now, Customerid = int.Parse(Session["Cid"].ToString()), Mobile = txtMobile.Text.Trim(), Tel = txtTel.Text.Trim(), Postmoney = decimal.Parse(txtPostMoney.Text.Trim()), totalMoney = decimal.Parse(txtGoodsMoney.Text.Trim()) + decimal.Parse(txtPostMoney.Text.Trim()), Username = lbCustomer.Text, salesincome = decimal.Parse(txtGoodsMoney.Text.Trim()), sendUser = txtRealName.Text, remark = "" }; int ordersid= orderbll.tbOrders_ADD(orders); int count= orderbll.setorderprosbycid(int.Parse(Session["Cid"].ToString()), ordersid); int cartcount= sqlcom.UpdateTableByCondition("dbo.TbCat", " isOrders=1 ", " where isOrders=0 and Customerid=" + Session["Cid"].ToString()); int ccount= sqlcom.UpdateTableByCondition("dbo.tbCustomer", "c_name='" + txtRealName.Text.Trim() + "',tel='" + orders.Tel + "',mobile='" + orders.Mobile + "',email='" + txtEmail.Text + "',link_men='" + txtOthors.Text + "',address='" + txtAddress.Text + "'", " where id=" + Session["Cid"].ToString()); if (ordersid == 0 || count == 0 || cartcount == 0 || ccount == 0) { ContextUtil.SetAbort(); } else { ContextUtil.SetComplete(); Response.Redirect("PayWay.aspx?OrderID=" + ordersid); } }
protected void btnSave_Click(object sender, EventArgs e) { Order o = new Order(); o.OrderNo = CreateOrderNo();// rastgele oluştur o.UserId = new Guid(Membership.GetUser().ProviderUserKey.ToString()); o.Date = DateTime.Now; OrderBLL ob = new OrderBLL(); ob.Add(o); ProductBLL pb = new ProductBLL(); foreach (var p in Helper.Sepet) { OrderDetail od = new OrderDetail(); od.OrderId = o.Id; od.ProductId = p.Id; od.Quantity = p.Quantity; OrderDetailBLL obll = new OrderDetailBLL(); obll.Add(od); Product pr = pb.Get(x => x.Id == p.Id).FirstOrDefault(); pr.Stock -= p.Quantity; pb.Update(pr); Helper.Sepet = new List<ProductDTO>(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["OrderID"] != null) { string orderid = Request.QueryString["OrderID"].ToString(); tbOrders order = new tbOrders(); OrderBLL orderbll = new OrderBLL(); order= orderbll.getOrdersViewModel(int.Parse(orderid)); bankpay.Orderid= order.OrderNo;//订单编号 bankpay.Amount = order.totalMoney.ToString();//订单金额 bankpay.OrderDate = order.createdate.ToString();//订单日期 bankpay.Path1 = Server.MapPath(@"bank\user.crt");//拆分pfx后缀的证书后的公钥路径 bankpay.Path2 = Server.MapPath(@"bank\user.crt"); bankpay.Path3 = Server.MapPath(@"bank\user.key");//拆分pfx后缀的证书后的私钥路径 //加密 bankpay.Msg = bankpay.InterfaceName + bankpay.InterfaceVersion + bankpay.MerID + bankpay.MerAcct + bankpay.MerURL + bankpay.NotifyType + bankpay.Orderid + bankpay + bankpay.Amount + bankpay.CurType + bankpay.ResultType + bankpay.OrderDate + bankpay.VerifyJoinFlag; ICBCEBANKUTILLib.B2CUtil obj = new ICBCEBANKUTILLib.B2CUtil(); //加载公钥,私玥,密码,如果返回的0则成功 if (obj.init(bankpay.Path1, bankpay.Path2, bankpay.Path3, bankpay.Key) == 0) { bankpay.MerSignMsg = obj.signC(bankpay.Msg, bankpay.Msg.Length); bankpay.MerCert = obj.getCert(1); } else { Response.Write(obj.getRC()); } } }
public AdminBLL() { ca = new CategoriesBLL(); cu = new CustomerBLL(); em = new EmployeesBLL(); or = new OrderBLL(); oq = new Orders_QryBLL(); pb = new ProductsBLL(); salescat = new SalesbycategoriesBLL(); salesamt = new SalestotalsbyamountBLL(); sec = new SecurityBLL(); spl = new SuppliersBLL(); }
public void DeleteOrder(OrderBLL users) { _context.DeleteOrder(users.OrderID); }
public void JustUpdateOrder(OrderBLL order) { _context.JustUpdateOrder(order.OrderID, order.OrderName, order.OrderBonus); }