public override IModel CreateModel(DataRow dr) { TaskAttachOperateLog taskattachoperatelog = new TaskAttachOperateLog(); taskattachoperatelog.OperateLogId = Convert.ToInt32(dr["OperateLogId"]); taskattachoperatelog.LogId = Convert.ToInt32(dr["LogId"]); if (dr["AttachId"] != DBNull.Value) { taskattachoperatelog.AttachId = Convert.ToInt32(dr["AttachId"]); } return taskattachoperatelog; }
public override IModel CreateModel(SqlDataReader dr) { TaskAttachOperateLog taskattachoperatelog = new TaskAttachOperateLog(); int indexOperateLogId = dr.GetOrdinal("OperateLogId"); taskattachoperatelog.OperateLogId = Convert.ToInt32(dr[indexOperateLogId]); int indexLogId = dr.GetOrdinal("LogId"); taskattachoperatelog.LogId = Convert.ToInt32(dr[indexLogId]); int indexAttachId = dr.GetOrdinal("AttachId"); if (dr["AttachId"] != DBNull.Value) { taskattachoperatelog.AttachId = Convert.ToInt32(dr[indexAttachId]); } return taskattachoperatelog; }