public ActionResult Delete(int index, int id) { var model = new CustomerMarketingListModel { GridIndex = index }; try { CustomerService.DeleteCustomerMarketing(id); } catch (Exception e1) { model.Error.SetError(e1); } return(Json(model, JsonRequestBehavior.AllowGet)); }
public CustomerMarketingListModel FindCustomerMarketingListModel(int customerId, int index, int pageNo, int pageSize) { var model = new CustomerMarketingListModel(); model.GridIndex = index; var allItems = db.FindMarketingGroupSubscriptions(customerId); model.TotalRecords = allItems.Count(); foreach (var item in allItems.Skip((pageNo - 1) * pageSize) .Take(pageSize)) { var newItem = MapToModel(item); model.Items.Add(newItem); } return(model); }