Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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)));
        }
Esempio n. 4
0
        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)));
        }
Esempio n. 5
0
        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)));
        }
Esempio n. 6
0
        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));
        }