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)); }
public string CheckDuplicateEmailId(string EmailId, string ID) { var parties = PartyLogic.GetPartyByID(0); if (parties != null && parties.Count() > 0) { if (Convert.ToInt32(ID) > 0) { parties = parties.Where(x => x.EmailId == EmailId && x.ID != Convert.ToInt32(ID)); } else { parties = parties.Where(x => x.EmailId == EmailId); } if (parties.Count() > 0) { return("false"); } else { return("true"); } } else { return("true"); } }
public string CheckDuplicateName(string Name, string ID) { var parties = PartyLogic.GetPartyByID(0); if (parties != null && parties.Count() > 0) { if (Convert.ToInt32(ID) > 0) { parties = parties.Where(x => x.Name == Name && x.ID != Convert.ToInt32(ID)); } else { parties = parties.Where(x => x.Name == Name); } if (parties.Count() > 0) { return("false"); } else { return("true"); } } else { return("true"); } }
public JsonResult GetOrders(int ID) { ResponseMsg response = new ResponseMsg(); response.IsSuccess = true; response.ResponseValue = PartyLogic.GetOrders(ID).Where(x => !x.IsClosed); return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult Add(int ID) { ViewBag.ViewID = ID; if (ID > 0) { ViewBag.OrderID = DispatchLogic.GetDispatchByID(ID).FirstOrDefault().OrderID; } ViewBag.Parties = PartyLogic.GetOrderedParties(); return(View()); }
public ActionResult OrderRegister() { ViewBag.Parties = PartyLogic.GetPartyByID(0); ViewBag.Products = ProductLogic.GetFinishedProducts(); var orders = OrderLogic.GetOrderByID(0); if (orders != null) { orders = orders.OrderBy(x => x.OrderDate); } return(View(orders)); }
public ActionResult DispatchRegister() { ViewBag.Parties = PartyLogic.GetPartyByID(0); ViewBag.Products = ProductLogic.GetFinishedProducts(); var dispatches = DispatchLogic.GetDispatchByID(0); if (dispatches != null) { dispatches = dispatches.OrderBy(x => x.DODate); } return(View(dispatches)); }
public ActionResult Delete(string ID) { ResponseMsg response = new ResponseMsg(); if (Convert.ToInt32(ID) > 0) { PartyLogic.DeletePartyByID(ID); response.IsSuccess = true; response.ResponseValue = ""; } return(Json(response, JsonRequestBehavior.AllowGet)); }
// // GET: /Inward/ public ActionResult Add(string ID) { ViewBag.Parties = PartyLogic.GetPartyByID(0).Where(x => x.PartyGroupID == (PartyGroupLogic.GetAllPartyGroup().FirstOrDefault(y => y.GroupCode == "100004").ID)).OrderBy(x => x.Name); ViewBag.Products = ProductLogic.GetRawMaterialProducts(); if (Convert.ToInt32(ID) > 0) { var Inward = InwardLogic.GetInwardByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(Inward)); } else { return(View(new Inward())); } }
// // 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())); } }
public ActionResult Add(Party partyModel) { ResponseMsg response = new ResponseMsg(); partyModel.CreatedBy = partyModel.UpdatedBy = currUser.ID; if (PartyLogic.SaveParty(partyModel)) { response.IsSuccess = true; } else { response.IsSuccess = false; } return(Json(response)); }
// // GET: /Product/ public ActionResult Add(string ID) { ViewBag.Shades = ShadeLogic.GetShadeByID(0); ViewBag.Packings = PackingLogic.GetPackingByID(0); ViewBag.ProductGroups = ProductGroupLogic.GetProductGroupByID(0); ViewBag.ProductUnits = ProductUnitLogic.GetProductUnitByID(0); ViewBag.Parties = PartyLogic.GetPartyByID(0).Select(x => new { x.ID, x.Name }); ViewBag.RawMaterialTypes = RawMaterialTypeLogic.RawMaterialTypeByID(0); if (Convert.ToInt32(ID) > 0) { var product = ProductLogic.GetProductByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(product)); } else { return(View(new Product())); } }
// // 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 JsonResult GetAllParties() { return(Json(PartyLogic.GetPartyByID(0), JsonRequestBehavior.AllowGet)); }
public ActionResult GetAll() { return(View(PartyLogic.GetPartyByID(0))); }