Ejemplo n.º 1
0
        private void DataBaseButton_Click(object sender, EventArgs e)
        {
            home home = new home();

            if (jezyk_pol == false)
            {
                home.lang = 1;
                home.comboBox1.Items[0]     = "Link Budget";
                home.comboBox1.Items[1]     = "Materials";
                home.comboBox1.Items[2]     = "Antennas";
                home.comboBox1.Items[3]     = "Devices";
                home.comboBox1.Items[4]     = "Cables";
                home.comboBox1.Items[5]     = "Connectors";
                home.comboBox1.SelectedItem = "Antennas";
            }
            else
            {
                home.lang = 0; home.comboBox1.SelectedItem = "Anteny";
            }
            home.ShowDialog();
        }
Ejemplo n.º 2
0
 private void btn_ok_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count > 0)
     {
         clearModel();
         for (int i = 0; i < dataGridView1.Rows.Count; i++)
         {
             VoidModel.item_name.Add(dataGridView1.Rows[i].Cells["cal_item_name"].Value.ToString());
             VoidModel.qty.Add(dataGridView1.Rows[i].Cells["cal_qty"].Value.ToString());
             VoidModel.total.Add(dataGridView1.Rows[i].Cells["cal_total"].Value.ToString());
             VoidModel.cost.Add(dataGridView1.Rows[i].Cells["cal_cost"].Value.ToString());
             VoidModel.category_name.Add(dataGridView1.Rows[i].Cells["cal_category_name"].Value.ToString());
             VoidModel.kot_type.Add(dataGridView1.Rows[i].Cells["calkot_print"].Value.ToString());
             if (orderstatus == "HD")
             {
                 if (dataGridView1.Rows[i].Cells["cal_order_id"].Value == null)
                 {
                     int insert_order = blord.insertorder_using_sp(Login.sendtext, Convert.ToDecimal(home_delivery_id), VoidModel.item_name[i], Convert.ToDecimal(dataGridView1.Rows[i].Cells["cal_qty"].Value), Convert.ToDecimal(dataGridView1.Rows[i].Cells["cal_total"].Value), Convert.ToDecimal(dataGridView1.Rows[i].Cells["cal_cost"].Value), "HD", VoidModel.category_name[i], VoidModel.kot_type[i], "HD", service_provider_name.ToString(), kot_id);
                     if (insert_order > 0)
                     {
                         if (Convert.ToDecimal(home_delivery_id) >= 106)
                         {
                             if (Convert.ToDecimal(home_delivery_id) < 1000)
                             {
                                 int hd_no       = blhd.inserthomedeleveryid(Convert.ToInt32(home_delivery_id));
                                 int customer_id = HomeDeliveryModel.customer_id;
                                 if (customer_id > 0)
                                 {
                                     int insertCustomerid = blcdn.insertHomeDeliveryCustomer(customer_id.ToString(), home_delivery_id);
                                 }
                             }
                         }
                     }
                     if (dataGridView1.Rows[i].Cells["calkot_print"].Value.ToString() == "K1")
                     {
                         kot_printer_1 = true;
                     }
                     if (dataGridView1.Rows[i].Cells["calkot_print"].Value.ToString() == "K2")
                     {
                         kot_printer_2 = true;
                     }
                     if (dataGridView1.Rows[i].Cells["calkot_print"].Value.ToString() == "B1")
                     {
                         kot_printer_3 = true;
                     }
                 }
             }
         }
         if (orderstatus == "HD")
         {
             kot_printChecker();
             // this.Close();
             if (Application.OpenForms.OfType <home>().Count() == 1)
             {
                 Application.OpenForms.OfType <home>().First().Close();
             }
             home h = new home(home_delivery_id);
             h.ShowDialog();
         }
         this.Hide();
     }
     else
     {
         clearModel();
         this.Hide();
     }
 }