public ActionResult DeleteConfirmed(long id) { InboundOrdersPost inboundorders = _inboundordersService.GetPost(id); inboundorders.UserName = User.Identity.Name; _inboundordersService.Delete(inboundorders); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixInboundOrder,sInboundOrder,sOrderReference,ixInboundOrderType,ixFacility,ixCompany,ixBusinessPartner,dtExpectedAt,ixStatus")] InboundOrdersPost inboundorders) { if (ModelState.IsValid) { inboundorders.UserName = User.Identity.Name; _inboundordersService.Edit(inboundorders); return(RedirectToAction("Index")); } ViewBag.ixBusinessPartner = new SelectList(_inboundordersService.selectBusinessPartners().Select(x => new { x.ixBusinessPartner, x.sBusinessPartner }), "ixBusinessPartner", "sBusinessPartner", inboundorders.ixBusinessPartner); ViewBag.ixCompany = new SelectList(_inboundordersService.selectCompanies().Select(x => new { x.ixCompany, x.sCompany }), "ixCompany", "sCompany", inboundorders.ixCompany); ViewBag.ixFacility = new SelectList(_inboundordersService.selectFacilities().Select(x => new { x.ixFacility, x.sFacility }), "ixFacility", "sFacility", inboundorders.ixFacility); ViewBag.ixInboundOrderType = new SelectList(_inboundordersService.selectInboundOrderTypes().Select(x => new { x.ixInboundOrderType, x.sInboundOrderType }), "ixInboundOrderType", "sInboundOrderType", inboundorders.ixInboundOrderType); ViewBag.ixStatus = new SelectList(_inboundordersService.selectStatuses().Select(x => new { x.ixStatus, x.sStatus }), "ixStatus", "sStatus", inboundorders.ixStatus); return(View(inboundorders)); }
public ActionResult Edit(long id) { InboundOrdersPost inboundorders = _inboundordersService.GetPost(id); if (inboundorders == null) { return(NotFound()); } ViewBag.ixBusinessPartner = new SelectList(_inboundordersService.selectBusinessPartners().Select(x => new { x.ixBusinessPartner, x.sBusinessPartner }), "ixBusinessPartner", "sBusinessPartner", inboundorders.ixBusinessPartner); ViewBag.ixCompany = new SelectList(_inboundordersService.selectCompanies().Select(x => new { x.ixCompany, x.sCompany }), "ixCompany", "sCompany", inboundorders.ixCompany); ViewBag.ixFacility = new SelectList(_inboundordersService.selectFacilities().Select(x => new { x.ixFacility, x.sFacility }), "ixFacility", "sFacility", inboundorders.ixFacility); ViewBag.ixInboundOrderType = new SelectList(_inboundordersService.selectInboundOrderTypes().Select(x => new { x.ixInboundOrderType, x.sInboundOrderType }), "ixInboundOrderType", "sInboundOrderType", inboundorders.ixInboundOrderType); ViewBag.ixStatus = new SelectList(_inboundordersService.selectStatuses().Select(x => new { x.ixStatus, x.sStatus }), "ixStatus", "sStatus", inboundorders.ixStatus); return(View(inboundorders)); }
public ActionResult Create([Bind("ixInboundOrder,sInboundOrder,sOrderReference,ixInboundOrderType,ixFacility,ixCompany,ixBusinessPartner,dtExpectedAt,ixStatus")] InboundOrdersPost inboundorders) { if (ModelState.IsValid) { inboundorders.UserName = User.Identity.Name; //Custom Code Start | Replaced Code Block //Replaced Code Block Start //_inboundordersService.Create(inboundorders); //return RedirectToAction("Index"); //Replaced Code Block End var ixInboundOrder = _inboundordersService.Create(inboundorders).Result; return(RedirectToAction("Edit", new { id = ixInboundOrder })); //Custom Code End } ViewBag.ixBusinessPartner = new SelectList(_inboundordersService.selectBusinessPartners().Select(x => new { x.ixBusinessPartner, x.sBusinessPartner }), "ixBusinessPartner", "sBusinessPartner"); ViewBag.ixCompany = new SelectList(_inboundordersService.selectCompanies().Select(x => new { x.ixCompany, x.sCompany }), "ixCompany", "sCompany"); ViewBag.ixFacility = new SelectList(_inboundordersService.selectFacilities().Select(x => new { x.ixFacility, x.sFacility }), "ixFacility", "sFacility"); ViewBag.ixInboundOrderType = new SelectList(_inboundordersService.selectInboundOrderTypes().Select(x => new { x.ixInboundOrderType, x.sInboundOrderType }), "ixInboundOrderType", "sInboundOrderType"); ViewBag.ixStatus = new SelectList(_inboundordersService.selectStatuses().Select(x => new { x.ixStatus, x.sStatus }), "ixStatus", "sStatus"); return(View(inboundorders)); }
public Task Delete(InboundOrdersPost inboundordersPost) { // Additional validations // Pre-process // Process this._inboundordersRepository.RegisterDelete(inboundordersPost); try { this._inboundordersRepository.Commit(); } catch (Exception ex) { this._inboundordersRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(InboundOrdersPost inboundordersPost) { // Additional validations // Pre-process // Process this._inboundordersRepository.RegisterCreate(inboundordersPost); try { this._inboundordersRepository.Commit(); } catch (Exception ex) { this._inboundordersRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(inboundordersPost.ixInboundOrder)); }
public void RegisterDelete(InboundOrdersPost inboundordersPost) { _context.InboundOrdersPost.Remove(inboundordersPost); }
public void RegisterEdit(InboundOrdersPost inboundordersPost) { _context.Entry(inboundordersPost).State = EntityState.Modified; }
public void RegisterCreate(InboundOrdersPost inboundordersPost) { _context.InboundOrdersPost.Add(inboundordersPost); }