예제 #1
0
        public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            if (model != null) // && ModelState.IsValid
            {
                this.data.Dislikes.Delete(model.Id.Value);
                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)
            {
                dbModel.UserId = this.CurrentUser.Id;
                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.Value);
     return(this.GridOperation(model, request));
 }