예제 #1
0
        private void notifyIcon1_Click(object sender, EventArgs e)
        {
            Frm_Hold fh = new Frm_Hold();

            fh.ShowDialog();
        }
예제 #2
0
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            fh.ShowDialog();


            if (fh.gridView2.RowCount > 0)
            {
                btn_update.Show();
                gridControl2.Enabled = true;



                rdb_sala.Enabled     = false;
                rdb_takeaway.Enabled = false;

                btn_update.Show();



                txt_delivery.Show();

                cmb_delivery.Enabled = false;
                btn_update.Enabled   = true;

                flowLayoutPanel1.Enabled = true;
                flowLayoutPanel2.Enabled = true;
                txt_discount.Enabled     = true;


                if (fh.gridView2.GetFocusedRowCellValue("نوع الطلب").ToString() == "Delivery")
                {
                    rdb_delivery.Checked = true;
                    //cmb_customer.Hide();
                    //textEdit1.Show();

                    //textEdit1.Enabled = false;
                    //rdb_clientsave.Enabled = false;
                    //rdb_newclient.Enabled = false;


                    //txt_phones.Enabled = false;
                    //txt_address.Enabled = false;
                    grb_customer.Show();
                    grb_delivry.Show();
                    grb_customer.Enabled = false;
                    dt2.Clear();
                    dt2 = o.SELECTOrderDetails(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));

                    gridControl2.DataSource = dt2;

                    ID_Dep.Visible   = false;
                    Dep.Visible      = false;
                    ID_Items.Visible = false;


                    dt5.Clear();
                    dt5 = o.SELECTOrder(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));

                    foreach (DataRow dr in dt5.Rows)
                    {
                        Lable_Num.Text   = dr[0].ToString();
                        txt_cust.Text    = dr[1].ToString();
                        textEdit1.Text   = dr[2].ToString();
                        txt_phones.Text  = dr[3].ToString();
                        txt_address.Text = dr[4].ToString();
                        lable_date.Text  = dr[5].ToString();

                        texT.Text = dr[6].ToString();

                        cmb_delivery.Text = dr[9].ToString();
                        txt_delivery.Text = dr[10].ToString();
                        txt_discount.Text = dr[11].ToString();
                    }
                }
                else if (fh.gridView2.GetFocusedRowCellValue("نوع الطلب").ToString() == "Table")
                {
                    cmb_stuff.Enabled = true;

                    //  rdb_delivery.Enabled = false;
                    //    cmb_delivery.Enabled = false;
                    //   txt_delivery.Enabled = false;
                    //  txt_phones.Enabled = false;
                    //  textEdit1.Enabled = false;
                    rdb_sala.Enabled = true;
                    //textEdit1.Enabled = false;
                    rdb_sala.Checked = true;
                    //  cmb_Table.Enabled = false;
                    grb_sala.Show();
                    grb_sala.Enabled = false;

                    dt2.Clear();
                    dt2 = o.SELECTOrderDetails(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));

                    gridControl2.DataSource = dt2;
                    ID_Items.Visible        = false;
                    Dep.Visible             = false;
                    ID_Items.Visible        = false;

                    dt5.Clear();
                    dt5 = o.SELECTOrderSala(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));
                    foreach (DataRow dr in dt5.Rows)
                    {
                        Lable_Num.Text = dr[0].ToString();
                        txt_cust.Text  = dr[1].ToString();
                        textEdit1.Text = dr[2].ToString();

                        lable_date.Text = dr[3].ToString();


                        texT.Text = dr[4].ToString();
                        //txt_pay.Text = dr[5].ToString();
                        //txt_mark.Text = dr[6].ToString();
                        // cmb_Table.Text = dr[7].ToString();
                        cmb_Table.Text    = dr[7].ToString();
                        txt_discount.Text = dr[8].ToString();
                        cmb_stuff.Text    = dr[9].ToString();
                    }
                }
                else if (fh.gridView2.GetFocusedRowCellValue("نوع الطلب").ToString() == "Take away")
                {
                    //   rdb_delivery.Enabled = false;
                    rdb_takeaway.Checked = true;
                    rdb_takeaway.Enabled = true;
                    // txt_phones.Enabled = false;
                    // textEdit1.Enabled = false;
                    //   cmb_customer.Hide();
                    //  textEdit1.Show();
                    //textEdit1.Enabled = false;
                    grb_customer.Show();
                    grb_delivry.Hide();
                    grb_customer.Enabled = false;

                    dt2.Clear();
                    dt2 = o.SELECTOrderDetails(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));
                    gridControl2.DataSource = dt2;
                    ID_Items.Visible        = false;
                    Dep.Visible             = false;
                    ID_Items.Visible        = false;
                    dt5.Clear();
                    dt5 = o.SELECTOrderTakwAway(Convert.ToInt32(fh.gridView2.GetFocusedRowCellValue("رقم الفاتورة")));

                    foreach (DataRow dr in dt5.Rows)
                    {
                        Lable_Num.Text = dr[0].ToString();
                        txt_cust.Text  = dr[1].ToString();
                        textEdit1.Text = dr[2].ToString();

                        lable_date.Text = dr[3].ToString();

                        texT.Text = dr[4].ToString();

                        txt_discount.Text = dr[7].ToString();
                    }
                }
                totalInvoice();
                TOTALFINALYDELIVERY();
                TOTALFINALYDISCOUNT();
            }
        }