Ejemplo n.º 1
0
        protected override Web.Com.XResp Execute()
        {
            if (!string.IsNullOrEmpty(img))
            {
                us.image = img;
            }
            if (range > 0)
            {
                us.range = range;
            }
            if (region > 0)
            {
                us.region = region;
            }
            if (!string.IsNullOrEmpty(name))
            {
                us.name = name;
            }

            if (!string.IsNullOrEmpty(pwd))
            {
                us.pwd = pwd;
            }

            SubmitDBChanges();

            var r = new us()
            {
                id          = us.id,
                image       = us.image,
                ukey        = us.ukey,
                name        = us.name,
                tel         = us.tel,
                range       = us.range,
                region      = us.region,
                pwd         = us.pwd,
                auth_status = us.auth_status
            };

            return(r);
        }
Ejemplo n.º 2
0
        protected override XResp Execute()
        {
            var u = DB.x_user.FirstOrDefault(o => o.tel == tel);

            if (u == null)
            {
                throw new XExcep("T手机号和密码不匹配");
            }
            if (u.pwd != pwd)
            {
                throw new XExcep("T手机号和密码不匹配");
            }

            u.last_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            u.last_lng  = lng;
            u.last_lat  = lat;
            u.ukey      = Tools.GetRandRom(32, 3);

            var r = new us()
            {
                id          = u.id,
                image       = u.image,
                ukey        = u.ukey,
                name        = u.name,
                tel         = tel,
                level       = u.level,
                range       = u.range,
                region      = u.region,
                pwd         = u.pwd,
                auth_status = u.auth_status
            };

            SubmitDBChanges();

            return(r);
        }