public ActionResult UpdateEmployee(int id) { EditableEmployee employee = SessionEmployeeRepository.One(e => e.EmployeeID == id); if (TryUpdateModel(employee)) { // HTML decode the Notes property employee.Notes = HttpUtility.HtmlDecode(employee.Notes); SessionEmployeeRepository.Update(employee); return(RedirectToAction("EditorInGrid", this.GridRouteValues())); } return(View("EditorInGrid", SessionEmployeeRepository.All())); }
static Employee FindEmployee(IQueryable <Employee> items, EditableEmployee item) { return(items.Where(i => i.EmployeeId == item.EmployeeId).FirstOrDefault()); }
public async Task RemoveEmployeeAsync(EditableEmployee dataItem, CancellationToken ct = default) { await RemoveAsync <Employee, EditableEmployee>("EmployeesEditable", dataItem, FindEmployee, ct); }
public async Task UpdateEmployeeAsync(EditableEmployee dataItem, EditableEmployee newDataItem, CancellationToken ct = default) { await UpdateAsync <Employee, EditableEmployee>("EmployeesEditable", dataItem, newDataItem, FindEmployee, ct); }
public async Task UpdateEmployeeAsync(EditableEmployee dataItem, IDictionary <string, object> newValues, CancellationToken ct = default) { await UpdateAsync <Employee, EditableEmployee>("EmployeesEditable", dataItem, newValues, FindEmployee, ct); }
public async Task InsertEmployeeAsync(EditableEmployee newDateItem, CancellationToken ct = default) { await InsertAsync <Employee, EditableEmployee>("EmployeesEditable", newDateItem, UpdateEmployeeKey, ct); }