Exemplo n.º 1
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            CashIn cashin = new CashIn();

            int indexCashInId = dr.GetOrdinal("CashInId");
            cashin.CashInId = Convert.ToInt32(dr[indexCashInId]);

            int indexCashInEmpId = dr.GetOrdinal("CashInEmpId");
            if (dr["CashInEmpId"] != DBNull.Value)
            {
                cashin.CashInEmpId = Convert.ToInt32(dr[indexCashInEmpId]);
            }

            int indexCashInDate = dr.GetOrdinal("CashInDate");
            if (dr["CashInDate"] != DBNull.Value)
            {
                cashin.CashInDate = Convert.ToDateTime(dr[indexCashInDate]);
            }

            int indexCashInBlocId = dr.GetOrdinal("CashInBlocId");
            if (dr["CashInBlocId"] != DBNull.Value)
            {
                cashin.CashInBlocId = Convert.ToInt32(dr[indexCashInBlocId]);
            }

            int indexCashInCorpId = dr.GetOrdinal("CashInCorpId");
            if (dr["CashInCorpId"] != DBNull.Value)
            {
                cashin.CashInCorpId = Convert.ToInt32(dr[indexCashInCorpId]);
            }

            int indexCurrencyId = dr.GetOrdinal("CurrencyId");
            if (dr["CurrencyId"] != DBNull.Value)
            {
                cashin.CurrencyId = Convert.ToInt32(dr[indexCurrencyId]);
            }

            int indexCashInBala = dr.GetOrdinal("CashInBala");
            if (dr["CashInBala"] != DBNull.Value)
            {
                cashin.CashInBala = Convert.ToDecimal(dr[indexCashInBala]);
            }

            int indexCashInBank = dr.GetOrdinal("CashInBank");
            if (dr["CashInBank"] != DBNull.Value)
            {
                cashin.CashInBank = Convert.ToInt32(dr[indexCashInBank]);
            }

            int indexCashInAccoontId = dr.GetOrdinal("CashInAccoontId");
            if (dr["CashInAccoontId"] != DBNull.Value)
            {
                cashin.CashInAccoontId = Convert.ToInt32(dr[indexCashInAccoontId]);
            }

            int indexCashInMode = dr.GetOrdinal("CashInMode");
            if (dr["CashInMode"] != DBNull.Value)
            {
                cashin.CashInMode = Convert.ToInt32(dr[indexCashInMode]);
            }

            int indexPayBlocId = dr.GetOrdinal("PayBlocId");
            if (dr["PayBlocId"] != DBNull.Value)
            {
                cashin.PayBlocId = Convert.ToInt32(dr[indexPayBlocId]);
            }

            int indexPayCorpId = dr.GetOrdinal("PayCorpId");
            if (dr["PayCorpId"] != DBNull.Value)
            {
                cashin.PayCorpId = Convert.ToInt32(dr[indexPayCorpId]);
            }

            int indexPayCorpName = dr.GetOrdinal("PayCorpName");
            if (dr["PayCorpName"] != DBNull.Value)
            {
                cashin.PayCorpName = Convert.ToString(dr[indexPayCorpName]);
            }

            int indexPayBankId = dr.GetOrdinal("PayBankId");
            if (dr["PayBankId"] != DBNull.Value)
            {
                cashin.PayBankId = Convert.ToInt32(dr[indexPayBankId]);
            }

            int indexPayBank = dr.GetOrdinal("PayBank");
            if (dr["PayBank"] != DBNull.Value)
            {
                cashin.PayBank = Convert.ToString(dr[indexPayBank]);
            }

            int indexPayAccountId = dr.GetOrdinal("PayAccountId");
            if (dr["PayAccountId"] != DBNull.Value)
            {
                cashin.PayAccountId = Convert.ToInt32(dr[indexPayAccountId]);
            }

            int indexPayAccount = dr.GetOrdinal("PayAccount");
            if (dr["PayAccount"] != DBNull.Value)
            {
                cashin.PayAccount = Convert.ToString(dr[indexPayAccount]);
            }

            int indexPayWord = dr.GetOrdinal("PayWord");
            if (dr["PayWord"] != DBNull.Value)
            {
                cashin.PayWord = Convert.ToString(dr[indexPayWord]);
            }

            int indexBankLog = dr.GetOrdinal("BankLog");
            if (dr["BankLog"] != DBNull.Value)
            {
                cashin.BankLog = Convert.ToString(dr[indexBankLog]);
            }

            int indexCashInStatus = dr.GetOrdinal("CashInStatus");
            if (dr["CashInStatus"] != DBNull.Value)
            {
                cashin.CashInStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexCashInStatus]);
            }

            int indexCreatorId = dr.GetOrdinal("CreatorId");
            if (dr["CreatorId"] != DBNull.Value)
            {
                cashin.CreatorId = Convert.ToInt32(dr[indexCreatorId]);
            }

            int indexCreateTime = dr.GetOrdinal("CreateTime");
            if (dr["CreateTime"] != DBNull.Value)
            {
                cashin.CreateTime = Convert.ToDateTime(dr[indexCreateTime]);
            }

            int indexLastModifyId = dr.GetOrdinal("LastModifyId");
            if (dr["LastModifyId"] != DBNull.Value)
            {
                cashin.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]);
            }

            int indexLastModifyTime = dr.GetOrdinal("LastModifyTime");
            if (dr["LastModifyTime"] != DBNull.Value)
            {
                cashin.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]);
            }

            return cashin;
        }
Exemplo n.º 2
0
        public override IModel CreateModel(DataRow dr)
        {
            CashIn cashin = new CashIn();

            cashin.CashInId = Convert.ToInt32(dr["CashInId"]);

            if (dr["CashInEmpId"] != DBNull.Value)
            {
                cashin.CashInEmpId = Convert.ToInt32(dr["CashInEmpId"]);
            }

            if (dr["CashInDate"] != DBNull.Value)
            {
                cashin.CashInDate = Convert.ToDateTime(dr["CashInDate"]);
            }

            if (dr["CashInBlocId"] != DBNull.Value)
            {
                cashin.CashInBlocId = Convert.ToInt32(dr["CashInBlocId"]);
            }

            if (dr["CashInCorpId"] != DBNull.Value)
            {
                cashin.CashInCorpId = Convert.ToInt32(dr["CashInCorpId"]);
            }

            if (dr["CurrencyId"] != DBNull.Value)
            {
                cashin.CurrencyId = Convert.ToInt32(dr["CurrencyId"]);
            }

            if (dr["CashInBala"] != DBNull.Value)
            {
                cashin.CashInBala = Convert.ToDecimal(dr["CashInBala"]);
            }

            if (dr["CashInBank"] != DBNull.Value)
            {
                cashin.CashInBank = Convert.ToInt32(dr["CashInBank"]);
            }

            if (dr["CashInAccoontId"] != DBNull.Value)
            {
                cashin.CashInAccoontId = Convert.ToInt32(dr["CashInAccoontId"]);
            }

            if (dr["CashInMode"] != DBNull.Value)
            {
                cashin.CashInMode = Convert.ToInt32(dr["CashInMode"]);
            }

            if (dr["PayBlocId"] != DBNull.Value)
            {
                cashin.PayBlocId = Convert.ToInt32(dr["PayBlocId"]);
            }

            if (dr["PayCorpId"] != DBNull.Value)
            {
                cashin.PayCorpId = Convert.ToInt32(dr["PayCorpId"]);
            }

            if (dr["PayCorpName"] != DBNull.Value)
            {
                cashin.PayCorpName = Convert.ToString(dr["PayCorpName"]);
            }

            if (dr["PayBankId"] != DBNull.Value)
            {
                cashin.PayBankId = Convert.ToInt32(dr["PayBankId"]);
            }

            if (dr["PayBank"] != DBNull.Value)
            {
                cashin.PayBank = Convert.ToString(dr["PayBank"]);
            }

            if (dr["PayAccountId"] != DBNull.Value)
            {
                cashin.PayAccountId = Convert.ToInt32(dr["PayAccountId"]);
            }

            if (dr["PayAccount"] != DBNull.Value)
            {
                cashin.PayAccount = Convert.ToString(dr["PayAccount"]);
            }

            if (dr["PayWord"] != DBNull.Value)
            {
                cashin.PayWord = Convert.ToString(dr["PayWord"]);
            }

            if (dr["BankLog"] != DBNull.Value)
            {
                cashin.BankLog = Convert.ToString(dr["BankLog"]);
            }

            if (dr["CashInStatus"] != DBNull.Value)
            {
                cashin.CashInStatus = (Common.StatusEnum)Convert.ToInt32(dr["CashInStatus"]);
            }

            if (dr["CreatorId"] != DBNull.Value)
            {
                cashin.CreatorId = Convert.ToInt32(dr["CreatorId"]);
            }

            if (dr["CreateTime"] != DBNull.Value)
            {
                cashin.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
            }

            if (dr["LastModifyId"] != DBNull.Value)
            {
                cashin.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
            }

            if (dr["LastModifyTime"] != DBNull.Value)
            {
                cashin.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            }

            return cashin;
        }