Ejemplo n.º 1
0
        public M_CartPro GetModelFromReader(DbDataReader rdr)
        {
            M_CartPro model = new M_CartPro();

            model.ID            = Convert.ToInt32(rdr["ID"]);
            model.Orderlistid   = Convert.ToInt32(rdr["Orderlistid"]);
            model.CartID        = Convert.ToInt32(rdr["CartID"]);
            model.ProID         = Convert.ToInt32(rdr["ProID"]);
            model.Pronum        = Convert.ToInt32(rdr["Pronum"]);
            model.Username      = rdr["Username"].ToString();
            model.Proname       = ConverToStr(rdr["Proname"]);
            model.Danwei        = ConverToStr(rdr["Danwei"]);
            model.Shijia        = Convert.ToDouble(rdr["Shijia"]);
            model.AllMoney      = Convert.ToDouble(rdr["AllMoney"]);
            model.Addtime       = Convert.ToDateTime(rdr["Addtime"]);
            model.PClass        = ConverToStr(rdr["PClass"]);
            model.ProClass      = ConvertToInt(rdr["ProClass"]);
            model.Attribute     = rdr["Attribute"].ToString();
            model.FarePrice     = rdr["FarePrice"].ToString();
            model.EndTime       = ConvertToDate(rdr["EndTime"]);
            model.Additional    = ConverToStr(rdr["Additional"]);
            model.StoreID       = ConvertToInt(rdr["StoreID"]);
            model.AllMoney_Json = ConverToStr(rdr["AllMoney_Json"]);
            model.AddStatus     = ConverToStr(rdr["AddStatus"]);
            model.code          = ConverToStr(rdr["code"]);
            model.ProInfo       = ConverToStr(rdr["ProInfo"]);
            model.Remark        = ConverToStr(rdr["Remark"]);
            model.UserID        = ConvertToInt(rdr["UserID"]);
            rdr.Dispose();
            return(model);
        }
Ejemplo n.º 2
0
        public override SqlParameter[] GetParameters()
        {
            M_CartPro model = this;

            if (model.Addtime <= DateTime.MinValue)
            {
                model.Addtime = DateTime.Now;
            }
            if (model.EndTime <= DateTime.MinValue)
            {
                model.EndTime = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Orderlistid;
            sp[2].Value  = model.CartID;
            sp[3].Value  = model.ProID;
            sp[4].Value  = model.Pronum;
            sp[5].Value  = model.Username;
            sp[6].Value  = model.Proname;
            sp[7].Value  = model.Danwei;
            sp[8].Value  = model.Shijia;
            sp[9].Value  = model.AllMoney;
            sp[10].Value = model.Addtime;
            sp[11].Value = model.PClass;
            sp[12].Value = model.ProClass;
            sp[13].Value = model.Attribute;
            sp[14].Value = model.FarePrice;
            sp[15].Value = model.EndTime;
            sp[16].Value = model.Additional;
            sp[17].Value = model.StoreID;
            sp[18].Value = model.AllMoney_Json;
            sp[19].Value = model.AddStatus;
            sp[20].Value = model.code;
            sp[21].Value = model.ProInfo;
            sp[22].Value = model.Remark;
            sp[23].Value = model.UserID;
            return(sp);
        }