Exemplo n.º 1
0
        private void captureAll(Keys key)
        {
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                    { 
                        displayBarcodeForm = new barcodeForm(this, globalConstants.NEW_REQUEST_ORDER);

                        displayBarcodeForm.Top = this.Top + 5;
                        displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                    }

                    displayBarcodeForm.Show();
                    displayBarcodeForm.WindowState = FormWindowState.Normal;
                    break;

                case Keys.F8:
                    //detailRequestOrderDataGridView.Focus();
                    rowcount = detailRequestOrderDataGridView.RowCount;
                    detailRequestOrderDataGridView.CurrentCell = detailRequestOrderDataGridView.Rows[rowcount - 1].Cells["productID"];
                    //addNewRow();
                    break;

                case Keys.F9:
                    saveButton.PerformClick();
                    break;

                case Keys.F11:
                    if (null == browseProdukForm || browseProdukForm.IsDisposed)
                        browseProdukForm = new dataProdukForm(globalConstants.NEW_REQUEST_ORDER, this);

                    browseProdukForm.Show();
                    browseProdukForm.WindowState = FormWindowState.Normal;
                    break;

                case Keys.Delete:
                    if (detailRequestOrderDataGridView.Rows.Count > 1)
                        if (detailRequestOrderDataGridView.ReadOnly == false)
                        {
                            if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                            {
                                deleteCurrentRow();
                                calculateTotal();
                            }
                        }
                    break;

                case Keys.Up:
                    SendKeys.Send("+{TAB}");
                    break;

                case Keys.Down:
                    SendKeys.Send("{TAB}");
                    break;
            }
        }
Exemplo n.º 2
0
        private void captureAll(Keys key)
        {
            int posindex = 0;
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    cashierHelpForm displayHelp = new cashierHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (originModuleID != globalConstants.COPY_NOTA)
                    { 
                        totalAfterDiscTextBox.Focus();
                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : DISPLAY BARCODE FORM");

                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        { 
                            displayBarcodeForm = new barcodeForm(this, globalConstants.CASHIER_MODULE);

                            displayBarcodeForm.Top = this.Top + 5;// - displayBarcodeForm.Height;
                            displayBarcodeForm.Left = this.Left + 5;// (Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;

                        //cashierDataGridView.Focus();
                    }
                    break;

                case Keys.F3:
                    if (originModuleID == 0)
                    {
                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : CREATE NEW INSTANCE [" + objCounter + "]");

                        cashierForm displayForm = new cashierForm(objCounter);
                        displayForm.Show();
                    }
                    break;

                case Keys.F4:
                    if (originModuleID != globalConstants.COPY_NOTA)
                    {
                        //MessageBox.Show("F4");
                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : DISPLAY PELANGGAN FORM");
                        if (null == browsePelangganForm || browsePelangganForm.IsDisposed)
                                browsePelangganForm = new dataPelangganForm(globalConstants.CASHIER_MODULE, this);

                        browsePelangganForm.Show();
                        browsePelangganForm.WindowState = FormWindowState.Normal;
                    }
                    break;

                case Keys.F5: // NOT USED
                    if (originModuleID != globalConstants.COPY_NOTA)
                        if (DialogResult.Yes == MessageBox.Show("HAPUS DATA DATA DI LAYAR ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                            clearUpScreen();
                    break;

                case Keys.F7: 
                    if (originModuleID == globalConstants.COPY_NOTA)
                        if (selectedsalesinvoice != "")
                            if (DialogResult.Yes == MessageBox.Show("REPRINT INVOICE ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                                reprintInvoice();
                    break;

                case Keys.F8: // USED
                    if (originModuleID != globalConstants.COPY_NOTA)
                    {
                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO ADD NEW ROW PRESSED");
                        //focus to row below
                        rowcount = cashierDataGridView.RowCount;
                        cashierDataGridView.CurrentCell = cashierDataGridView.Rows[rowcount - 1].Cells["productID"];
                        //if (rowcount > 1)
                        //{
                        //    posindex = cashierDataGridView.CurrentCell.RowIndex;
                        //    if (posindex < rowcount - 1)
                        //    {
                        //        cashierDataGridView.CurrentCell = cashierDataGridView.Rows[posindex + 1].Cells["productID"];
                        //    }
                        //}
                        //addNewRow();
                    }
                    break;

                case Keys.F9:
                    if (originModuleID != globalConstants.COPY_NOTA)
                    {
                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO SAVE AND PRINT OUT INVOICE PRESSED");

                        saveAndPrintOutInvoice();
                    }
                    break;

                case Keys.F11:
                    if (originModuleID != globalConstants.COPY_NOTA)
                    {
                        totalAfterDiscTextBox.Focus();

                        gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO OPEN PRODUK SEARCH FORM PRESSED");

                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                                browseProdukForm = new dataProdukForm(globalConstants.CASHIER_MODULE, this);

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;

                        //cashierDataGridView.Focus();
                    }
                    break;

                case Keys.Add:
                    bayarTextBox.Focus();
                    break;

                case Keys.Subtract:
                    discJualMaskedTextBox.Focus();
                    break;

                case Keys.Delete:
                    //if (cashierDataGridView.Focused)
                    //if (!bayarTextBox.Focused && !discJualMaskedTextBox.Focused && 
                    //    !tempoMaskedTextBox.Focused && !paymentComboBox.Focused &&
                    //    !customerComboBox.Focused 
                    //    )
                    { 
                        if (originModuleID != globalConstants.COPY_NOTA)
                            if (cashierDataGridView.Rows.Count > 1)
                                if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                                {
                                    gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : cashierDataGridView_KeyDown ATTEMPT TO DELETE ROW");
                                    deleteCurrentRow();
                                    updateRowNumber();
                                    calculateTotal();
                                }
                    }
                    break;

                case Keys.F10:
                    MessageBox.Show("F10");
                    break;
                case Keys.F12:
                    MessageBox.Show("F12");
                    break;

                case Keys.Up:
                    SendKeys.Send("+{TAB}");
                    break;

                case Keys.Down:
                    SendKeys.Send("{TAB}");
                    break;

            }
        }
        private void captureAll(Keys key)
        {
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (directMutasiBarang)
                    {
                        ROInvoiceTextBox.Focus();

                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        { 
                            barcodeForm displayBarcodeForm = new barcodeForm(this, globalConstants.MUTASI_BARANG);

                            displayBarcodeForm.Top = this.Top + 5;
                            displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;
                        //                        detailRequestOrderDataGridView.Focus();
                    }
                    break;

                case Keys.F8:
                    if (directMutasiBarang)
                    {
                        //tailRequestOrderDataGridView.Select();
                        rowcount = detailRequestOrderDataGridView.RowCount;
                        detailRequestOrderDataGridView.CurrentCell = detailRequestOrderDataGridView.Rows[rowcount - 1].Cells["productID"];
                        //addNewRow();
                    }
                    break;

                case Keys.F9:
                    if (approveButton.Visible == true)
                        approveButton.PerformClick();
                    break;

                case Keys.F11:
                    if (directMutasiBarang)
                    {
                        ROInvoiceTextBox.Focus();

                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                        {
                            browseProdukForm = new dataProdukForm(globalConstants.MUTASI_BARANG, this);
                        }

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;

                        //detailRequestOrderDataGridView.Focus();
                    }
                    break;

                case Keys.Delete:
                    if (detailRequestOrderDataGridView.Rows.Count > 1)
                        if (detailRequestOrderDataGridView.ReadOnly == false)
                                if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                                {
                                    deleteCurrentRow();
                                    calculateTotal();
                                }
                    break;
            }
        }
Exemplo n.º 4
0
        private void captureAll(Keys key)
        {
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (detailGridView.ReadOnly == false)
                    {
                        PRDtPicker.Focus();

                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        { 
                            displayBarcodeForm = new barcodeForm(this, globalConstants.PENERIMAAN_BARANG);

                            displayBarcodeForm.Top = this.Top + 5;
                            displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;
                        //detailGridView.Focus();
                    }
                    break;

                case Keys.F8:
                    if (detailGridView.ReadOnly == false)
                    {
                        rowcount = detailGridView.RowCount;
                        detailGridView.CurrentCell = detailGridView.Rows[rowcount - 1].Cells["productID"];
                    }
                    //if (originModuleId != globalConstants.PENERIMAAN_BARANG_DARI_PO && originModuleId != globalConstants.PENERIMAAN_BARANG_DARI_MUTASI)
                    //{
                    //    addNewRow();
                    //}
                    break;

                case Keys.F9:
                    if (saveButton.Visible == true)
                        saveButton.PerformClick();
                    break;

                case Keys.F11:
                    if (detailGridView.ReadOnly == false)
                    {
                        PRDtPicker.Focus();
                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                                browseProdukForm = new dataProdukForm(globalConstants.PENERIMAAN_BARANG, this);

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;
                        //detailGridView.Focus();
                    }
                    break;

                case Keys.Delete:
                    if (detailGridView.Rows.Count > 1)
                        if (detailGridView.ReadOnly == false)
                                if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                                {
                                    deleteCurrentRow();
                                    calculateTotal();
                                }
                    break;

                case Keys.Up:
                    SendKeys.Send("+{TAB}");
                    break;

                case Keys.Down:
                    SendKeys.Send("{TAB}");
                    break;
            }
        }
        private void captureAll(Keys key)
        {
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (detailPODataGridView.ReadOnly == false)
                    {
                        PODateTimePicker.Focus();
                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        { 
                            displayBarcodeForm = new barcodeForm(this, globalConstants.NEW_PURCHASE_ORDER);

                            displayBarcodeForm.Top = this.Top + 5;
                            displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;
                        //detailPODataGridView.Focus();
                    }
                    break;

                case Keys.F8:
                    if (detailPODataGridView.ReadOnly == false)
                    {
                        detailPODataGridView.Focus();
                        addNewRow();
                    }
                    break;

                case Keys.F9:
                    if (saveButton.Visible == true)
                        saveButton.PerformClick();
                    break;

                case Keys.F11:
                    if (detailPODataGridView.ReadOnly == false)
                    {
                        PODateTimePicker.Focus();
                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                                browseProdukForm = new dataProdukForm(globalConstants.NEW_PURCHASE_ORDER, this);

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;
                        //detailPODataGridView.Focus();
                    }
                    break;

                case Keys.Delete:
                    if (detailPODataGridView.Rows.Count > 1)
                        if (detailPODataGridView.ReadOnly == false)
                        {
                            if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                            {
                                deleteCurrentRow();
                                calculateTotal();
                            }
                        }
                    break;

                case Keys.Up:
                    SendKeys.Send("+{TAB}");
                    break;

                case Keys.Down:
                    SendKeys.Send("{TAB}");
                    break;
            }
        }
Exemplo n.º 6
0
        private void captureAll(Keys key)
        {
            string searchParam = "";
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                    if (saveButton.Enabled == true)
                    {
                        invoiceInfoTextBox.Focus();

                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        {
                            displayBarcodeForm = new barcodeForm(this, globalConstants.RETUR_PENJUALAN);

                            displayBarcodeForm.Top = this.Top + 5;
                            displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;
                        //detailReturDataGridView.Focus();
                    }
                    break;

                case Keys.F8:
                    if (detailReturDataGridView.ReadOnly == false)
                    { 
                        //detailReturDataGridView.Focus();
                        rowcount = detailReturDataGridView.RowCount;
                        detailReturDataGridView.CurrentCell = detailReturDataGridView.Rows[rowcount - 1].Cells["productID"];
                        //addNewRow();
                    }
                    break;

                case Keys.F9:
                    if ( saveButton.Enabled == true )
                        saveButton.PerformClick();
                    break;

                case Keys.F11:
                    if (detailReturDataGridView.ReadOnly == false)
                    {
                        invoiceInfoTextBox.Focus();
                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                        {
                            if (originModuleID == globalConstants.RETUR_PENJUALAN)
                                searchParam = selectedSalesInvoice;
                            else if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT)
                                searchParam = selectedCustomerID.ToString();

                            browseProdukForm = new dataProdukForm(originModuleID, this, searchParam);
                        }

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;
                        //detailReturDataGridView.Focus();
                    }
                    break;
                case Keys.Delete:
                    if (detailReturDataGridView.Rows.Count > 1)
                        if (detailReturDataGridView.ReadOnly == false)
                                if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                                {
                                    deleteCurrentRow();
                                    calculateTotal();
                                }
                    break;
            }
        }
        private void captureAll(Keys key)
        {
            int rowcount = 0;
            switch (key)
            {
                case Keys.F1:
                    penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                    displayHelp.ShowDialog(this);
                    break;

                case Keys.F2:
                        ReturDtPicker_1.Focus();

                        if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed)
                        {
                            displayBarcodeForm = new barcodeForm(this, globalConstants.RETUR_PEMBELIAN);

                            displayBarcodeForm.Top = this.Top + 5;
                            displayBarcodeForm.Left = this.Left + 5;//(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2);
                        }

                        displayBarcodeForm.Show();
                        displayBarcodeForm.WindowState = FormWindowState.Normal;
                    //detailReturDataGridView.Focus();
                    break;

                case Keys.F8:
                    //detailReturDataGridView.Focus();
                    rowcount = detailReturDataGridView.RowCount;
                    detailReturDataGridView.CurrentCell = detailReturDataGridView.Rows[rowcount - 1].Cells["productID"];
                    //addNewRow();
                    break;

                case Keys.F9:
                        saveAndPrintButton.PerformClick();
                    break;

                case Keys.F11:
                        ReturDtPicker_1.Focus();

                        if (null == browseProdukForm || browseProdukForm.IsDisposed)
                            browseProdukForm = new dataProdukForm(originModuleID, this);

                        browseProdukForm.Show();
                        browseProdukForm.WindowState = FormWindowState.Normal;
                        //detailReturDataGridView.Focus();
                    break;

                case Keys.Delete:
                    if (detailReturDataGridView.ReadOnly == false)
                    {
                            if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo))
                            {
                                deleteCurrentRow();
                                calculateTotal();
                            }
                    }
                    break;
            }
        }