public M_Ask GetModelFromReader(DbDataReader rdr) { M_Ask model = new M_Ask(); model.ID = Convert.ToInt32(rdr["ID"]); model.Qcontent = ConverToStr(rdr["Qcontent"]); model.Supplyment = ConverToStr(rdr["Supplyment"]); model.QueType = ConverToStr(rdr["QueType"]); model.AddTime = ConvertToDate(rdr["AddTime"]); model.UserId = ConvertToInt(rdr["UserId"]); model.UserName = ConverToStr(rdr["UserName"]); model.Elite = ConvertToInt(rdr["Elite"]); model.Score = ConvertToInt(rdr["Score"]); model.Status = ConvertToInt(rdr["Status"]); model.IsNi = ConvertToInt(rdr["IsNi"]); model.QTitle = ConverToStr(rdr["QTitle"]); model.IsSole = ConvertToInt(rdr["IsSole"]); rdr.Dispose(); return(model); }
public override SqlParameter[] GetParameters() { M_Ask model = this; if (model.AddTime <= DateTime.MinValue) { model.AddTime = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Qcontent; sp[2].Value = model.Supplyment; sp[3].Value = model.QueType; sp[4].Value = model.AddTime; sp[5].Value = model.UserId; sp[6].Value = model.UserName; sp[7].Value = model.Elite; sp[8].Value = model.Score; sp[9].Value = model.Status; sp[10].Value = model.IsNi; sp[11].Value = model.QTitle; sp[12].Value = model.IsSole; return(sp); }