public override IModel CreateModel(SqlDataReader dr) { SplitDoc splitdoc = new SplitDoc(); int indexSplitDocId = dr.GetOrdinal("SplitDocId"); splitdoc.SplitDocId = Convert.ToInt32(dr[indexSplitDocId]); int indexSpliter = dr.GetOrdinal("Spliter"); if (dr["Spliter"] != DBNull.Value) { splitdoc.Spliter = Convert.ToInt32(dr[indexSpliter]); } int indexSplitDocTime = dr.GetOrdinal("SplitDocTime"); if (dr["SplitDocTime"] != DBNull.Value) { splitdoc.SplitDocTime = Convert.ToDateTime(dr[indexSplitDocTime]); } int indexSplitDocStatus = dr.GetOrdinal("SplitDocStatus"); if (dr["SplitDocStatus"] != DBNull.Value) { splitdoc.SplitDocStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexSplitDocStatus]); } int indexOldRefNoId = dr.GetOrdinal("OldRefNoId"); if (dr["OldRefNoId"] != DBNull.Value) { splitdoc.OldRefNoId = Convert.ToInt32(dr[indexOldRefNoId]); } int indexOldRefNo = dr.GetOrdinal("OldRefNo"); if (dr["OldRefNo"] != DBNull.Value) { splitdoc.OldRefNo = Convert.ToString(dr[indexOldRefNo]); } int indexOldStockId = dr.GetOrdinal("OldStockId"); if (dr["OldStockId"] != DBNull.Value) { splitdoc.OldStockId = Convert.ToInt32(dr[indexOldStockId]); } int indexStockLogId = dr.GetOrdinal("StockLogId"); if (dr["StockLogId"] != DBNull.Value) { splitdoc.StockLogId = Convert.ToInt32(dr[indexStockLogId]); } int indexCreatorId = dr.GetOrdinal("CreatorId"); if (dr["CreatorId"] != DBNull.Value) { splitdoc.CreatorId = Convert.ToInt32(dr[indexCreatorId]); } int indexCreateTime = dr.GetOrdinal("CreateTime"); if (dr["CreateTime"] != DBNull.Value) { splitdoc.CreateTime = Convert.ToDateTime(dr[indexCreateTime]); } int indexLastModifyId = dr.GetOrdinal("LastModifyId"); if (dr["LastModifyId"] != DBNull.Value) { splitdoc.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]); } int indexLastModifyTime = dr.GetOrdinal("LastModifyTime"); if (dr["LastModifyTime"] != DBNull.Value) { splitdoc.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]); } return splitdoc; }
public override IModel CreateModel(DataRow dr) { SplitDoc splitdoc = new SplitDoc(); splitdoc.SplitDocId = Convert.ToInt32(dr["SplitDocId"]); if (dr["Spliter"] != DBNull.Value) { splitdoc.Spliter = Convert.ToInt32(dr["Spliter"]); } if (dr["SplitDocTime"] != DBNull.Value) { splitdoc.SplitDocTime = Convert.ToDateTime(dr["SplitDocTime"]); } if (dr["SplitDocStatus"] != DBNull.Value) { splitdoc.SplitDocStatus = (Common.StatusEnum)Convert.ToInt32(dr["SplitDocStatus"]); } if (dr["OldRefNoId"] != DBNull.Value) { splitdoc.OldRefNoId = Convert.ToInt32(dr["OldRefNoId"]); } if (dr["OldRefNo"] != DBNull.Value) { splitdoc.OldRefNo = Convert.ToString(dr["OldRefNo"]); } if (dr["OldStockId"] != DBNull.Value) { splitdoc.OldStockId = Convert.ToInt32(dr["OldStockId"]); } if (dr["StockLogId"] != DBNull.Value) { splitdoc.StockLogId = Convert.ToInt32(dr["StockLogId"]); } if (dr["CreatorId"] != DBNull.Value) { splitdoc.CreatorId = Convert.ToInt32(dr["CreatorId"]); } if (dr["CreateTime"] != DBNull.Value) { splitdoc.CreateTime = Convert.ToDateTime(dr["CreateTime"]); } if (dr["LastModifyId"] != DBNull.Value) { splitdoc.LastModifyId = Convert.ToInt32(dr["LastModifyId"]); } if (dr["LastModifyTime"] != DBNull.Value) { splitdoc.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]); } return splitdoc; }