public ActionResult Delete(int index, int id) { var model = new CustomerConflictListModel(); model.GridIndex = index; try { CustomerService.DeleteCustomerConflict(id); } catch (Exception e1) { model.Error.SetError(e1); } return(Json(model, JsonRequestBehavior.AllowGet)); }
public CustomerConflictListModel FindCustomerConflictsListModel(int customerId, int index, int pageNo, int pageSize) { var model = new CustomerConflictListModel(); model.GridIndex = index; var allItems = db.FindCustomerConflicts(customerId) .OrderBy(cc => cc.Id); model.TotalRecords = allItems.Count(); foreach (var item in allItems.Skip((pageNo - 1) * pageSize) .Take(pageSize)) { var newItem = MapToModel(item); newItem.SensitiveWithCompanyName = item.Customer1.Name; model.Items.Add(newItem); } return(model); }