Esempio n. 1
0
        public void CmdTabSelected(DevExpress.Xpf.Core.TabControlSelectionChangedEventArgs e)
        {
            try
            {
                if (e.NewSelectedIndex.Equals(1))
                {
                    GetUserInfo();

                    if (string.IsNullOrEmpty(userAccountNo.Trim()) || string.IsNullOrEmpty(userPhoneNumber.Trim()))
                    {
                        //idx = 0;
                        alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_25, 350);
                        alert.ShowDialog();
                    }
                    else
                    {
                        NoticePopup note = new Views.NoticePopup(NoticePopup.KindNotice.ReCharge);
                        note.Title = string.Format(Localization.Resource.NoticePopup_2, SC);
                        note.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
Esempio n. 2
0
        public void Loaded()
        {
            try
            {
                IsLoad = true;

                //if (idx.Equals(0))
                //{
                //    GetCardList();
                //    GetKrwRecharge(EnumLib.PaymentWay.prepaidCard);
                //}
                //else
                //{
                GetAccount();
                GetKrwRecharge(EnumLib.PaymentWay.accountTransfer);

                GetUserInfo();

                if (string.IsNullOrEmpty(userAccountNo.Trim()) || string.IsNullOrEmpty(userPhoneNumber.Trim()))
                {
                    //idx = 0;
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_25, 350);
                    alert.ShowDialog();
                }
                else
                {
                    NoticePopup note = new Views.NoticePopup(NoticePopup.KindNotice.ReCharge);
                    note.Title = string.Format(Localization.Resource.NoticePopup_2, SC);
                    note.ShowDialog();
                }

                //}

                RepeatTimer.Start();

                if (LoginViewModel.LanguagePack.IndexOf("ko") > 0)
                {
                    langVisible = Visibility.Visible;
                }
                else
                {
                    langVisible = Visibility.Collapsed;
                }

                //if (string.IsNullOrEmpty(userAccountNo.Trim()) || string.IsNullOrEmpty(userPhoneNumber.Trim()))
                //{
                //    idx = 0;
                //}
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
Esempio n. 3
0
        //로그인 Command
        public async void Login()
        {
            try
            {
                if (IsMaintenance)
                {
                    return;
                }

                if (TempUserName != UserName)
                {
                    TempUserName     = UserName;
                    LoginSubmitCount = 0;
                    LoginSubmitCheck = true;
                }

                if (LoginSubmitCount == 5 && LoginSubmitCheck)
                {
                    using (RequestLoginFailModel req = new RequestLoginFailModel())
                    {
                        req.userEmail = UserName;

                        using (ResponseLoginFailModel res = await WebApiLib.AsyncCall <ResponseLoginFailModel, RequestLoginFailModel>(req))
                        {
                            LoginSubmitCount = 0;
                            LoginSubmitCheck = false;
                            Alert alert = new Alert(Localization.Resource.Login_4, 400);
                            alert.ShowDialog();
                            return;
                        }
                    }
                }

                if (string.IsNullOrWhiteSpace(UserName))
                {
                    Alert alert = new Alert(Localization.Resource.Login_5);
                    alert.ShowDialog();
                    return;
                }
                if (string.IsNullOrWhiteSpace(Password))
                {
                    Alert alert = new Alert(Localization.Resource.Login_6);
                    alert.ShowDialog();
                    return;
                }

                #region ID 저장 Check

                if (IsCheck)
                {
                    ini.SetCheckID(UserName.Trim(), "Login", "ID");
                }
                else
                {
                    ini.SetCheckID(string.Empty, "Login", "ID");
                }

                ini.SetCheckID(SelectedLang.Lv, "Language", "Country");

                #endregion

                IsBusy = true;

                Dictionary <string, string> dict = null;

                using (RequestPublicKeyModel req = new RequestPublicKeyModel())
                {
                    using (ResponsePublicKeyModel res = WebApiLib.SyncCall <ResponsePublicKeyModel, RequestPublicKeyModel>(req))
                    {
                        //dict = EncodingLib.AesEncrypt(Password.Trim(), res.data.pubKeyModule, res.data.pubKeyExponent);
                        dict = EncodingLib.AesEncryptKey(res.data.pubKeyModule, res.data.pubKeyExponent);
                    }
                }

                if (dict.Count == 2)
                {
                    using (RequestLoginModel req = new RequestLoginModel())
                    {
                        req.userEmail = UserName.Trim();
                        req.userPwd   = EncodingLib.AesEncrypt(Password.Trim(), dict["gid"]);
                        req.clientPe  = dict["acekey"];
                        req.langCd    = SelectedLang.Lv.ToString().Split('-')[0];
                        req.regIp     = CommonLib.Client_IP;

                        using (ResponseLoginModel res = await WebApiLib.AsyncCall <ResponseLoginModel, RequestLoginModel>(req))
                        {
                            if (res.data.loginYn.Equals("Y"))
                            {
                                if (res.data.isIpFirst.Equals("Y"))
                                {
                                    Views.NoticePopup note = new Views.NoticePopup(NoticePopup.KindNotice.HTS_IP_CHECK_1);
                                    note.Title = Localization.Resource.NoticePopup_3;
                                    if (note.ShowDialog() == true)
                                    {
                                        note       = new Views.NoticePopup(NoticePopup.KindNotice.HTS_IP_CHECK_2);
                                        note.Title = Localization.Resource.NoticePopup_3;
                                        note.ShowDialog();

                                        IsLoginView = Visibility.Collapsed;
                                        Messenger.Default.Send(res.data);
                                    }
                                    else
                                    {
                                        //IP삭제
                                        using (RequestIpRegModel req2 = new RequestIpRegModel())
                                        {
                                            req2.userEmail = UserName.Trim();
                                            req2.ip        = res.data.regIp;
                                            req2.limtHr    = 0;
                                            using (ResponseIpRegModel res2 = await WebApiLib.AsyncCall <ResponseIpRegModel, RequestIpRegModel>(req2))
                                            {
                                                //IP삭제 완료
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    IsLoginView = Visibility.Collapsed;
                                    Messenger.Default.Send(res.data);
                                }
                            }
                            else
                            {
                                IsBusy = false;
                                if (res.resultMsg != null)
                                {
                                    if (res.data.lockYn == "Y")
                                    {
                                        Alert alert = new Alert("[" + Localization.Resource.Login_20 + "]" + "\n" + Localization.Resource.Login_18 + "\n" + Localization.Resource.Login_19, 460, 180);
                                        if (alert.ShowDialog() == true)
                                        {
                                            using (RequestPwdChangeModel req2 = new RequestPwdChangeModel())
                                            {
                                                req2.userEmail = UserName.Trim();

                                                using (ResponsePwdChagneModel res2 = WebApiLib.SyncCall <ResponsePwdChagneModel, RequestPwdChangeModel>(req2))
                                                {
                                                    if (res2.resultStrCode == "000")
                                                    {
                                                        alert = new Alert(Localization.Resource.Login_23, 330);
                                                        alert.ShowDialog();
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.notExistPassword)))
                                        {
                                            LoginSubmitCount++;
                                            if (LoginSubmitCount == 5)
                                            {
                                                LoginSubmitCheck = true;
                                            }
                                            Alert alert = new Alert(string.Format(Localization.Resource.Login_24, LoginSubmitCount) + "\n" + Localization.Resource.Login_25, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.blockID)))
                                        {
                                            LoginSubmitCount = 0;
                                            LoginSubmitCheck = false;

                                            Alert alert = new Alert(Localization.Resource.Login_4, 400);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.userEmailFail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_11, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.userPasswordFail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_12, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.notExistEmail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_13, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.NotRegIP)))
                                        {
                                            NoticePopup note = new NoticePopup(NoticePopup.KindNotice.HTS_IP_NOT_CHECK_1);
                                            note.Title = Localization.Resource.NoticePopup_4;
                                            NoticePopupViewModel.UserName = UserName.Trim();
                                            if (note.ShowDialog() == true)
                                            {
                                                IpRegisterViewModel.regIp     = res.data.regIp;
                                                IpRegisterViewModel.userEmail = UserName.Trim();
                                                IpRegister ip = new IpRegister();
                                                ip.ShowDialog();
                                            }
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.NotUseID)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_16, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.loginFailCode)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_17, 350);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.ReSettingPW)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_21, 300, 140, Localization.Resource.Login_22);
                                            if (alert.ShowDialog() == true)
                                            {
                                                using (RequestPwdChangeModel req2 = new RequestPwdChangeModel())
                                                {
                                                    req2.userEmail = UserName.Trim();

                                                    using (ResponsePwdChagneModel res2 = WebApiLib.SyncCall <ResponsePwdChagneModel, RequestPwdChangeModel>(req2))
                                                    {
                                                        if (res2.resultStrCode == "000")
                                                        {
                                                            alert = new Alert(Localization.Resource.Login_23, 330);
                                                            alert.ShowDialog();
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_17, 350);
                                            alert.ShowDialog();
                                        }
                                    }
                                }
                                else
                                {
                                    Alert alert = new Alert(Localization.Resource.Login_7, 320);
                                    alert.ShowDialog();
                                }
                            }
                        }
                    }
                }
                else
                {
                    Alert alert = new Alert(Localization.Resource.Login_8, Alert.ButtonType.Ok);
                    alert.ShowDialog();
                }

                IsBusy = false;
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                IsBusy = false;

                Alert alert = new Alert(Localization.Resource.Login_9, Alert.ButtonType.Ok);
                alert.ShowDialog();
            }
            finally
            {
                IsBusy = false;
            }
        }