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

            model.ID         = ConvertToInt(rdr["ID"]);
            model.TlpName    = ConverToStr(rdr["TlpName"]);
            model.PreviewImg = ConverToStr(rdr["PreviewImg"]);
            model.Remind     = ConverToStr(rdr["Remind"]);
            model.Price      = ConverToDouble(rdr["Price"]);
            model.ZType      = ConvertToInt(rdr["ZType"]);
            model.ZStatus    = ConvertToInt(rdr["ZStatus"]);
            model.CDate      = ConvertToDate(rdr["CDate"]);
            model.ClassID    = ConvertToInt(rdr["ClassID"]);
            model.Score      = ConverToDouble(rdr["Score"]);
            model.DefBy      = ConverToStr(rdr["DefBy"]);
            rdr.Close();
            return(model);
        }
Пример #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Design_Tlp model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.TlpName;
            sp[2].Value  = model.PreviewImg;
            sp[3].Value  = model.Remind;
            sp[4].Value  = model.Price;
            sp[5].Value  = model.ZType;
            sp[6].Value  = model.ZStatus;
            sp[7].Value  = model.CDate;
            sp[8].Value  = model.ClassID;
            sp[9].Value  = model.Score;
            sp[10].Value = model.DefBy;
            return(sp);
        }