Beispiel #1
0
 public ActionResult Edit(int id, Models.AppAccumulatedMaterialView 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.AppAccumulatedMaterialView data)
 {
     try
     {
         this.Validate(data);
         var _data = new Models.AppAccumulatedMaterialTable();
         this.MapView2Table(data, _data);
         this._db.AppAccumulatedMaterialTables.Add(_data);
         this._db.SaveChanges();
         return(data.AccumulatedMaterialID);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #3
0
        public int Update(Models.AppAccumulatedMaterialView data)
        {
            try
            {
                this.Validate(data);
                var _data = this.GetById2(data.AccumulatedMaterialID);

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

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