public ActionResult Edit(int id, Models.AppExpenseTable 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.AppExpenseTable data) { try { this.Validate(data); data.CreatedBy = GlobalVariant.GetAppUser().UserID; data.CreatedDateTime = DateTime.Now; SqlParameter[] parameters = ExConvert.Data2SqlParam(data, this._metaobject, this._paramnameoutput).ToArray(); this._db.Database.ExecuteSqlCommand(this._storeNameI, parameters); return((int)parameters.GetValueSqlParam(this._paramnameoutput)); } catch (Exception) { throw; } }
public int Update(Models.AppExpenseTable data) { try { this.Validate(data); data.ModifiedBy = GlobalVariant.GetAppUser().UserID; data.ModifiedDateTime = DateTime.Now; SqlParameter pOriginal = ExConvert.ParseSqlParam(data, this._metaobject.GetMetaByColumnName(this._paramnameoutput), this._paramnameupdate); var parameters = ExConvert.Data2SqlParam(data, this._metaobject, pOriginal).ToArray(); this._db.Database.ExecuteSqlCommand(this._storeNameU, parameters); return(data.ExpenseID); } catch (Exception) { throw; } }