Пример #1
0
        public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                this.Data.Reservations.Delete(model.Id);
                this.Data.SaveChanges();
            }

            return(this.GridOperation(model, request));
        }
Пример #2
0
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            var dbModel = base.Create <Model>(model);

            if (dbModel != null)
            {
                model.Id = dbModel.Id;
            }

            return(this.GridOperation(model, request));
        }
Пример #3
0
 public ActionResult Update([DataSourceRequest] DataSourceRequest request, ViewModel model)
 {
     base.Update <Model, ViewModel>(model, model.Id);
     return(this.GridOperation(model, request));
 }