Example #1
0
 //Нажатие на кнопку "Добавить"
 private void Accept_btm_Click(object sender, EventArgs e)
 {
     //Если поля заполнены
     if (txtContry.TextLength > 0 &&
         txtEmail.TextLength > 0 &&
         txtHouse.TextLength > 0 &&
         txtOfficeName.TextLength > 0 &&
         txtRegion.TextLength > 0 &&
         txtStreet.TextLength > 0 &&
         txtTown.TextLength > 0 &&
         txtWeb.TextLength > 0)
     {
         MobilShopTownOffice office = new MobilShopTownOffice();
         //Заполняем
         office.Country = txtContry.Text;
         office.Email   = txtEmail.Text;
         office.House   = txtHouse.Text;
         office.Name    = txtOfficeName.Text;
         office.Region  = txtRegion.Text;
         office.Street  = txtStreet.Text;
         office.Town    = txtTown.Text;
         office.Web     = txtWeb.Text;
         //Добавляем
         BdControler.AddOffice(office);
         //Закрываем
         Close();
     }
     //Если есть пустое поле
     else
     {
         MessageBox.Show("Не все поля заполнены!", "Поля не заполнены", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 //Нажатие на кнопку "Добавить"
 private void Accept_btm_Click(object sender, EventArgs e)
 {
     //Если поля заполнены
     if (txtBoss.TextLength > 0 &&
         txtEmail.TextLength > 0 &&
         txtOfficeName.TextLength > 0 &&
         txtPhone.TextLength > 0 &&
         txtShopName.TextLength > 0)
     {
         MobilShop shop = new MobilShop();
         //Заполняем
         shop.BossName = txtBoss.Text;
         shop.Email    = txtEmail.Text;
         shop.Name     = txtShopName.Text;
         shop.Phone    = txtPhone.Text;
         //Добавляем
         BdControler.AddShopInOffice(txtOfficeName.Text, shop);
         //Закрываем
         Close();
     }
     //Если есть пустое поле
     else
     {
         MessageBox.Show("Не все поля заполнены!", "Поля не заполнены", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //Нажатие на кнопку "Удалить"
 private void DeleteBtm_Click(object sender, EventArgs e)
 {
     //Если поля заполнены
     if (txtProduct.TextLength > 0)
     {
         //Удаляем
         BdControler.deleteProduct(office, shop, txtProduct.Text);
         Close();
     }
     //Если есть пустое поле
     else
     {
         MessageBox.Show("Не все поля заполнены!", "Поля не заполнены", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //Нажатие на кнопку "Добавить"
 private void Accept_btm_Click(object sender, EventArgs e)
 {
     //Если поля заполнены
     if (numCost.Value > 0 &&
         numCount.Value > 0 &&
         txtInfo.TextLength > 0 &&
         txtName.TextLength > 0 &&
         txtPlace.TextLength > 0 &&
         BoxType.Text != "")
     {
         //Заполняем
         Product product = new Product(txtPlace.Text, txtInfo.Text, txtName.Text, (int)numCount.Value, (int)numCost.Value, BoxType.Text);
         //Добавляем
         BdControler.addProduct(office_name, shop_name, product);
         //Закрываем
         Close();
     }
     //Если есть пустое поле
     else
     {
         MessageBox.Show("Не все поля заполнены!", "Поля не заполнены", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //Обработчик закрытия промежуточных форм
 private void Signal(object sender, EventArgs e)
 {
     offices = new List <MobilShopTownOffice> (BdControler.GetOffices());
     update();
 }
 //Метод сохранения в БД
 public void save()
 {
     BdControler.save();
 }
 //Конструктор
 public mainControl()
 {
     BdControler.load();
     offices = new List <MobilShopTownOffice>(BdControler.GetOffices());
 }
Example #8
0
 //Метод удаления магазина
 public void deleteShop()
 {
     BdControler.deleteShop(office, shop.Name);
 }