public override IModel CreateModel(SqlDataReader dr) { CashInInvoice cashininvoice = new CashInInvoice(); int indexRefId = dr.GetOrdinal("RefId"); cashininvoice.RefId = Convert.ToInt32(dr[indexRefId]); int indexAllotId = dr.GetOrdinal("AllotId"); if (dr["AllotId"] != DBNull.Value) { cashininvoice.AllotId = Convert.ToInt32(dr[indexAllotId]); } int indexCorpRefId = dr.GetOrdinal("CorpRefId"); if (dr["CorpRefId"] != DBNull.Value) { cashininvoice.CorpRefId = Convert.ToInt32(dr[indexCorpRefId]); } int indexContractRefId = dr.GetOrdinal("ContractRefId"); if (dr["ContractRefId"] != DBNull.Value) { cashininvoice.ContractRefId = Convert.ToInt32(dr[indexContractRefId]); } int indexCashInId = dr.GetOrdinal("CashInId"); if (dr["CashInId"] != DBNull.Value) { cashininvoice.CashInId = Convert.ToInt32(dr[indexCashInId]); } int indexInvoiceId = dr.GetOrdinal("InvoiceId"); if (dr["InvoiceId"] != DBNull.Value) { cashininvoice.InvoiceId = Convert.ToInt32(dr[indexInvoiceId]); } int indexAllotBala = dr.GetOrdinal("AllotBala"); if (dr["AllotBala"] != DBNull.Value) { cashininvoice.AllotBala = Convert.ToDecimal(dr[indexAllotBala]); } int indexDetailStatus = dr.GetOrdinal("DetailStatus"); if (dr["DetailStatus"] != DBNull.Value) { cashininvoice.DetailStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexDetailStatus]); } int indexFundsLogId = dr.GetOrdinal("FundsLogId"); if (dr["FundsLogId"] != DBNull.Value) { cashininvoice.FundsLogId = Convert.ToInt32(dr[indexFundsLogId]); } return cashininvoice; }
public override IModel CreateModel(DataRow dr) { CashInInvoice cashininvoice = new CashInInvoice(); cashininvoice.RefId = Convert.ToInt32(dr["RefId"]); if (dr["AllotId"] != DBNull.Value) { cashininvoice.AllotId = Convert.ToInt32(dr["AllotId"]); } if (dr["CorpRefId"] != DBNull.Value) { cashininvoice.CorpRefId = Convert.ToInt32(dr["CorpRefId"]); } if (dr["ContractRefId"] != DBNull.Value) { cashininvoice.ContractRefId = Convert.ToInt32(dr["ContractRefId"]); } if (dr["CashInId"] != DBNull.Value) { cashininvoice.CashInId = Convert.ToInt32(dr["CashInId"]); } if (dr["InvoiceId"] != DBNull.Value) { cashininvoice.InvoiceId = Convert.ToInt32(dr["InvoiceId"]); } if (dr["AllotBala"] != DBNull.Value) { cashininvoice.AllotBala = Convert.ToDecimal(dr["AllotBala"]); } if (dr["DetailStatus"] != DBNull.Value) { cashininvoice.DetailStatus = (Common.StatusEnum)Convert.ToInt32(dr["DetailStatus"]); } if (dr["FundsLogId"] != DBNull.Value) { cashininvoice.FundsLogId = Convert.ToInt32(dr["FundsLogId"]); } return cashininvoice; }