예제 #1
0
        public M_AdBuy GetModelFromReader(DbDataReader rdr)
        {
            M_AdBuy model = new M_AdBuy();

            model.ID       = Convert.ToInt32(rdr["ID"]);
            model.ADID     = ConvertToInt(rdr["ADID"]);
            model.UID      = ConvertToInt(rdr["UID"]);
            model.Time     = ConvertToDate(rdr["Time"]);
            model.ShowTime = ConvertToInt(rdr["ShowTime"]);
            model.Scale    = ConvertToInt(rdr["Scale"]);
            model.Ptime    = ConvertToDate(rdr["Ptime"]);
            model.Content  = rdr["Content"].ToString();
            model.Files    = rdr["Files"].ToString();
            model.State    = ConvertToInt(rdr["State"]);
            model.Price    = Convert.ToDecimal(rdr["Price"]);
            model.Audit    = ConverToBool(rdr["Audit"]);
            rdr.Close();
            rdr.Dispose();
            return(model);
        }
예제 #2
0
        public override SqlParameter[] GetParameters()
        {
            M_AdBuy model = this;

            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.ADID;
            sp[2].Value  = model.UID;
            sp[3].Value  = model.Time;
            sp[4].Value  = model.ShowTime;
            sp[5].Value  = model.Scale;
            sp[6].Value  = model.Ptime;
            sp[7].Value  = model.Content;
            sp[8].Value  = model.Files;
            sp[9].Value  = model.State;
            sp[10].Value = model.Price;
            sp[11].Value = model.Audit;

            return(sp);
        }