Example #1
0
 public ActionResult Edit(string Name, Models.SysColumn collection)
 {
     try
     {
         string outputId = _dataobject.Update(collection);
         return(RedirectToAction(this.ActionReturn()));
     }
     catch (Exception ex)
     {
         Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex);
         return(PartialView(this._updateview, collection));
     }
 }
Example #2
0
        public string Insert(Models.SysColumn data)
        {
            try
            {
                this.Validate(data);

                this._db.SysColumns.Add(data);
                this._db.SaveChanges();
                return(data.Name);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
        public string Update(Models.SysColumn data)
        {
            try
            {
                this.Validate(data);

                this._db.Entry(data).State = System.Data.Entity.EntityState.Modified;
                this._db.SaveChanges();

                return(data.Name);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #4
0
 public string Insert(Models.SysColumn data)
 {
     try
     {
         this.Validate(data);
         var _data = new Models.SysColumn();
         this.MapView2Table(data, _data);
         this._db.SysColumns.Add(_data);
         this._db.SaveChanges();
         return(data.Name);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #5
0
        public string Update(Models.SysColumn data)
        {
            try
            {
                this.Validate(data);
                var _data = this.GetById2(data.Name);

                this.MapView2Table(data, _data);
                this._db.Entry(_data).State = System.Data.Entity.EntityState.Modified;
                this._db.SaveChanges();

                return(data.Name);
            }
            catch (Exception)
            {
                throw;
            }
        }