public override SqlParameter[] GetParameters() { M_Course model = this; SqlParameter[] sp = GetSP(); sp[0].Value = model.id; sp[1].Value = model.CourseName; sp[2].Value = model.CoureseThrun; sp[3].Value = model.CoureseCode; sp[4].Value = model.CoureseCredit; sp[5].Value = model.CoureseRemark; sp[6].Value = model.Hot; sp[7].Value = model.CoureseClass; sp[8].Value = model.AddTime; sp[9].Value = model.AddUser; return(sp); }
public M_Course GetModelFromReader(DbDataReader rdr) { M_Course model = new M_Course(); model.id = Convert.ToInt32(rdr["id"]); model.CourseName = ConverToStr(rdr["CourseName"]); model.CoureseThrun = ConverToStr(rdr["CoureseThrun"]); model.CoureseCode = ConverToStr(rdr["CoureseCode"]); model.CoureseCredit = Convert.ToInt64(rdr["CoureseCredit"]); model.CoureseRemark = ConverToStr(rdr["CoureseRemark"]); model.Hot = ConvertToInt(rdr["Hot"]); model.CoureseClass = ConvertToInt(rdr["CoureseClass"]); model.AddTime = ConvertToDate(rdr["AddTime"]); model.AddUser = ConvertToInt(rdr["AddUser"]); rdr.Close(); rdr.Dispose(); return(model); }