public override SqlParameter[] GetParameters() { M_Mis model = this; SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Title; sp[2].Value = model.Rate; sp[3].Value = model.ComTime; sp[4].Value = model.limitTime; sp[5].Value = model.Type; sp[6].Value = model.Content; sp[7].Value = model.Status; sp[8].Value = model.Joiner; sp[9].Value = model.CreateTime; sp[10].Value = model.ParentID; sp[11].Value = model.Inputer; sp[12].Value = model.Pic; return(sp); }
public M_Mis GetModelFromReader(SqlDataReader rdr) { M_Mis model = new M_Mis(); model.ID = ConvertToInt(rdr["ID"]); model.Title = rdr["Title"].ToString(); model.Rate = ConvertToInt(rdr["Rate"]); model.ComTime = ConvertToDate(rdr["ComTime"].ToString()); model.limitTime = ConvertToDate(rdr["limitTime"].ToString()); model.Type = ConvertToInt(rdr["Type"]); model.Content = rdr["Content"].ToString(); model.Status = ConvertToInt(rdr["Status"]); model.Joiner = rdr["Joiner"].ToString(); model.CreateTime = ConvertToDate(rdr["CreateTime"]); model.ParentID = ConvertToInt(rdr["ParentID"]); model.Inputer = ConverToStr(rdr["Inputer"]); model.Pic = ConverToStr(rdr["Pic"]); rdr.Close(); rdr.Dispose(); return(model); }