public ActionResult _LiabilityUpdateForm2nd(BusinessLiabilityUpdateViewModel model) { double totalLiabilityValue = GetLiabilityValueOfBusiness(model.AssetId); double liabilityValue = GetLiabilityValue(model.Id); double businessValue = BusinessQueries.GetBusinessValue(model.AssetId); if (businessValue < totalLiabilityValue - liabilityValue + model.Value && totalLiabilityValue - liabilityValue + model.Value > 0) { ModelState.AddModelError("CompareBusinessValueAndLiabilityValue", "Giá trị tổng số nợ không vượt quá giá trị góp vốn kinh doanh"); } if (ModelState.IsValid) { int result = BusinessLiabilityQueries.UpdateBusinessLiability(model); if (result > 0) { return(Content("success")); } else { return(Content("failed")); } } else { return(PartialView(model)); } }
public ActionResult DeleteLiability(int id) { int result = BusinessLiabilityQueries.DeleteBusinessLiability(id); if (result > 0) { return(Content("success")); } else { return(Content("failed")); } }
public ActionResult _LiabilityUpdateForm2nd(int id) { BusinessLiabilityUpdateViewModel model = BusinessLiabilityQueries.GetViewModelById(id); return(PartialView(model)); }