Esempio n. 1
0
        public override SqlParameter[] GetParameters()
        {
            M_User_BlogStyle model = this;

            if (model.Addtime <= DateTime.MinValue)
            {
                model.Addtime = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.StyleName;
            sp[2].Value  = model.Author;
            sp[3].Value  = model.StylePic;
            sp[4].Value  = model.Addtime;
            sp[5].Value  = model.StyleState;
            sp[6].Value  = model.UserIndexStyle;
            sp[7].Value  = model.LogStyle;
            sp[8].Value  = model.LogShowStyle;
            sp[9].Value  = model.PhotoStyle;
            sp[10].Value = model.PhotoShowStyle;
            sp[11].Value = model.PicShowStyle;
            sp[12].Value = model.GroupStyle;
            sp[13].Value = model.GroupShowStyle;
            sp[14].Value = model.GroupTopicShow;
            return(sp);
        }
Esempio n. 2
0
        public M_User_BlogStyle GetModelFromReader(DbDataReader rdr)
        {
            M_User_BlogStyle model = new M_User_BlogStyle();

            model.ID             = Convert.ToInt32(rdr["ID"]);
            model.StyleName      = ConverToStr(rdr["StyleName"]);
            model.Author         = ConverToStr(rdr["Author"]);
            model.StylePic       = ConverToStr(rdr["StylePic"]);
            model.Addtime        = ConvertToDate(rdr["Addtime"]);
            model.StyleState     = ConvertToInt(rdr["StyleState"]);
            model.UserIndexStyle = ConverToStr(rdr["UserIndexStyle"]);
            model.LogStyle       = ConverToStr(rdr["LogStyle"]);
            model.LogShowStyle   = ConverToStr(rdr["LogShowStyle"]);
            model.PhotoStyle     = ConverToStr(rdr["PhotoStyle"]);
            model.PhotoShowStyle = ConverToStr(rdr["PhotoShowStyle"]);
            model.PicShowStyle   = ConverToStr(rdr["PicShowStyle"]);
            model.GroupStyle     = ConverToStr(rdr["GroupStyle"]);
            model.GroupShowStyle = ConverToStr(rdr["GroupShowStyle"]);
            model.GroupTopicShow = ConverToStr(rdr["GroupTopicShow"]);
            rdr.Close();
            return(model);
        }