Пример #1
0
        public M_Design_RES GetModelFromReader(DbDataReader rdr)
        {
            M_Design_RES model = new M_Design_RES();

            model.ID         = Convert.ToInt32(rdr["ID"]);
            model.ZType      = ConverToStr(rdr["ztype"]);
            model.Useage     = ConverToStr(rdr["useage"]);
            model.Name       = ConverToStr(rdr["name"]);
            model.PreviewImg = ConverToStr(rdr["previewimg"]);
            model.VPath      = ConverToStr(rdr["vpath"]);
            model.CDate      = ConvertToDate(rdr["cdate"]);
            model.ZStatus    = ConvertToInt(rdr["zstatus"]);
            model.UserID     = ConvertToInt(rdr["userid"]);
            model.use        = ConverToStr(rdr["use"]);
            model.fun        = ConverToStr(rdr["fun"]);
            model.style      = ConverToStr(rdr["style"]);
            rdr.Close();
            return(model);
        }
Пример #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Design_RES model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.ZType;
            sp[2].Value  = model.Useage;
            sp[3].Value  = model.Name;
            sp[4].Value  = model.PreviewImg;
            sp[5].Value  = model.VPath;
            sp[6].Value  = model.CDate;
            sp[7].Value  = model.ZStatus;
            sp[8].Value  = model.UserID;
            sp[9].Value  = model.use;
            sp[10].Value = model.fun;
            sp[11].Value = model.style;
            return(sp);
        }