예제 #1
0
        protected override OpResult _Store(EmployerExpenseType _obj)
        {
            if (_obj == null)
            {
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "EmployerExpenseType 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));
            _obj.FromDb = true;

            return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj));
        }
예제 #2
0
 private DbUpdateStatement GetQuery_UpdateQuery(EmployerExpenseType _obj)
 {
     return(DbMgr.CreateUpdateClause("EmployerExpenseTypes", GetFields(_obj), "EmployerExpenseTypeID", _obj.EmployerExpenseTypeID));
 }
예제 #3
0
        private DbInsertStatement GetQuery_InsertQuery(EmployerExpenseType _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

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