public M_MisInfo GetModelFromReader(DbDataReader rdr) { M_MisInfo model = new M_MisInfo(); model.ID = Convert.ToInt32(rdr["ID"]); model.Title = ConverToStr(rdr["Title"]); model.Inputer = ConverToStr(rdr["Inputer"]); model.CreateTime = ConvertToDate(rdr["CreateTime"]); model.ProID = ConvertToInt(rdr["ProID"]); model.MID = ConvertToInt(rdr["MID"]); model.Type = ConvertToInt(rdr["Type"]); model.Status = ConvertToInt(rdr["Status"]); model.IsShare = ConverToStr(rdr["IsShare"]); model.IsWarn = ConverToStr(rdr["IsWarn"]); model.Content = ConverToStr(rdr["Content"]); model.Level = ConvertToInt(rdr["Level"]); model.IsElit = ConvertToInt(rdr["IsElit"]); if (!rdr.HasRows) { rdr.Close(); rdr.Dispose(); } return(model); }
public override SqlParameter[] GetParameters() { M_MisInfo model = this; if (model.CreateTime <= DateTime.MinValue) { model.CreateTime = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Title; sp[2].Value = model.Inputer; sp[3].Value = model.CreateTime; sp[4].Value = model.ProID; sp[5].Value = model.MID; sp[6].Value = model.Type; sp[7].Value = model.Status; sp[8].Value = model.IsShare; sp[9].Value = model.IsWarn; sp[10].Value = model.Content; sp[11].Value = model.Level; sp[12].Value = model.IsElit; return(sp); }