public M_Plat_Topic GetModelFromReader(DbDataReader rdr) { M_Plat_Topic model = new M_Plat_Topic(); model.ID = Convert.ToInt32(rdr["id"]); model.TName = ConverToStr(rdr["TName"]); model.Count = ConvertToInt(rdr["Count"]); model.CDate = ConvertToDate(rdr["CDate"]); model.LastMsgID = ConvertToInt(rdr["LastMsgID"]); model.LastUserID = ConvertToInt(rdr["LastUserID"]); model.IsStar = ConvertToInt(rdr["IsStar"]); model.IsSystem = ConvertToInt(rdr["IsSystem"]); model.CompID = ConvertToInt(rdr["CompID"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_Plat_Topic model = this; if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.TName; sp[2].Value = model.Count; sp[3].Value = model.CDate; sp[4].Value = model.LastMsgID; sp[5].Value = model.LastUserID; sp[6].Value = model.IsStar; sp[7].Value = model.IsSystem; sp[8].Value = model.CompID; return(sp); }