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

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