public M_Content_TT GetModelFromReader(DbDataReader rdr) { M_Content_TT model = new M_Content_TT(); model.ID = Convert.ToInt32(rdr["ID"]); model.UserName = ConverToStr(rdr["UserName"]); model.Title = ConverToStr(rdr["Title"]); model.Content = ConverToStr(rdr["Content"]); model.Abstract = ConverToStr(rdr["Abstract"]); model.Type = ConverToStr(rdr["Type"]); model.Status = ConvertToInt(rdr["Status"]); model.IsSave = ConvertToInt(rdr["IsSave"]); model.ErrMsg = ConverToStr(rdr["ErrMsg"]); model.CreateDate = ConvertToDate(rdr["CreateDate"]); model.NewsType = ConvertToInt(rdr["NewsType"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_Content_TT model = this; if (CreateDate <= DateTime.MinValue) { CreateDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.UserName; sp[2].Value = model.Title; sp[3].Value = model.Content; sp[4].Value = model.Abstract; sp[5].Value = model.Type; sp[6].Value = model.Status; sp[7].Value = model.IsSave; sp[8].Value = model.ErrMsg; sp[9].Value = CreateDate; sp[10].Value = NewsType; return(sp); }