public ActionResult SaveExtraItems(List <ExtraPayrollItems> objs) { if (objs != null && objs.Count > 0) { //delete all var all = ExtraPayrollItems.GetAll(); if (all != null && all.Count > 0) { foreach (var obj in all) { obj.Delete(); } } //add them back foreach (var obj in objs.Where(x => x.Amount > 0 && !string.IsNullOrEmpty(x.PayrollItemName)).ToList()) { obj.Insert(); } } return(new JsonResult() { Data = ResultModel.SuccessResult() }); }
// GET: ExtraPayrollItems public ActionResult Index() { return(PartialView(ExtraPayrollItems.GetAll())); }