示例#1
0
        public override SqlParameter[] GetParameters()
        {
            M_Content_CR model = this;

            if (CreateDate <= DateTime.MinValue)
            {
                CreateDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.WorksID;
            sp[2].Value  = model.GeneralID;
            sp[3].Value  = model.KeyWords;
            sp[4].Value  = model.Author;
            sp[5].Value  = model.Title;
            sp[6].Value  = model.Content;
            sp[7].Value  = model.Type;
            sp[8].Value  = model.FromType;
            sp[9].Value  = model.FromUrl;
            sp[10].Value = model.CreateDate;
            sp[11].Value = model.Status;
            sp[12].Value = model.RepPrice;
            sp[13].Value = model.MatPrice;
            return(sp);
        }
示例#2
0
        public M_Content_CR GetModelFromReader(DbDataReader rdr)
        {
            M_Content_CR model = new M_Content_CR();

            model.ID         = Convert.ToInt32(rdr["ID"]);
            model.WorksID    = ConverToStr(rdr["WorksID"]);
            model.GeneralID  = ConvertToInt("GeneralID");
            model.KeyWords   = ConverToStr(rdr["KeyWords"]);
            model.Author     = ConverToStr(rdr["Author"]);
            model.Title      = ConverToStr(rdr["Title"]);
            model.Content    = ConverToStr(rdr["Comment"]);
            model.Type       = ConverToStr(rdr["Type"]);
            model.FromType   = ConverToStr(rdr["FromType"]);
            model.FromUrl    = ConverToStr(rdr["FromUrl"]);
            model.CreateDate = ConvertToDate(rdr["CreateDate"]);
            model.Status     = ConvertToInt(rdr["Status"]);
            model.RepPrice   = ConverToDouble(rdr["RepPrice"]);
            model.MatPrice   = ConverToDouble(rdr["MatPrice"]);
            rdr.Close();
            return(model);
        }