コード例 #1
0
 private void TextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     if (LoginTxt.Text == "Login")
     {
         LoginTxt.Clear();
     }
 }
コード例 #2
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            int?employeeID = Int32.TryParse(LoginTxt.Text, out var tempVal) ? tempVal : (int?)null;

            db.Login(employeeID);
            string           employeeFirst = db.Employees.Find(employeeID).FirstName;
            MessageBoxResult result        = MessageBox.Show("Successfully Logged " + employeeFirst + " In", "Confirmation", MessageBoxButton.OK);

            LoginTxt.Clear();
            LoginGrid.Visibility = Visibility.Hidden;
        }
コード例 #3
0
        private void label6_Click(object sender, EventArgs e)

        {
            try
            {
                Admins admin = new Admins(LoginTxt.Text, PassTxt.Text, FIOTxt.Text, OrTXT.Text, Emailtxt.Text);
                admins.Add(admin);
                XmlSerializer serializer = new XmlSerializer(typeof(List <Admins>));

                StreamWriter writer = new StreamWriter(pathAdmin);
                serializer.Serialize(writer, admins);
                writer.Close();
                LoginTxt.Clear();
                PassTxt.Clear();
                FIOTxt.Clear();
                OrTXT.Clear();
                Emailtxt.Clear();
                MessageBox.Show("Вы зарегистрированы");
                panelReg.Visible = false;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }