예제 #1
0
        // DELEGATE PART :: BEGIN
        void BarcodeClick(object sender, EventArgs e) // ปุ่ม Scan Barcode
        {
            GF.selected_id         = 0;
            code.Text              = "";
            item_name.Text         = "";
            item_cat.SelectedIndex = 0;

            if (btn_dgv.refresh_btn.Text == "SEARCH BY BARCODE")
            {
                barcodeItemID = -1;
                using (scan_barcode scan = new scan_barcode())
                {
                    scan.Mode  = "PRODUCT";
                    scan.Owner = this;
                    scan.ShowDialog();
                }
                if (barcodeItemID != -1)
                {
                    btn_dgv.refresh_btn.Text = "CLEAR RESULT";
                }
            }
            else if (btn_dgv.refresh_btn.Text == "CLEAR RESULT")
            {
                barcodeItemID            = -1;
                btn_dgv.refresh_btn.Text = "SEARCH BY BARCODE";
                loadGridData();
            }
        }
예제 #2
0
 private void approve_scan_btn_Click(object sender, EventArgs e)
 {
     using (scan_barcode scan = new scan_barcode())
     {
         scan.Mode  = "APPROVER";
         scan.Owner = this;
         scan.ShowDialog();
         int tmpID = approve_id;
         foreach (ComboItem items in approved_by.Items)
         {
             if (items.Key == approve_id)
             {
                 approved_by.Text = items.Value;
                 break;
             }
         }
         approve_id = tmpID;
     }
 }