Exemplo n.º 1
0
        public override SqlParameter[] GetParameters()
        {
            M_User_Card model = this;

            if (model.CDate <= DateTime.Now)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.UserID;
            sp[2].Value  = model.StoreID;
            sp[3].Value  = model.CardNo;
            sp[4].Value  = model.CardLevel;
            sp[5].Value  = model.CardType;
            sp[6].Value  = model.CardStatus;
            sp[7].Value  = model.CardPurse;
            sp[8].Value  = model.CardRemark;
            sp[9].Value  = model.CardScope;
            sp[10].Value = model.CardAddon1;
            sp[11].Value = model.CardAddon2;
            sp[12].Value = model.OPUserID;
            sp[13].Value = model.CDate;
            sp[14].Value = model.Remark;
            return(sp);
        }
Exemplo n.º 2
0
        public M_User_Card GetModelFromReader(DbDataReader rdr)
        {
            M_User_Card model = new M_User_Card();

            model.ID         = ConvertToInt(rdr["ID"]);
            model.UserID     = ConvertToInt(rdr["UserID"]);
            model.StoreID    = ConvertToInt(rdr["StoreID"]);
            model.CardNo     = ConverToStr(rdr["CardNo"]);
            model.CardLevel  = ConvertToInt(rdr["CardLevel"]);
            model.CardType   = ConvertToInt(rdr["CardType"]);
            model.CardStatus = ConvertToInt(rdr["CardStatus"]);
            model.CardPurse  = ConverToDouble(rdr["CardPurse"]);
            model.CardRemark = ConverToStr(rdr["CardRemark"]);
            model.CardScope  = ConverToStr(rdr["CardScope"]);
            model.CardAddon1 = ConverToStr(rdr["CardAddon1"]);
            model.CardAddon2 = ConverToStr(rdr["CardAddon2"]);
            model.OPUserID   = ConvertToInt(rdr["OPUserID"]);
            model.CDate      = ConvertToDate(rdr["CDate"]);
            model.Remark     = ConverToStr(rdr["Remark"]);
            rdr.Close();
            return(model);
        }
Exemplo n.º 3
0
 public bool UpdateByID(M_User_Card model)
 {
     return(DBCenter.UpdateByID(model, model.ID));
 }
Exemplo n.º 4
0
 public int Insert(M_User_Card model)
 {
     return(DBCenter.Insert(model));
 }