Пример #1
0
        public void AppLoginTapped(object sender, TappedRoutedEventArgs args)
        {
            InvalidPassword = false;
            SlideDistance   = Window.Current.Bounds.Height * -1;
            if (!string.IsNullOrWhiteSpace(Password) &&
                !string.IsNullOrWhiteSpace(PwdBox.Password) &&
                PwdBox.Password == Password)
            {
                InvalidPassword    = false;
                IsHideAppLockPanel = true;
                PwdBox.Password    = string.Empty;
                //키보드 Hide
                PwdBox.IsEnabled = false;

                if (LoginSucceed != null)
                {
                    LoginSucceed(this, new EventArgs());
                }
            }
            else
            {
                InvalidPassword = true;
                PwdBox.Focus(FocusState.Programmatic);
            }
        }
Пример #2
0
 /// <summary>
 /// Function to be executed when the password box loses focus.
 /// Basic fuction is to show the watermark in the password box.
 /// </summary>
 /// <param name="sender">object</param>
 /// <param name="e">RoutedEventArgs</param>
 private void PasswordBox_GotFocus(object sender, RoutedEventArgs e)
 {
     PasswordWatermark.Opacity = 0;
     PwdBox.Opacity            = 100;
     if (!string.IsNullOrEmpty(PwdBox.Password))
     {
         PwdBox.SelectAll();
     }
 }
Пример #3
0
 //아이디 입력 후 엔터
 private void enterKey(object sender, KeyEventArgs e)
 {
     id = IDBox.Text.ToString();
     if (e.KeyCode == Keys.Enter)
     {
         if (IDBox.Text.ToString().Equals(""))
         {
             IDBox.Focus();
             MessageBox.Show("아이디를 입력해 주세요");
         }
         else
         {
             PwdBox.Focus();
         }
     }
 }
 private void ClearPassword()
 {
     PwdBox.Clear();
     ElsePwdBox.Clear();
 }
Пример #5
0
        private void loginOk1()
        {
            id  = IDBox.Text.ToString();
            pwd = PwdBox.Text.ToString();
            if (PwdBox.Text.ToString().Equals(""))
            {
                IDBox.Focus();
                MessageBox.Show("아이디를 입력해 주세요");
            }
            else if (IDBox.Text.ToString().Equals(""))
            {
                PwdBox.Focus();
                MessageBox.Show("비밀번호를 입력해 주세요");
            }
            else
            {
                string url = "https://daemuri.net/main/getSendAuth.do?id=" + id + "&pwd=" + pwd;
                //string url = "http://127.0.0.1:8080/main/getSendAuth.do?id=" + id + "&pwd=" + pwd;
                try
                {
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                    request.Method      = "POST";
                    request.ContentType = "Application/json;charset=utf-8";

                    string sendData = "";

                    byte[] buffer;
                    buffer = Encoding.Default.GetBytes(sendData);
                    request.ContentLength = buffer.Length;
                    Stream sendStream = request.GetRequestStream();
                    sendStream.Write(buffer, 0, buffer.Length);
                    sendStream.Close();

                    HttpWebResponse response       = (HttpWebResponse)request.GetResponse();
                    Stream          respPostStream = response.GetResponseStream();
                    StreamReader    readerPost     = new StreamReader(respPostStream, Encoding.UTF8);

                    string resultJson = readerPost.ReadToEnd();
                    if (!resultJson.Contains("<!DOCTYPE html"))
                    {
                        JObject obj = new JObject();
                        obj = JObject.Parse(resultJson);
                        string rs = obj["rs"].ToString();

                        if (rs.Equals("fail"))
                        {
                            MessageBox.Show("등록된 사용자가 아닙니다.");
                            this.Height = 218;
                        }
                        else
                        {
                            JObject obj2 = new JObject();
                            obj2           = JObject.Parse(rs);
                            callcenter_idx = obj2["callcenter_idx"].ToString();
                            //MessageBox.Show("callcenter_idx = " + callcenter_idx);
                            CidBox.Visible  = true;
                            button3.Visible = true;
                            CidBox.Focus();
                            this.Height = 335;
                        }
                    }
                    else
                    {
                        MessageBox.Show("등록된 사용자가 아닙니다.");
                        this.Height = 217;
                    }
                }
                catch (System.Net.WebException er)
                {
                    MessageBox.Show(er.Message);
                }
            }
        }
Пример #6
0
 private void CancelButtonClicked(object sender, RoutedEventArgs e)
 {
     addEditStudentsViewModel.Reset();
     PwdBox.Clear();
 }
Пример #7
0
 private void AddButtonClicked(object sender, RoutedEventArgs e)
 {
     addEditStudentsViewModel.CommitStudent();
     PwdBox.Clear();
 }
Пример #8
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            ChangePasswordGrid.Height   = Window.Current.Bounds.Height;
            ChangePasswordGrid.Width    = Window.Current.Bounds.Width;
            Window.Current.SizeChanged += (sender, args) =>
            {
                ChangePasswordGrid.Height = Window.Current.Bounds.Height;
                ChangePasswordGrid.Width  = Window.Current.Bounds.Width;
            };
            var data = DataContext as LoginPageViewModel;

            EmailBox.KeyUp += (sender, args) =>
            {
                if (args.Key == VirtualKey.Enter)
                {
                    if (data != null)
                    {
                        EmailBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
                        if (data.IsLogin)
                        {
                            LoginBtn.Command.Execute(null);
                        }
                        else if (data.IsResetPassword)
                        {
                            ResetPwdBtn.Command.Execute(null);
                        }
                    }
                }
            };

            PwdBox.KeyUp += (sender, args) =>
            {
                if (args.Key == VirtualKey.Enter)
                {
                    if (data != null)
                    {
                        PwdBox.GetBindingExpression(PasswordBox.PasswordProperty).UpdateSource();
                        if (data.IsLogin)
                        {
                            LoginBtn.Command.Execute(null);
                        }
                        else if (data.IsResetPassword)
                        {
                            ResetPwdBtn.Command.Execute(null);
                        }
                    }
                }
            };

            NewPwdBox.KeyUp += (sender, args) =>
            {
                if (args.Key == VirtualKey.Enter)
                {
                    if (data != null && data.ShowChangePasswordPopup)
                    {
                        NewPwdBox.GetBindingExpression(PasswordBox.PasswordProperty).UpdateSource();
                        ChangePwdBtn.Command.Execute(null);
                    }
                }
            };
            PwdConfirmBox.KeyUp += (sender, args) =>
            {
                if (args.Key == VirtualKey.Enter)
                {
                    if (data != null && data.ShowChangePasswordPopup)
                    {
                        PwdConfirmBox.GetBindingExpression(PasswordBox.PasswordProperty).UpdateSource();
                        ChangePwdBtn.Command.Execute(null);
                    }
                }
            };
        }
 private void BtnOk_Click(object sender, RoutedEventArgs e)
 {
     HashedPassword = Hasher.Hash(PwdBox.SecurePassword);
     PwdBox.Clear();
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     PwdBox.Focus();
 }