public virtual JsonResult Destroy([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { this.driveEvents.Delete(model.Id); } return this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState)); }
public virtual JsonResult Create([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { var currentUserId = this.User.Identity.GetUserId(); var driveEvent = this.Mapper.Map<DriveEvent>(model); this.driveEvents.Create(driveEvent, currentUserId); } return this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState)); }
public virtual JsonResult Destroy([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { this.driveEvents.Delete(model.Id); } return(this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState))); }
public virtual JsonResult Update([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { var driveEvent = this.Mapper.Map <DriveEvent>(model); this.driveEvents.Update(driveEvent); } return(this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState))); }
public virtual JsonResult Create([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { var currentUserId = this.User.Identity.GetUserId(); var driveEvent = this.Mapper.Map <DriveEvent>(model); this.driveEvents.Create(driveEvent, currentUserId); } return(this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState))); }
public virtual JsonResult Update([DataSourceRequest] DataSourceRequest request, DriveEventViewModel model) { if (model != null && this.ModelState.IsValid) { var driveEvent = this.Mapper.Map<DriveEvent>(model); this.driveEvents.Update(driveEvent); } return this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState)); }