public ActionResult Edit(int PrivateMessageId, Models.SenPrivateMessage 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.SenPrivateMessage data) { try { this.Validate(data); data.CreatedOnUtc = DateTime.UtcNow; this._db.SenPrivateMessages.Add(data); this._db.SaveChanges(); return(data.PrivateMessageId); } catch (Exception) { throw; } }
public int Update(Models.SenPrivateMessage data) { try { this.Validate(data); this._db.Entry(data).State = System.Data.Entity.EntityState.Modified; this._db.SaveChanges(); return(data.PrivateMessageId); } catch (Exception) { throw; } }