public override IModel CreateModel(SqlDataReader dr) { AuthOperate authoperate = new AuthOperate(); int indexAuthOperateId = dr.GetOrdinal("AuthOperateId"); authoperate.AuthOperateId = Convert.ToInt32(dr[indexAuthOperateId]); int indexOperateCode = dr.GetOrdinal("OperateCode"); if (dr["OperateCode"] != DBNull.Value) { authoperate.OperateCode = Convert.ToString(dr[indexOperateCode]); } int indexOperateName = dr.GetOrdinal("OperateName"); if (dr["OperateName"] != DBNull.Value) { authoperate.OperateName = Convert.ToString(dr[indexOperateName]); } int indexOperateType = dr.GetOrdinal("OperateType"); if (dr["OperateType"] != DBNull.Value) { authoperate.OperateType = Convert.ToInt32(dr[indexOperateType]); } int indexMenuId = dr.GetOrdinal("MenuId"); if (dr["MenuId"] != DBNull.Value) { authoperate.MenuId = Convert.ToInt32(dr[indexMenuId]); } int indexEmpId = dr.GetOrdinal("EmpId"); if (dr["EmpId"] != DBNull.Value) { authoperate.EmpId = Convert.ToInt32(dr[indexEmpId]); } int indexAuthOperateStatus = dr.GetOrdinal("AuthOperateStatus"); if (dr["AuthOperateStatus"] != DBNull.Value) { authoperate.AuthOperateStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexAuthOperateStatus]); } int indexCreatorId = dr.GetOrdinal("CreatorId"); if (dr["CreatorId"] != DBNull.Value) { authoperate.CreatorId = Convert.ToInt32(dr[indexCreatorId]); } int indexCreateTime = dr.GetOrdinal("CreateTime"); if (dr["CreateTime"] != DBNull.Value) { authoperate.CreateTime = Convert.ToDateTime(dr[indexCreateTime]); } int indexLastModifyId = dr.GetOrdinal("LastModifyId"); if (dr["LastModifyId"] != DBNull.Value) { authoperate.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]); } int indexLastModifyTime = dr.GetOrdinal("LastModifyTime"); if (dr["LastModifyTime"] != DBNull.Value) { authoperate.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]); } return authoperate; }
public override IModel CreateModel(DataRow dr) { AuthOperate authoperate = new AuthOperate(); authoperate.AuthOperateId = Convert.ToInt32(dr["AuthOperateId"]); if (dr["OperateCode"] != DBNull.Value) { authoperate.OperateCode = Convert.ToString(dr["OperateCode"]); } if (dr["OperateName"] != DBNull.Value) { authoperate.OperateName = Convert.ToString(dr["OperateName"]); } if (dr["OperateType"] != DBNull.Value) { authoperate.OperateType = Convert.ToInt32(dr["OperateType"]); } if (dr["MenuId"] != DBNull.Value) { authoperate.MenuId = Convert.ToInt32(dr["MenuId"]); } if (dr["EmpId"] != DBNull.Value) { authoperate.EmpId = Convert.ToInt32(dr["EmpId"]); } if (dr["AuthOperateStatus"] != DBNull.Value) { authoperate.AuthOperateStatus = (Common.StatusEnum)Convert.ToInt32(dr["AuthOperateStatus"]); } if (dr["CreatorId"] != DBNull.Value) { authoperate.CreatorId = Convert.ToInt32(dr["CreatorId"]); } if (dr["CreateTime"] != DBNull.Value) { authoperate.CreateTime = Convert.ToDateTime(dr["CreateTime"]); } if (dr["LastModifyId"] != DBNull.Value) { authoperate.LastModifyId = Convert.ToInt32(dr["LastModifyId"]); } if (dr["LastModifyTime"] != DBNull.Value) { authoperate.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]); } return authoperate; }