protected override OpResult _Store(MoneyReceivedLine _obj) { if (_obj == null) { return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "MoneyReceiveLine object cannot be created as it is null")); } if (Exists(_obj)) { ExecuteNonQuery(GetQuery_UpdateQuery(_obj)); return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Updated, _obj)); } ExecuteNonQuery(GetQuery_InsertQuery(_obj)); if (_obj.MoneyReceivedLineID == null) { _obj.MoneyReceivedLineID = DbMgr.GetLastInsertID(); } _obj.FromDb = true; return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj)); }
private DbUpdateStatement GetQuery_UpdateQuery(MoneyReceivedLine _obj) { return(DbMgr.CreateUpdateClause("MoneyReceivedLines", GetFields(_obj), "MoneyReceivedLineID", _obj.MoneyReceivedLineID)); }
private DbInsertStatement GetQuery_InsertQuery(MoneyReceivedLine _obj) { Dictionary <string, DbFieldEntry> fields = GetFields(_obj); return(DbMgr.CreateInsertClause("MoneyReceivedLines", fields)); }