Beispiel #1
0
 public ActionResult Edit(string TableName, string ColumnName, Models.SysTableDetail collection)
 {
     try
     {
         int outputId = _dataobject.Update(collection);
         return(RedirectToAction(this.ActionReturn()));
     }
     catch (Exception ex)
     {
         Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex);
         return(PartialView(this._updateview, collection));
     }
 }
Beispiel #2
0
 public int Insert(Models.SysTableDetail data)
 {
     try
     {
         this.Validate(data);
         this._db.SysTableDetails.Add(data);
         this._db.SaveChanges();
         return(0);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #3
0
        public int Update(Models.SysTableDetail data)
        {
            try
            {
                this.Validate(data);
                this._db.Entry(data).State = System.Data.Entity.EntityState.Modified;
                this._db.SaveChanges();

                #region cập nhật lại cache
                var metaobject = WebApp.Areas.Admin.Services.GlobalMeta.GetMetaObject(data.TableName);
                var row        = metaobject.MetaTable.Where(m => m.ColumnName == data.ColumnName).SingleOrDefault();
                this.MapView2Table(data, row);
                //row.GridViewShow = data.GridViewShow;
                #endregion

                return(0);
            }
            catch (Exception)
            {
                throw;
            }
        }