コード例 #1
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));
        }
コード例 #2
0
        public ActionResult Update([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                var dbModel = this.GetById <Event>(model.Id);

                dbModel.Title       = model.Title;
                dbModel.Description = model.Description;
                dbModel.Date        = model.Date;

                this.ChangeEntityStateAndSave(dbModel, EntityState.Modified);
                model.ModifiedOn = dbModel.ModifiedOn;
            }

            return(this.GridOperation(model, request));
        }