public ActionResult Edit(int SeedId, Models.GapSeed 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)); } }
public int Insert(Models.GapSeed data) { try { this.Validate(data); var _data = new Models.GapSeed(); this.MapView2Table(data, _data); this._db.GapSeeds.Add(_data); this._db.SaveChanges(); return(data.SeedId); } catch (Exception) { throw; } }
public int Update(Models.GapSeed data) { try { this.Validate(data); var _data = this.GetById2(data.SeedId); this.MapView2Table(data, _data); this._db.Entry(_data).State = System.Data.Entity.EntityState.Modified; this._db.SaveChanges(); return(data.SeedId); } catch (Exception) { throw; } }