public void Constructor_WhenNoParameters_UnitCountDefaultNull()
        {
            // Arrange, Act
            var generalJournalLine = new GeneralJournalLine();

            // Assert
            Assert.AreEqual(null, generalJournalLine.UnitCount);
        }
Exemple #2
0
        private DbDeleteStatement GetQuery_DeleteQuery(GeneralJournalLine _obj)
        {
            DbDeleteStatement clause = DbMgr.CreateDeleteClause();

            clause.DeleteFrom("GeneralJournalLines").Criteria.IsEqual("GeneralJournalLines", "GeneralJournalLineID", _obj.GeneralJournalLineID);

            return(clause);
        }
Exemple #3
0
 protected override OpResult _Delete(GeneralJournalLine _obj)
 {
     if (Exists(_obj))
     {
         ExecuteNonQuery(GetQuery_DeleteQuery(_obj));
         return(OpResult.NotifyDeleteAction(OpResult.ResultStatus.ExistsAndDeleted, _obj));
     }
     return(OpResult.NotifyDeleteAction(OpResult.ResultStatus.NotExists, _obj, "GeneralJournalLine object cannot be deleted as it does not exist"));
 }
Exemple #4
0
        protected override OpResult _Store(GeneralJournalLine _obj)
        {
            if (_obj == null)
            {
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "GeneralJournalLine 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.GeneralJournalLineID == null)
            {
                _obj.GeneralJournalLineID = DbMgr.GetLastInsertID();
            }
            _obj.FromDb = true;
            return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj));
        }
Exemple #5
0
 private DbUpdateStatement GetQuery_UpdateQuery(GeneralJournalLine _obj)
 {
     return(DbMgr.CreateUpdateClause("GeneralJournalLines", GetFields(_obj), "GeneralJournalLineID", _obj.GeneralJournalLineID));
 }
Exemple #6
0
        private DbInsertStatement GetQuery_InsertQuery(GeneralJournalLine _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

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