public M_ViewHistory GetModelFromReader(DbDataReader rdr) { M_ViewHistory model = new M_ViewHistory(); model.ID = Convert.ToInt32(rdr["Id"]); model.InfoId = ConvertToInt(rdr["InfoId"]); model.type = ConverToStr(rdr["type"]); model.UserID = Convert.ToInt32(rdr["UserID"]); model.addtime = ConvertToDate(rdr["addtime"]); model.ViewCount = ConvertToInt(rdr["ViewCount"]); model.ZStatus = ConvertToInt(rdr["ZStatus"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_ViewHistory model = this; if (model.addtime <= DateTime.MinValue) { model.addtime = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.InfoId; sp[2].Value = model.type; sp[3].Value = model.UserID; sp[4].Value = model.addtime; sp[5].Value = model.ViewCount; sp[6].Value = model.ZStatus; return(sp); }