protected override OpResult _Store(SettledDebit _obj)
        {
            if (_obj == null)
            {
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "SettledDebit 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.SettledDebitID == null)
            {
                _obj.SettledDebitID = DbMgr.GetLastInsertID();
            }
            _obj.FromDb = true;
            return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj));
        }
 private DbUpdateStatement GetQuery_UpdateQuery(SettledDebit _obj)
 {
     return(DbMgr.CreateUpdateClause("SettledDebits", GetFields(_obj), "SettledDebitID", _obj.SettledDebitID));
 }
        private DbInsertStatement GetQuery_InsertQuery(SettledDebit _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

            return(DbMgr.CreateInsertClause("SettledDebits", fields));
        }