public AccountType(AccountTypeData accountTypeData)
 {
     AccountTypeKey  = accountTypeData.AccountTypeKey;
     AccountTypeCode = accountTypeData.AccountTypeCode;
     AccountTypeName = accountTypeData.AccountTypeName;
     AccountTypeDesc = accountTypeData.AccountTypeDesc;
     AddedDateTime   = accountTypeData.AuditAddDatetime;
     AddedUserID     = accountTypeData.AuditAddUserId;
     UpdateDateTime  = accountTypeData.AuditUpdateDatetime;
     UpdateUserID    = accountTypeData.AuditUpdateUserId;
 }
        } // Map function closer

        public List <SqlParameter> MapParamsForUpsert(AccountTypeData entity)
        {
            var sql_params = new List <SqlParameter>();

            sql_params.Add(new SqlParameter("@account_type_key", entity.AccountTypeKey));
            sql_params.Add(new SqlParameter("@account_type_code", entity.AccountTypeCode));
            sql_params.Add(new SqlParameter("@account_type_name", entity.AccountTypeName));
            sql_params.Add(new SqlParameter("@account_type_desc", entity.AccountTypeDesc));
            sql_params.Add(GetOutParam());
            return(sql_params);
        }
 public AccountType Map(AccountTypeData account_type_data)
 {
     return(new AccountType()
     {
         AccountTypeKey = account_type_data.AccountTypeKey,
         AccountTypeCode = account_type_data.AccountTypeCode,
         AccountTypeName = account_type_data.AccountTypeName,
         AccountTypeDesc = account_type_data.AccountTypeDesc,
         AddedUserID = account_type_data.AuditAddUserId,
         AddedDateTime = account_type_data.AuditAddDatetime,
         UpdateUserID = account_type_data.AuditUpdateUserId,
         UpdateDateTime = account_type_data.AuditUpdateDatetime,
     });
 }
Beispiel #4
0
        public void AccountTypeModelTest1()
        {
            var data = new AccountTypeData
            {
                AccountTypeKey      = 1,
                AccountTypeCode     = "TEST",
                AccountTypeName     = "TEST",
                AccountTypeDesc     = "TEST",
                AuditAddUserId      = "TEST",
                AuditAddDatetime    = new System.DateTime(2018, 1, 1),
                AuditUpdateUserId   = "TEST",
                AuditUpdateDatetime = new System.DateTime(2018, 1, 1),
            };
            var sut = new AccountType(data);

            Assert.True(sut.AccountTypeKey == 1);
            Assert.True(sut.AccountTypeCode == "TEST");
            Assert.True(sut.AccountTypeName == "TEST");
            Assert.True(sut.AccountTypeDesc == "TEST");
        }
 public AccountType Map(AccountTypeData commentData) => new AccountType(commentData);
 public List <SqlParameter> MapParamsForDelete(AccountTypeData entity)
 {
     return(MapParamsForDelete(entity.AccountTypeKey));
 }