示例#1
0
        protected override OpResult _Store(DebitRefund _obj)
        {
            if (_obj == null)
            {
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "DebitRefund 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.DebitRefundID == null)
            {
                _obj.DebitRefundID = DbMgr.GetLastInsertID();
            }
            _obj.FromDb = true;
            return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj));
        }
示例#2
0
 private DbUpdateStatement GetQuery_UpdateQuery(DebitRefund _obj)
 {
     return(DbMgr.CreateUpdateClause("DebitRefunds", GetFields(_obj), "DebitRefundID", _obj.DebitRefundID));
 }
示例#3
0
        private DbInsertStatement GetQuery_InsertQuery(DebitRefund _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

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