Esempio n. 1
0
        public Response ExistsByPhone(string phone, string pwd)
        {
            Response res = new Response();

            DaoUserInfo dao = new DaoUserInfo();
            if (dao.ExistsByPhone(phone, pwd))
            {
                res.Code = ResCode.SUCCESS;
                res.Data = dao.SelectByPhonePwd(phone, pwd);
            }
            else
            {
                res.Code = ResCode.ERRACCOUNTPWD;
                res.Msg = ResCode.STRERRACCOUNTPWD;
            }
            return res;
        }
Esempio n. 2
0
        public Response RegisterUserByPhone(string phone, string pwd,string verifyCode)
        {
            Response res = new Response();
            DaoVerifyCode dao = new DaoVerifyCode();
            if (dao.Exists(phone, verifyCode))
            {
                DaoUserInfo daou = new DaoUserInfo();
                if (daou.ExistsByPhone(phone))
                {
                    res.Code = ResCode.USERALREADYEXISTS;
                    res.Msg = ResCode.STRUSERALREADYEXISTS;
                    return res;
                }
                if (daou.Insert(phone, pwd))
                {
                    string voip = GenerateVoipInfo(phone);
                    if (voip != null && voip.Length > 0)
                    {
                        res.Code = ResCode.SUCCESS;
                        res.Data = daou.SelectByPhonePwd(phone, pwd);
                    }
                    else
                    {
                        res.Code = ResCode.ERRGENERATEVOIP;
                        res.Msg = ResCode.STRERRGENERATEVOIP;
                    }
                }
                else
                {
                    res.Code = ResCode.ERRREGISTERWRITEDB;
                    res.Msg = ResCode.STRERRREGISTERWRITEDB;
                }
            }
            else
            {
                res.Code = ResCode.ERRVERIFYCODE;
                res.Msg = ResCode.STRERRVERIFYCODE;
            }

            return res;
        }