Example #1
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            PriceConfirm priceconfirm = new PriceConfirm();

            int indexPriceConfirmId = dr.GetOrdinal("PriceConfirmId");
            priceconfirm.PriceConfirmId = Convert.ToInt32(dr[indexPriceConfirmId]);

            int indexOutCorpId = dr.GetOrdinal("OutCorpId");
            if (dr["OutCorpId"] != DBNull.Value)
            {
                priceconfirm.OutCorpId = Convert.ToInt32(dr[indexOutCorpId]);
            }

            int indexInCorpId = dr.GetOrdinal("InCorpId");
            if (dr["InCorpId"] != DBNull.Value)
            {
                priceconfirm.InCorpId = Convert.ToInt32(dr[indexInCorpId]);
            }

            int indexContractId = dr.GetOrdinal("ContractId");
            if (dr["ContractId"] != DBNull.Value)
            {
                priceconfirm.ContractId = Convert.ToInt32(dr[indexContractId]);
            }

            int indexSubId = dr.GetOrdinal("SubId");
            if (dr["SubId"] != DBNull.Value)
            {
                priceconfirm.SubId = Convert.ToInt32(dr[indexSubId]);
            }

            int indexContractAmount = dr.GetOrdinal("ContractAmount");
            if (dr["ContractAmount"] != DBNull.Value)
            {
                priceconfirm.ContractAmount = Convert.ToDecimal(dr[indexContractAmount]);
            }

            int indexSubAmount = dr.GetOrdinal("SubAmount");
            if (dr["SubAmount"] != DBNull.Value)
            {
                priceconfirm.SubAmount = Convert.ToDecimal(dr[indexSubAmount]);
            }

            int indexRealityAmount = dr.GetOrdinal("RealityAmount");
            if (dr["RealityAmount"] != DBNull.Value)
            {
                priceconfirm.RealityAmount = Convert.ToDecimal(dr[indexRealityAmount]);
            }

            int indexPricingAvg = dr.GetOrdinal("PricingAvg");
            if (dr["PricingAvg"] != DBNull.Value)
            {
                priceconfirm.PricingAvg = Convert.ToDecimal(dr[indexPricingAvg]);
            }

            int indexPremiumAvg = dr.GetOrdinal("PremiumAvg");
            if (dr["PremiumAvg"] != DBNull.Value)
            {
                priceconfirm.PremiumAvg = Convert.ToDecimal(dr[indexPremiumAvg]);
            }

            int indexInterestAvg = dr.GetOrdinal("InterestAvg");
            if (dr["InterestAvg"] != DBNull.Value)
            {
                priceconfirm.InterestAvg = Convert.ToDecimal(dr[indexInterestAvg]);
            }

            int indexOtherAvg = dr.GetOrdinal("OtherAvg");
            if (dr["OtherAvg"] != DBNull.Value)
            {
                priceconfirm.OtherAvg = Convert.ToDecimal(dr[indexOtherAvg]);
            }

            int indexInterestBala = dr.GetOrdinal("InterestBala");
            if (dr["InterestBala"] != DBNull.Value)
            {
                priceconfirm.InterestBala = Convert.ToDecimal(dr[indexInterestBala]);
            }

            int indexSettlePrice = dr.GetOrdinal("SettlePrice");
            if (dr["SettlePrice"] != DBNull.Value)
            {
                priceconfirm.SettlePrice = Convert.ToDecimal(dr[indexSettlePrice]);
            }

            int indexSettleBala = dr.GetOrdinal("SettleBala");
            if (dr["SettleBala"] != DBNull.Value)
            {
                priceconfirm.SettleBala = Convert.ToDecimal(dr[indexSettleBala]);
            }

            int indexPricingDate = dr.GetOrdinal("PricingDate");
            if (dr["PricingDate"] != DBNull.Value)
            {
                priceconfirm.PricingDate = Convert.ToDateTime(dr[indexPricingDate]);
            }

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

            int indexUnitId = dr.GetOrdinal("UnitId");
            if (dr["UnitId"] != DBNull.Value)
            {
                priceconfirm.UnitId = Convert.ToInt32(dr[indexUnitId]);
            }

            int indexTakeCorpId = dr.GetOrdinal("TakeCorpId");
            if (dr["TakeCorpId"] != DBNull.Value)
            {
                priceconfirm.TakeCorpId = Convert.ToInt32(dr[indexTakeCorpId]);
            }

            int indexContactPerson = dr.GetOrdinal("ContactPerson");
            if (dr["ContactPerson"] != DBNull.Value)
            {
                priceconfirm.ContactPerson = Convert.ToString(dr[indexContactPerson]);
            }

            int indexMemo = dr.GetOrdinal("Memo");
            if (dr["Memo"] != DBNull.Value)
            {
                priceconfirm.Memo = Convert.ToString(dr[indexMemo]);
            }

            int indexPriceConfirmStatus = dr.GetOrdinal("PriceConfirmStatus");
            if (dr["PriceConfirmStatus"] != DBNull.Value)
            {
                priceconfirm.PriceConfirmStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexPriceConfirmStatus]);
            }

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

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

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

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

            return priceconfirm;
        }
Example #2
0
        public override IModel CreateModel(DataRow dr)
        {
            PriceConfirm priceconfirm = new PriceConfirm();

            priceconfirm.PriceConfirmId = Convert.ToInt32(dr["PriceConfirmId"]);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return priceconfirm;
        }