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

            model.ID        = Convert.ToInt32(rdr["ID"]);
            model.Phone     = ConverToStr(rdr["Phone"]);
            model.IP        = ConverToStr(rdr["IP"]);
            model.CDate     = ConvertToDate(rdr["CDate"]);
            model.Source    = ConverToStr(rdr["Source"]);
            model.VCode     = ConverToStr(rdr["VCode"]);
            model.ZStatus   = ConvertToInt(rdr["ZStatus"]);
            model.UserID    = ConvertToInt(rdr["UserID"]);
            model.UserName  = ConverToStr(rdr["UserName"]);
            model.Email     = ConverToStr(rdr["Email"]);
            model.SysRemind = ConverToStr(rdr["SysRemind"]);
            rdr.Close();
            return(model);
        }
Ejemplo n.º 2
0
        public override SqlParameter[] GetParameters()
        {
            M_Safe_Mobile model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Phone;
            sp[2].Value  = model.IP;
            sp[3].Value  = model.CDate;
            sp[4].Value  = model.Source;
            sp[5].Value  = model.VCode;
            sp[6].Value  = model.ZStatus;
            sp[7].Value  = model.UserID;
            sp[8].Value  = model.UserName;
            sp[9].Value  = model.Email;
            sp[10].Value = model.SysRemind;
            return(sp);
        }