Пример #1
0
        public string Login(string phoneNumber, string password)
        {
            IMeiWei.BLL.user   bll_user   = new IMeiWei.BLL.user();
            IMeiWei.Model.user model_user = new IMeiWei.Model.user();
            string             result     = string.Empty;

            model_user = bll_user.GetModelList(" phoneNumber = '" + phoneNumber + "'").FirstOrDefault();

            if (null != model_user)
            {
                if (model_user.Password != password)
                {
                    result = "PASSWORD_ERROR";
                }
                else
                {
                    string tokenId = Guid.NewGuid().ToString();
                    //Session.Add(tokenId, phoneNumber);
                    result = tokenId;
                }
            }
            else
            {
                result = "USERNAME_ERROR";
            }

            var js = GenJSSerializer();

            return(js.Serialize(result));
        }
Пример #2
0
        public string Login(string phoneNumber, string password)
        {
            IMeiWei.BLL.user   bll_user   = new IMeiWei.BLL.user();
            IMeiWei.Model.user model_user = new IMeiWei.Model.user();

            model_user = bll_user.GetModelList(" phoneNumber = '" + phoneNumber + "'").FirstOrDefault();

            if (null != model_user)
            {
                if (model_user.Password != password)
                {
                    return("PASSWORD_ERROR");
                }
                else
                {
                    string tokenId = Guid.NewGuid().ToString();
                    Session.Add(tokenId, phoneNumber);
                    return(tokenId);
                }
            }
            else
            {
                return("USERNAME_ERROR");
            }
        }
Пример #3
0
        public string GetUserInfo()
        {
            var js = GenJSSerializer();

            IMeiWei.BLL.user bll_user = new IMeiWei.BLL.user();

            var models = bll_user.GetModelList("1=1");

            return(js.Serialize(models));
        }
Пример #4
0
        public string Registration(string phoneNumber, string password, string securityNumber, string userName)
        {
            IMeiWei.BLL.user          bll_user        = new IMeiWei.BLL.user();
            IMeiWei.Model.user        model_user      = new IMeiWei.Model.user();
            List <IMeiWei.Model.user> old_model_users = new List <IMeiWei.Model.user>();

            old_model_users = bll_user.GetModelList(" phoneNumber = '" + phoneNumber + "'");

            if (null != old_model_users && old_model_users.Count > 0)
            {
                return("DUPLICATE");
            }

            model_user.IsActive     = false;
            model_user.Password     = password;
            model_user.SecurityCode = securityNumber;
            model_user.UserName     = userName;
            model_user.UserStatusId = 1;
            model_user.PhoneNumber  = phoneNumber;

            bll_user.Add(model_user);

            return("SUCCESS");
        }