Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if ((ORDER.Id_Kvit_Last() == OPLATA.Id_Kvit()) || (comboBox3.SelectedItem.ToString() != comboBox2.SelectedItem.ToString()))
            {
                MessageBox.Show("Оплата заказ не был оплачен!");
            }
            else
            {
                if ((textBox4.Text == "") || (textBox5.Text == "") || (textBox6.Text == "") || (comboBox2.SelectedIndex == -1))
                {
                    MessageBox.Show("Одно из обязательных полей не заполнено");
                }
                else
                {
                    if ((textBox11.Text.Contains("@")) && (textBox11.Text.Contains(".")))
                    {
                        String FAMILY = textBox4.Text;
                        String NAME   = textBox5.Text;
                        String OT     = textBox6.Text;
                        try
                        {
                            int id = CLIENT_INFO.Get_id(FAMILY, NAME, OT);
                            ORDER.Insert(Convert.ToInt32(comboBox2.SelectedItem.ToString()), OPLATA.Id_Kvit(), id);
                        }
                        catch (Exception e2)
                        {
                            if ((textBox11.Text == ""))
                            {
                                MessageBox.Show(" Поле email не заполнено");
                            }
                            else
                            {
                                CLIENT.Insert();
                                CLIENT_INFO.Insert(FAMILY, NAME, OT, textBox11.Text);
                            }
                            int id = CLIENT_INFO.Get_id(FAMILY, NAME, OT);
                            ORDER.Insert(Convert.ToInt32(comboBox2.SelectedItem.ToString()), OPLATA.Id_Kvit(), id);
                        }

                        MessageBox.Show("Заказ успешно оформлен");
                    }
                    else
                    {
                        MessageBox.Show("Некорректный ввод Email ");
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void admin_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < ORDER.Id_Zakaza().Count; i++)
            {
                comboBox2.Items.Add(Convert.ToString(ORDER.Id_Zakaza()[i].ID_ZAKAZA));
            }


            for (int i = 0; i < CLIENT_INFO.GET_INFO().Count; i++)
            {
                listView2.Items.Add(Convert.ToString(CLIENT_INFO.GET_INFO()[i].ID_CLIENT));
                listView2.Items[i].SubItems.Add(CLIENT_INFO.GET_INFO()[i].FAMILY);
                listView2.Items[i].SubItems.Add(CLIENT_INFO.GET_INFO()[i].NAME);
                listView2.Items[i].SubItems.Add(CLIENT_INFO.GET_INFO()[i].OTCHESTVO);
                listView2.Items[i].SubItems.Add(CLIENT_INFO.GET_INFO()[i].EMAIL);
            }
        }
Exemplo n.º 3
0
 private void button7_Click(object sender, EventArgs e)
 {
     try
     {
         int id = 0;
         if (String.IsNullOrEmpty(textBox5.Text))
         {
             string family    = textBox6.Text;
             string name      = textBox7.Text;
             string otchestvo = textBox8.Text;
             id = CLIENT_INFO.Get_id(family, name, otchestvo);
         }
         else
         {
             id = Convert.ToInt32(textBox5.Text);
         }
         List <int> y   = ORDER.NAL(id);
         int        nal = 0;
         foreach (int item in y)
         {
             if (item != 0)
             {
                 nal = 1;
             }
         }
         if (nal == 1)
         {
             textBox9.Text = "заказ выполнен";
         }
         else
         {
             textBox9.Text = "отсутствует";
         }
         textBox10.Text = CLIENT_INFO.GET_DATE(id);
         textBox11.Text = Convert.ToString(CLIENT_INFO.GET_COUNTER_ZAKAZOV(id));
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }