public ActionResult Delete(string id, FormCollection collection) { CreditSaleDetailDetailView creditSaleDetailDetailView = new CreditSaleDetailDetailView(); creditSaleDetailDetailView.CreditSaleDetailView = this.GetCreditSaleDetailView(id); //creditSaleDetailDetailView.EmployeeView = GetEmployee(); DeleteRequest request = new DeleteRequest() { ID = Guid.Parse(id) }; DeleteResponse response = this._creditSaleDetailService.DeleteCreditSaleDetail(request); if (response.Success) { return(RedirectToAction("Index")); } else { foreach (string error in response.ErrorMessages) { ModelState.AddModelError("", error); } return(View(creditSaleDetailDetailView)); } }
public ActionResult Create() { CreditSaleDetailDetailView creditSaleDetailDetailView = new CreditSaleDetailDetailView(); creditSaleDetailDetailView.EmployeeView = GetEmployee(); return(View(creditSaleDetailDetailView)); }
public ActionResult Edit(string id) { CreditSaleDetailDetailView creditSaleDetailDetailView = new CreditSaleDetailDetailView(); creditSaleDetailDetailView.CreditSaleDetailView = this.GetCreditSaleDetailView(id); creditSaleDetailDetailView.EmployeeView = GetEmployee(); return(View(creditSaleDetailDetailView)); }
public ActionResult Edit(string id, CreditSaleDetailDetailView creditSaleDetailDetailView) { if (ModelState.IsValid) { try { EditCreditSaleDetailRequest request = new EditCreditSaleDetailRequest(); request.ID = Guid.Parse(id); request.ModifiedEmployeeID = GetEmployee().ID; request.CreditServiceID = creditSaleDetailDetailView.CreditSaleDetailView.CreditServiceID; request.Discount = creditSaleDetailDetailView.CreditSaleDetailView.Discount; request.Imposition = creditSaleDetailDetailView.CreditSaleDetailView.Imposition; request.MainCreditSaleDetailID = creditSaleDetailDetailView.CreditSaleDetailView.MainCreditSaleDetailID; request.UnitPrice = creditSaleDetailDetailView.CreditSaleDetailView.UnitPrice; request.Units = creditSaleDetailDetailView.CreditSaleDetailView.Units; request.RowVersion = creditSaleDetailDetailView.CreditSaleDetailView.RowVersion; EditResponse response = this._creditSaleDetailService.EditCreditSaleDetail(request); if (response.Success) { return(RedirectToAction("Index")); } else { foreach (string error in response.ErrorMessages) { ModelState.AddModelError("", error); } return(View(creditSaleDetailDetailView)); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(View(creditSaleDetailDetailView)); } } return(View(creditSaleDetailDetailView)); }