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

            int indexDetailId = dr.GetOrdinal("DetailId");
            invoiceapplydetail.DetailId = Convert.ToInt32(dr[indexDetailId]);

            int indexInvoiceApplyId = dr.GetOrdinal("InvoiceApplyId");
            if (dr["InvoiceApplyId"] != DBNull.Value)
            {
                invoiceapplydetail.InvoiceApplyId = Convert.ToInt32(dr[indexInvoiceApplyId]);
            }

            int indexApplyId = dr.GetOrdinal("ApplyId");
            if (dr["ApplyId"] != DBNull.Value)
            {
                invoiceapplydetail.ApplyId = Convert.ToInt32(dr[indexApplyId]);
            }

            int indexInvoiceId = dr.GetOrdinal("InvoiceId");
            if (dr["InvoiceId"] != DBNull.Value)
            {
                invoiceapplydetail.InvoiceId = Convert.ToInt32(dr[indexInvoiceId]);
            }

            int indexBussinessInvoiceId = dr.GetOrdinal("BussinessInvoiceId");
            if (dr["BussinessInvoiceId"] != DBNull.Value)
            {
                invoiceapplydetail.BussinessInvoiceId = Convert.ToInt32(dr[indexBussinessInvoiceId]);
            }

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

            int indexSubContractId = dr.GetOrdinal("SubContractId");
            if (dr["SubContractId"] != DBNull.Value)
            {
                invoiceapplydetail.SubContractId = Convert.ToInt32(dr[indexSubContractId]);
            }

            int indexStockLogId = dr.GetOrdinal("StockLogId");
            if (dr["StockLogId"] != DBNull.Value)
            {
                invoiceapplydetail.StockLogId = Convert.ToInt32(dr[indexStockLogId]);
            }

            int indexInvoicePrice = dr.GetOrdinal("InvoicePrice");
            if (dr["InvoicePrice"] != DBNull.Value)
            {
                invoiceapplydetail.InvoicePrice = Convert.ToDecimal(dr[indexInvoicePrice]);
            }

            int indexPaymentAmount = dr.GetOrdinal("PaymentAmount");
            if (dr["PaymentAmount"] != DBNull.Value)
            {
                invoiceapplydetail.PaymentAmount = Convert.ToDecimal(dr[indexPaymentAmount]);
            }

            int indexInterestAmount = dr.GetOrdinal("InterestAmount");
            if (dr["InterestAmount"] != DBNull.Value)
            {
                invoiceapplydetail.InterestAmount = Convert.ToDecimal(dr[indexInterestAmount]);
            }

            int indexOtherAmount = dr.GetOrdinal("OtherAmount");
            if (dr["OtherAmount"] != DBNull.Value)
            {
                invoiceapplydetail.OtherAmount = Convert.ToDecimal(dr[indexOtherAmount]);
            }

            int indexInvoiceBala = dr.GetOrdinal("InvoiceBala");
            if (dr["InvoiceBala"] != DBNull.Value)
            {
                invoiceapplydetail.InvoiceBala = Convert.ToDecimal(dr[indexInvoiceBala]);
            }

            int indexDetailStatus = dr.GetOrdinal("DetailStatus");
            if (dr["DetailStatus"] != DBNull.Value)
            {
                invoiceapplydetail.DetailStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexDetailStatus]);
            }

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

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

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

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

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

            invoiceapplydetail.DetailId = Convert.ToInt32(dr["DetailId"]);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return invoiceapplydetail;
        }