Example #1
0
        public M_Content_MarkDown GetModelFromReader(DbDataReader rdr)
        {
            M_Content_MarkDown model = new M_Content_MarkDown();

            model.ID         = Convert.ToInt32(rdr["ID"]);
            model.Title      = ConverToStr(rdr["Title"]);
            model.SubTitle   = ConverToStr(rdr["SubTitle"]);
            model.Thumbnail  = ConverToStr(rdr["Thumbnail"]);
            model.Content_MD = ConverToStr(rdr["Content_MD"]);
            model.Content    = ConverToStr(rdr["Content"]);
            model.AdminID    = ConvertToInt(rdr["AdminID"]);
            model.UserID     = ConvertToInt(rdr["UserID"]);
            model.UserName   = ConverToStr(rdr["UserName"]);
            model.ZStatus    = ConvertToInt(rdr["ZStatus"]);
            model.ZType      = ConvertToInt(rdr["ZType"]);
            model.CDate      = ConvertToDate(rdr["CDate"]);
            model.Remark     = ConverToStr(rdr["Remark"]);
            rdr.Close();
            return(model);
        }
Example #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Content_MarkDown model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Title;
            sp[2].Value  = model.SubTitle;
            sp[3].Value  = model.Thumbnail;
            sp[4].Value  = model.Content_MD;
            sp[5].Value  = model.Content;
            sp[6].Value  = model.AdminID;
            sp[7].Value  = model.UserID;
            sp[8].Value  = model.UserName;
            sp[9].Value  = model.ZStatus;
            sp[10].Value = model.ZType;
            sp[11].Value = model.CDate;
            sp[12].Value = model.Remark;
            return(sp);
        }