public ActionResult CreateOrder(long id) { if (_session.IsLogin && _session.IsStore && !_session.IsAdmin) { IOrder _ord = new OrderBO(); Business.Model.ModelWeb.InvoiceModel model = new Business.Model.ModelWeb.InvoiceModel(); model = _ord.GetOrderByID(_session.StoreID, id); ViewBag.BillAddress = model.Invoice.Address; ViewBag.DeliveryAddress = model.Invoice.AddressAddr1S; ViewBag.Description = model.Invoice.Notes; ViewBag.InvoiceDate = Utils.Utils.FormatDate(model.Invoice.InvoiceDate ?? DateTime.Now); ViewBag.City = model.Invoice.City; ViewBag.CityShip = model.Invoice.CityShip; ViewBag.ZipCode = model.Invoice.ZipCode; ViewBag.ZipCodeShip = model.Invoice.ZipCodeShip; ViewBag.State = model.Invoice.State; ViewBag.StateShip = model.Invoice.StateShip; ViewBag.InvoiceNo = model.Invoice.InvoiceNo; ViewBag.Amount = string.Format("{0:#,###0}", model.Invoice.SubTotal); ViewBag.DiscountAmount = string.Format("{0:#,###0}", model.Invoice.Discount); ViewBag.TaxAmount = string.Format("{0:#,###0}", model.Invoice.SaleTax); ViewBag.TotalAmount = string.Format("{0:#,###0}", model.Invoice.Total); ViewBag.IsTemplate = model.Invoice.IsTemplate; ViewBag.OrdID = id; return View(); } else return RedirectToAction("index", "backend"); }
protected void ctrlDepositAmount_TextChanged(object sender, EventArgs e) { OrderBO order = this.OrderService.GetOrderById(this.OrderId); if (order != null) { decimal orderTotal = order.OrderTotal; decimal vat = ctrlDecimalTextBoxVAT.Value; decimal orderTotalIncludedVat = orderTotal + vat; decimal deposit = ctrlDepositAmount.Value; lbRemaining.Text = (orderTotalIncludedVat - deposit).ToString("C0"); } }
protected void btSave_Click(object sender, EventArgs e) { OrderBO order = this.OrderService.GetOrderById(this.OrderId); if (order != null) { order.ApprovedByCustomer = cbOrderApproved.Checked; order.ApprovedDate = DateTime.Now; order.Note = txtNote.Text; this.OrderService.UpdateOrderInfo(order); } }
public static OrderDO OrderBOtoDO(OrderBO input) { OrderDO output = new OrderDO(); output.OrderID = input.OrderID; output.Quantity = input.Quantity; output.DateOfOrder = input.DateOfOrder; output.ExpectedArrivalDate = input.ExpectedArrivalDate; output.DistributionCenter = input.DistributionCenter; output.ProductID = input.ProductID; return(output); }
protected void ctrlDecimalTextBoxVAT_TextChanged(object sender, EventArgs e) { OrderBO order = this.OrderService.GetOrderById(this.OrderId); if (order != null) { decimal orderTotal = order.OrderTotal; decimal vat = ctrlDecimalTextBoxVAT.Value; lbOrderTotalIncludeVAT.Text = (orderTotal + vat).ToString("C0"); ctrlDepositAmount_TextChanged(new object(), new EventArgs()); } }
public Orders Create(OrderBO orderBo) { Customer customer = GetCustomerById(orderBo.CustId); Orders order = null; if (customer != null) { using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted })) { using (B2CEntities entities = new B2CEntities()) { order = new Orders { ordid = Guid.NewGuid(), custid = customer.custid, orderdate = DateTime.Now, price = orderBo.Price, status = "Create", comments = orderBo.Comments }; entities.orders.Add(order); entities.SaveChanges(); foreach (ItemsBO itemBO in orderBo.Items) { ProductBO product = GetProductById(itemBO.ProdId); Items item = new Items { itemid = Guid.NewGuid(), partnum = "", price = itemBO.Price, prodid = product.ID, productname = product.ESPECTACULO, quantity = itemBO.Quantity, ordid = order.ordid }; entities.items.Add(item); } entities.SaveChanges(); } scope.Complete(); } } return(order); }
public ActionResult TestOrder(OrderBO order) { List <OrderDetailBO> orderdet = new List <OrderDetailBO>(); if (Session["orddt"] != null) { orderdet = Session["orddt"] as List <OrderDetailBO>; } orderdet.Add(order.OrderDetailBO); Session["orddt"] = orderdet; order.orderdetails = orderdet; ViewBag.hdnFlag = Session["orddt"]; return(PartialView("Detail", order)); }
public ActionResult ChekoutSuccess(string orderid = "") { if (string.IsNullOrEmpty(orderid)) { return(RedirectToAction("Index")); } var commonInfo = LocationDAO.GetCommonInfoByID("commoninfo"); ViewBag.CommonInfo = commonInfo; OrderBO order = OrderDAO.GetOrderByID(orderid); return(View(order)); }
public double GetUpComingFee() { double sumDays = 0; var orders = dal.GetOrders(x => x.Status != OrderStatus.APPROVED && x.Status != OrderStatus.CANCELED && x.Status != OrderStatus.UNIT_NOT_AVALABELE && x.Status != OrderStatus.NO_CLIENT_RESPONSE); foreach (Order item in orders) { OrderBO temp = ConvertOrderDOToBO(item); sumDays += DaysBetweenDates(temp.GuestRequest.EntryDate, temp.GuestRequest.LeaveDate); } return(sumDays * dal.GetFeePercent()); }
internal Order Convert(OrderBO order) { if (order == null) { return(null); } return(new Order() { Id = order.Id, DeliveryDate = order.DeliveryDate, OrderDate = order.OrderDate, VideoId = order.VideoId }); }
internal Order Convert(OrderBO order) { if (order == null) { return(null); } return(new Order() { Id = order.Id, DeliveryDate = order.DeliveryDate, OrderDate = order.OrderDate, CustomerID = order.CustomerID }); }
protected void btSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { OrderBO order = Save(); } catch (Exception ex) { ProcessException(ex); } } }
public ActionResult Deletes(OrderBO order, int id) { int dele = id - 1; List <OrderDetailBO> orderdata = new List <OrderDetailBO>(); if (Session["orddt"] != null) { orderdata = Session["orddt"] as List <OrderDetailBO>; } Session["orddt"] = orderdata; order.orderdetails = orderdata; order.orderdetails.RemoveAt(dele); return(PartialView("Detail", order)); }
public int CreateOrder(OrderBO orderBO) { foreach (var item in orderBO.OrderItems) { productService.Update(item.ProductId, -(item.Qty)); } var order = mapper.Map <Order>(orderBO); unitOfWork.OrderRepository.Create(order); unitOfWork.Save(); return(orderBO.Id); }
protected void btSaveAndContinueEdit_Click(object sender, EventArgs e) { Page.Validate(); if (Page.IsValid) { try { OrderBO order = Save(); } catch (Exception ex) { ProcessException(ex); } } }
internal Order Convert(OrderBO order) { if (order == null) { return(null); } return(new Order() { Id = order.Id, DeliveryDate = order.DeliveryDate, OrderDate = order.OrderDate, Music = new MusicConverter().Convert(order.Music), MusicId = order.MusicId }); }
public void Should_Fail_When_ThankYouMessageIsNotDisplayed() { //Arrange string expectedResult = "Thank you for your purchase!"; OrderBO customerDetails = new OrderBO(); //Act var cart = menu.NavigateToCart(); var orderPage = cart.NavigateToOrderPage(); var thankYouPage = orderPage.SubmitDetails(customerDetails); var actualResult = thankYouPage.LblThankYou.Text; //Assert Assert.AreEqual(expectedResult, actualResult); }
public IActionResult Put(int id, [FromBody] OrderBO order) { if (id != order.Id) { return(StatusCode(405, "Path Id does not match Order ID in JSON object")); } try { return(Ok(facade.OrderService.Update(order))); } catch (InvalidOperationException e) { return(StatusCode(404, e.Message)); } }
//private void writeLog(String data) //{ // String errorMsg = data; // String serverPath = AppDomain.CurrentDomain.BaseDirectory; // string dd=DateTime.Now.ToString().Replace(':',' '); // dd = dd.Replace('/',' '); // data=data.Replace(':',' '); // String strXmlFilePath = serverPath + @"\" + data + dd + ".txt"; // File.WriteAllText(strXmlFilePath, errorMsg); //} internal DataSet GetSMSExistingCustomersOrder(OrderBO orderBO) { DataAccessSqlHelper sqlHelper = new DataAccessSqlHelper(orderBO.ConString); SqlCommand command = sqlHelper.CreateCommand(CommandType.StoredProcedure); command.CommandText = "OrderTransaction"; command.Parameters.Add(new SqlParameter("@shopId", orderBO.ShopId)); command.Parameters.Add(new SqlParameter("@Mode", orderBO.Mode)); command.Parameters.Add(new SqlParameter("@ProductData", orderBO.ProductData)); command.Parameters.Add(new SqlParameter("@QuantityData", orderBO.QuantityData)); command.Parameters.Add(new SqlParameter("@UnitData", orderBO.UnitData)); return(sqlHelper.ExecuteDataSet(command)); }
internal Order Convert(OrderBO order) { if (order == null) { return(null); } return(new Order() { Id = order.Id, OrderDate = order.OrderDate, DeliveryDate = order.DeliveryDate, //Customer = new CustomerConverter().Convert(order.Customer), CustomerId = order.CustomerId }); }
public Order Convert(OrderBO order) { if (order == null) { return(null); } { return(new Order() { Id = order.Id, DeliveryDate = order.DeliveryDate, OrderDate = order.OrderDate }); } }
public IActionResult Put(int id, [FromBody] OrderBO order) { if (id != order.Id) { return(BadRequest("Path Id does not exists")); } try { return(Ok(facade.OrderService.Edit(order))); } catch (InvalidOperationException e) { return(StatusCode(404, e.Message)); } }
public IActionResult Put(int id, [FromBody] OrderBO order) { if (id != order.Id) { return(BadRequest("Id da url não confere com id do objeto Json")); } try { return(Ok(facade.OrderService.Update(order))); } catch (InvalidOperationException e) { return(NotFound(e.Message)); } }
public ThankYouPage SubmitDetails(OrderBO customerDetails) { var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); wait.Until(ExpectedConditions.ElementExists(name)); TxtName().SendKeys(customerDetails.TxtName); TxtCountry().SendKeys(customerDetails.TxtCountry); TxtCity().SendKeys(customerDetails.TxtCity); TxtCard().SendKeys(customerDetails.TxtCard); TxtMonth().SendKeys(customerDetails.TxtMonth); TxtYear().SendKeys(customerDetails.TxtYear); BtnPurchase.Click(); return(new ThankYouPage(driver)); }
public Order ConvertOrderBOToDO(OrderBO order) { Order target = new Order(); target.Key = order.Key; target.Fee = order.Fee; target.GuestRequestKey = order.GuestRequest.Key; target.HostingUnitKey = order.HostingUnit.Key; target.CloseDate = order.CloseDate; target.HostId = order.HostId; target.OrderDate = order.OrderDate; target.SentDate = order.SentDate; target.Status = (OrderStatus)order.Status; return(target); }
public static bool CreateOrder(OrderBO order, ref string error) { try { var collection = MongoClientHelper.Current.ConnectDatabase().GetCollection <OrderBO>("order"); collection.InsertOne(order); return(true); } catch (Exception ex) { error = ex.ToString(); return(false); } }
public int MarkDaysOfUnit(OrderBO order) { if (!CheckUnitAvilabilty(ConvertHostingUnitBOToDO(order.HostingUnit), order.GuestRequest.EntryDate, order.GuestRequest.LeaveDate)) { return(-1); } DateTime entryDate = order.GuestRequest.EntryDate; for (; entryDate < order.GuestRequest.LeaveDate; entryDate = entryDate.AddDays(1)) { order.HostingUnit.SetDates(entryDate); } dal.UpdateHostingUnit(ConvertHostingUnitBOToDO(order.HostingUnit)); // update the "real" unit in the DataBase return((order.GuestRequest.LeaveDate - order.GuestRequest.EntryDate).Days); }
public IActionResult Put(int id, [FromBody] OrderBO value) { if (id != value.Id) { return(BadRequest("Path ID does not match Order ID in json object.")); } try { return(Ok(facade.OrderService.Update(value))); } catch (InvalidOperationException ex) { return(StatusCode(404, ex.Message)); } }
public void Order() { T_Order data = new T_Order() { address = "AAA", createBy = 1, email = "jj@gmail", firstName = "jirawat", isActive = true, isCreateShipping = false, isPay = false, isShipping = false, lastName = "jannet", orderDate = DateTime.Now, payDate = null, paymentId = null, province = "Yasothon", shippingDate = null, shippingDateEnd = null, shippingDateStart = null, shippingPrice = 100, totalPrice = 1000, totalProductPrice = 900, updateBy = 1, zipCode = "35000", tel = "0925699900" }; OrderBO bo = new OrderBO(); //var res = bo.addOrderHeader(data); }
public static int UpdateOrderStatus(string orderID, OrderBO updateOrder) { var collection = MongoClientHelper.Current.ConnectDatabase().GetCollection <OrderBO>("order"); var filterBuilder = Builders <OrderBO> .Filter; var filter = filterBuilder.Eq("id", orderID); var result = collection.ReplaceOne(filter, updateOrder); if (result.IsAcknowledged) { return(updateOrder.status); } return(-1); }
public IActionResult Put(int id, [FromBody] OrderBO order) { if (id != order.Id) { return(BadRequest("Path ID does not match customer ID in json object")); } try { var ord = facade.OrderService.Update(order); return(Ok(ord)); } catch (InvalidOperationException e) { return(StatusCode(404, e.Message)); } }
public static ListOrders GetParkingOrderDet(int userID) { ListOrders lst = new ListOrders(); using (SqlConnection Conn = new SqlConnection("server=SURESHJALAJA-PC;database=Parking;uid=sa;password=suresh;")) { using (SqlCommand Cmd = new SqlCommand(Constants.Proc.USP_GET_ORDERDETAILS, Conn)) { Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = userID; Conn.Open(); using (SqlDataReader dr = Cmd.ExecuteReader()) { while (dr.Read()) { OrderBO Obj = new OrderBO(); Obj.OrderID = Convert.ToInt32(dr["OrderID"]); Obj.FullName = Convert.ToString(dr["FullName"]); Obj.ParkingAvalabilityID = Convert.ToInt32(dr["ParkingAvalabilityID"]); Obj.UserID = Convert.ToInt32(dr["UserID"]); Obj.Price = Convert.ToDecimal(dr["Price"]); Obj.ParkingIDs = Convert.ToString(dr["ParkingIDs"]); Obj.FromDateTime = dr["DateTimeFrom"]!=DBNull.Value? Convert.ToDateTime(dr["DateTimeFrom"]):DateTime.MinValue; Obj.ToDateTime = dr["DateTimeTo"] != DBNull.Value ? Convert.ToDateTime(dr["DateTimeTo"]) : DateTime.MinValue; Obj.BuildingName = Convert.ToString(dr["BuildingName"]); Obj.TowerName = Convert.ToString(dr["TowerName"]); lst.Add(Obj); } } } } return lst; }
public JsonResult GetOrdItem(long ID) { IOrder _ord = new OrderBO(); var data = _ord.GetOrdItemByID(_session.StoreID, _session.CustomerID, ID); string jsonData = new JavaScriptSerializer().Serialize(data); return Json(jsonData, JsonRequestBehavior.AllowGet); }
public JsonResult Delete(long ID) { IOrder _ord = new OrderBO(); var data = _ord.Delete(ID); return Json(new { IsOk = data }, JsonRequestBehavior.AllowGet); }
public JsonResult GetOrderByStoreID(DateTime FromDate, DateTime ToDate, int Status) { if (_session.IsLogin && _session.IsStore && !_session.IsAdmin) { string jsonData = "[]"; IOrder _order = new OrderBO(); List<vw_Invoice> data; data = _order.GetOrderByStoreID(_session.StoreID, FromDate, ToDate, Status); if (data != null) jsonData = new JavaScriptSerializer().Serialize(data); return Json(jsonData, JsonRequestBehavior.AllowGet); } else RedirectToAction("index", "backend"); return Json("[]", JsonRequestBehavior.AllowGet); }
public ActionResult Create(long ID) { if (_session.IsLogin && !_session.IsStore) { ViewBag.IsEdit = true; IOrder _ord = new OrderBO(); Business.Model.ModelWeb.InvoiceModel model = new Business.Model.ModelWeb.InvoiceModel(); model = _ord.GetOrderByID(_session.StoreID, _session.CustomerID, ID); if (ID==-1) { ViewBag.IsNew = true; ViewBag.InvoiceDate = Utils.Utils.FormatDate(DateTime.Now); if (model.Invoice != null) { ViewBag.BillAddress = model.Invoice.Address; ViewBag.DeliveryAddress = model.Invoice.AddressAddr1S; ViewBag.City = model.Invoice.City ?? model.Customer.City; ViewBag.CityShip = model.Invoice.CityShip ?? model.Customer.City; ViewBag.ZipCode = model.Invoice.ZipCode ?? model.Customer.ZipCode; ViewBag.ZipCodeShip = model.Invoice.ZipCodeShip ?? model.Customer.ZipCode; ViewBag.State = model.Invoice.State ?? model.Customer.State; ViewBag.StateShip = model.Invoice.StateShip ?? model.Customer.State; } else { ViewBag.BillAddress = model.Customer.Address; ViewBag.DeliveryAddress = model.Customer.AddressAddr1S; ViewBag.City = model.Customer.City; ViewBag.CityShip = model.Customer.City; ViewBag.ZipCode = model.Customer.ZipCode; ViewBag.ZipCodeShip = model.Customer.ZipCode; ViewBag.State = model.Customer.State; ViewBag.StateShip = model.Customer.State; } ViewBag.InvoiceNo = _ord.GetRefNo(_session.StoreID, "INVOICE"); ViewBag.Amount = "0"; ViewBag.DiscountAmount = "0"; ViewBag.TaxAmount = "0"; ViewBag.TotalAmount = "0"; ViewBag.Description = ""; ViewBag.IsTemplate = false; } else { if (model.Invoice.InvoiceStatus == 0) ViewBag.IsEdit = true; else ViewBag.IsEdit = false; ViewBag.IsNew = false; ViewBag.BillAddress = model.Invoice.Address; ViewBag.DeliveryAddress = model.Invoice.AddressAddr1S; ViewBag.Description = model.Invoice.Notes; ViewBag.InvoiceDate = Utils.Utils.FormatDate(model.Invoice.InvoiceDate?? DateTime.Now); ViewBag.City = model.Invoice.City; ViewBag.CityShip = model.Invoice.CityShip; ViewBag.ZipCode = model.Invoice.ZipCode; ViewBag.ZipCodeShip = model.Invoice.ZipCodeShip; ViewBag.State = model.Invoice.State; ViewBag.StateShip = model.Invoice.StateShip; ViewBag.InvoiceNo = model.Invoice.InvoiceNo; ViewBag.Amount = string.Format("{0:#,###0}", model.Invoice.SubTotal); ViewBag.DiscountAmount = string.Format("{0:#,###0}", model.Invoice.Discount); ViewBag.TaxAmount = string.Format("{0:#,###0}", model.Invoice.SaleTax); ViewBag.TotalAmount = string.Format("{0:#,###0}", model.Invoice.Total); ViewBag.IsTemplate = model.Invoice.IsTemplate; } ViewBag.OrdID = ID; return View(); } else return RedirectToAction("Index", "Home"); }
public JsonResult GetPromotionRule() { string jsonData = "[]"; IOrder _cls = new OrderBO(); var data = _cls.GetPromotion(_session.SiteID, _session.StoreID); if(data!=null) jsonData = new JavaScriptSerializer().Serialize(data); return Json(jsonData, JsonRequestBehavior.AllowGet); }
public JsonResult GetOrdForBackend(long ID) { string jsonData = "[]"; IOrder _ord = new OrderBO(); var data = _ord.GetOrdItemByID(ID); if (data != null) jsonData = new JavaScriptSerializer().Serialize(data); return Json(jsonData, JsonRequestBehavior.AllowGet); }
public JsonResult SaveData(Invoice invoice, List<GetOrdItem_Result> ordItems) { try { invoice.StoreID = _session.StoreID; invoice.CustomerID = _session.CustomerID; List<OrdItem> ordDtail = new List<OrdItem>(); OrdItem mRow; foreach(GetOrdItem_Result row in ordItems) { if (row.Qty > 0) { mRow = new OrdItem(); mRow.InvoiceID = invoice.InvoiceID; mRow.ProductID = row.ProductID ?? -1; mRow.ProductName = row.ProductName; mRow.Description = row.Description; mRow.ProdType = row.ProdType; mRow.NoTax = row.NoTax; mRow.Qty = row.Qty; mRow.Price = row.Price; mRow.Discount = row.Discount; mRow.Total = row.Total; if (invoice.InvoiceID == -1) mRow.RecordState = (int)NailShop.Business.Enum.RecordState.AddNew; else mRow.RecordState = (int)NailShop.Business.Enum.RecordState.Modify; ordDtail.Add(mRow); } } IOrder _cls = new OrderBO(); if(_cls.Save(invoice, ordDtail)) return Json(new { IsOk = true }, JsonRequestBehavior.AllowGet); return Json(new { IsOk = false }, JsonRequestBehavior.AllowGet); } catch { return Json(new { IsOk = false }, JsonRequestBehavior.AllowGet); } }