public ActionResult GetOrderDetail(int ID, int DispatchID) { var order = OrderLogic.GetOrderByID(ID).FirstOrDefault(); ViewBag.Parties = PartyLogic.GetPartyByID(order.PartyID); ViewBag.Transports = TransportLogic.GetTransportByID(0); ViewBag.Products = ProductLogic.GetFinishedProducts(); ViewBag.Addresses = PartyAddressLogic.GetPartyAddress(order.PartyID); var dispatch = new Dispatch(); if (DispatchID == 0) { dispatch.DONo = DispatchLogic.GetMaxDispatchNo(); dispatch.DODate = DateTime.Now; } else { dispatch = DispatchLogic.GetDispatchByID(DispatchID).FirstOrDefault(); } dispatch.order = order; dispatch.details = DispatchLogic.GetDispatchDetail(DispatchID, order.ID); if (DispatchID > 0) { dispatch.order.PartyID = dispatch.PartyID; dispatch.order.DeliveryAddressID = dispatch.DeliveryAddressID; dispatch.order.TransportID = dispatch.TransportID; dispatch.order.BookingAt = dispatch.BookingAt; } return(PartialView("_DispatchDetails", dispatch)); }
// // GET: /Transport/ public ActionResult Add(string ID) { if (Convert.ToInt32(ID) > 0) { var transport = TransportLogic.GetTransportByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(transport)); } else { return(View(new Transport())); } }
// // GET: /Party/ public ActionResult Add(string ID) { ViewBag.TransportList = TransportLogic.GetTransportByID(0); ViewBag.PartyGroups = PartyGroupLogic.GetAllPartyGroup(); if (Convert.ToInt32(ID) > 0) { var party = PartyLogic.GetPartyByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(party)); } else { return(View(new Party())); } }
// // GET: /Order/ public ActionResult Add(string ID) { ViewBag.Dispatch = false; ViewBag.Parties = PartyLogic.GetPartyByID(0).Where(x => x.PartyGroupID == (PartyGroupLogic.GetAllPartyGroup().FirstOrDefault(y => y.GroupCode == "100003").ID)).OrderBy(x => x.Name); ViewBag.Transports = TransportLogic.GetTransportByID(0); ViewBag.Products = ProductLogic.GetFinishedProducts(); if (Convert.ToInt32(ID) > 0) { var order = OrderLogic.GetOrderByID(Convert.ToInt32(ID)).FirstOrDefault(); ViewBag.Addresses = PartyAddressLogic.GetPartyAddress(order.PartyID); return(View(order)); } else { var order = new Order(); order.OrderNo = OrderLogic.GetMaxOrderNo(); return(View(order)); } }
public ActionResult GetAll() { return(PartialView("GetAll", TransportLogic.GetTransportByID(0))); }