Esempio n. 1
0
 private void Button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Visible)
     {
         Data_book_form main      = this.Owner as Data_book_form;
         string         Data_book = main.Get_current_book();
         string         New_code  = textBox1.Text;
         New_code = New_code.Replace(" ", "_");
         if (String.IsNullOrEmpty(textBox1.Text))
         {
             errorProvider1.SetError(button1, "Код не может быть пустым");
         }
         else if (Library_main.Main_library.Proof_Code(New_code))
         {
             errorProvider1.SetError(button1, "Такой код уже существует");
         }
         else
         {
             errorProvider1.Clear();
             Library_main.Main_library.New_code_book(Data_book, New_code);
             this.Close();
         }
     }
     else
     {
         this.Close();
     }
 }
Esempio n. 2
0
        private void Button_more_Click(object sender, EventArgs e)
        {
            Data_book_form Form2 = new Data_book_form();

            Form2.Owner = this;
            Form2.ShowDialog();
            Form_Update();
        }