Exemplo n.º 1
0
        public void InsertIntoTowns()
        {
            string countryName = inOut.ReadCoutryName();
            string townName    = inOut.ReadTownName();
            bool   isAdd       = insert.InsertIntoTowns(townName, countryName);

            if (isAdd == true)
            {
                inOut.PrintMessage(message.MessageInsertTownTrue(countryName, townName));
            }
            else
            {
                inOut.PrintMessage(message.MessageInsertTownFalse(countryName, townName));
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (radioButton1.Checked)
     {
         if (textBox1.Text != string.Empty)
         {
             bool isAdd = controler.InsertIntoCoutries(textBox1.Text);
             if (isAdd)
             {
                 MessageBox.Show(message.MessageInsertCoutryTrue(textBox1.Text));
             }
             else
             {
                 MessageBox.Show(message.MessageInsertCoutryFalse(textBox1.Text));
             }
         }
         else
         {
             MessageBox.Show(MessageApp.EnterCorrectValues);
         }
         Clear();
     }
     else if (radioButton2.Checked)
     {
         if (textBox1.Text != string.Empty && textBox2.Text != string.Empty)
         {
             bool isAdd = controler.InsertIntoTowns(textBox2.Text, textBox1.Text);
             if (isAdd)
             {
                 MessageBox.Show(message.MessageInsertTownTrue(textBox1.Text, textBox2.Text));
             }
             else
             {
                 MessageBox.Show(message.MessageInsertTownFalse(textBox1.Text, textBox2.Text));
             }
         }
         else
         {
             MessageBox.Show(MessageApp.EnterCorrectValues);
         }
         Clear();
     }
 }