Exemplo n.º 1
0
        private void btnLogin1_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists("Data.txt") == true && txtFirstName.Text != "" && txtLastName.Text != " " && txtAge.Text != "")
            {
                MessageBox.Show($"{txtFirstName.Text} {txtLastName.Text} {txtAge.Text}", "Запись создана успешно!");
                SaveFileClass.FileWriteLine($"{(File.ReadLines("Data.txt").Count()) + 1}@{txtFirstName.Text}@{txtLastName.Text}@{txtAge.Text}", "Data.txt");
                txtFirstName.Text = "";
                txtLastName.Text  = "";
                txtAge.Text       = "";

                WorkWin workwin = new WorkWin();
                this.Hide();
                workwin.ShowDialog();
                this.Show();
            }
            else
            {
                MessageBox.Show("Все поля должны быть заполнены!");
            }
            //else
            //{
            //    MessageBox.Show($"{txtFirstName.Text} {txtLastName.Text} {txtAge.Text}", "Запись создана успешно!");
            //    SaveFileClass.FileWriteLine($"{txtFirstName.Text} {txtLastName.Text} {txtAge.Text}", "Data.txt");
            //}
        }
Exemplo n.º 2
0
        private void btnClose1_Click(object sender, RoutedEventArgs e)
        {
            WorkWin workwin = new WorkWin();

            this.Hide();
            workwin.ShowDialog();
            this.Show();
        }