Ejemplo n.º 1
0
        private void captureAll(Keys key)
        {
            switch (key)
            {
            //case Keys.F1:
            //    cashierHelpForm displayHelp = new cashierHelpForm();
            //    displayHelp.ShowDialog(this);
            //    break;

            case Keys.F11:
                if (null == browseProdukForm || browseProdukForm.IsDisposed)
                {
                    browseProdukForm = new dataProdukForm(globalConstants.PRODUCT_BC, this);
                }
                browseProdukForm.Show();
                browseProdukForm.WindowState = FormWindowState.Normal;
                break;

            case Keys.Delete:
                //clear
                int currentrowindex = 0;
                currentrowindex = ProductBCGridView.SelectedCells[0].RowIndex;
                clearrow(currentrowindex);
                break;
            }
        }
Ejemplo n.º 2
0
        private void productName_previewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            string currentValue     = "";
            int    rowSelectedIndex = 0;
            DataGridViewTextBoxEditingControl dataGridViewComboBoxEditingControl = sender as DataGridViewTextBoxEditingControl;

            if (ProductBCGridView.CurrentCell.OwningColumn.Name != "productName")
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                currentValue     = dataGridViewComboBoxEditingControl.Text;
                rowSelectedIndex = ProductBCGridView.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = ProductBCGridView.Rows[rowSelectedIndex];

                if (currentValue.Length > 0)
                {
                    // CALL DATA PRODUK FORM WITH PARAMETER
                    dataProdukForm browseProduk = new dataProdukForm(globalConstants.PRODUCT_BC, this, currentValue, "", rowSelectedIndex);
                    browseProduk.ShowDialog(this);
                }
                else
                {
                    //clearUpSomeRowContents(selectedRow, rowSelectedIndex);
                }
            }
        }
Ejemplo n.º 3
0
        private void TextBox_previewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            string currentValue     = "";
            int    rowSelectedIndex = 0;
            DataGridViewTextBoxEditingControl dataGridViewComboBoxEditingControl = sender as DataGridViewTextBoxEditingControl;

            if (detailReturDataGridView.CurrentCell.OwningColumn.Name != "productName")
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                currentValue     = dataGridViewComboBoxEditingControl.Text;
                rowSelectedIndex = detailReturDataGridView.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = detailReturDataGridView.Rows[rowSelectedIndex];

                if (currentValue.Length > 0)
                {
                    //updateSomeRowContents(selectedRow, rowSelectedIndex, currentValue);
                    //detailReturDataGridView.CurrentCell = selectedRow.Cells["qty"];
                    //detailReturDataGridView.BeginEdit(true);
                    //detailReturDataGridView.Select();
                    //POSSearchProductForm browseProduk = new POSSearchProductForm(globalConstants.RETUR_PEMBELIAN, this, currentValue, rowSelectedIndex);
                    dataProdukForm browseProduk = new dataProdukForm(globalConstants.RETUR_PEMBELIAN, this, "", currentValue, rowSelectedIndex);
                    browseProduk.ShowDialog(this);
                }
                else
                {
                    //clearUpSomeRowContents(selectedRow, rowSelectedIndex);
                }
            }
        }
Ejemplo n.º 4
0
        private void captureAll(Keys key)
        {
            switch (key)
            {
            case Keys.F1:
                penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm();
                displayHelp.ShowDialog(this);
                break;

            case Keys.F2:
                ReturDtPicker_1.Focus();
                barcodeForm 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.ShowDialog(this);
                break;

            case Keys.F8:
                //detailReturDataGridView.Focus();
                addNewRow();
                break;

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

            case Keys.F11:
                ReturDtPicker_1.Focus();
                dataProdukForm displayProdukForm = new dataProdukForm(originModuleID, this);
                displayProdukForm.ShowDialog(this);
                break;
            }
        }
        private void productName_previewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            string currentValue     = "";
            int    rowSelectedIndex = 0;
            DataGridViewTextBoxEditingControl dataGridViewComboBoxEditingControl = sender as DataGridViewTextBoxEditingControl;

            if (detailReturDataGridView.CurrentCell.OwningColumn.Name != "productName")
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                currentValue     = dataGridViewComboBoxEditingControl.Text;
                rowSelectedIndex = detailReturDataGridView.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = detailReturDataGridView.Rows[rowSelectedIndex];

                if (currentValue.Length > 0)
                {
                    updateSomeRowContents(selectedRow, rowSelectedIndex, currentValue, false);
                    //detailReturDataGridView.CurrentCell = selectedRow.Cells["qty"];
                    // CALL DATA PRODUK FORM WITH PARAMETER
                    dataProdukForm browseProduk = new dataProdukForm(originModuleID, this, "", currentValue, rowSelectedIndex);
                    browseProduk.ShowDialog(this);
                }
                else
                {
                    //clearUpSomeRowContents(selectedRow, rowSelectedIndex);
                }
            }
        }
Ejemplo n.º 6
0
        private void browseProdukButton_Click(object sender, EventArgs e)
        {
            dataProdukForm displayForm = new dataProdukForm(globalConstants.BROWSE_STOK_PECAH_BARANG, this);

            displayForm.ShowDialog(this);

            loadProductName();
            numberOfProductTextBox.Text = "0";
        }
        private void browseProdukButton_Click(object sender, EventArgs e)
        {
            if (null == displayBrowseDataProdukForm || displayBrowseDataProdukForm.IsDisposed)
            {
                displayBrowseDataProdukForm = new dataProdukForm(globalConstants.BROWSE_STOK_PECAH_BARANG, this);
            }

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

            numberOfProductTextBox.Text = "0";
        }
Ejemplo n.º 8
0
        private void Combobox_previewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            string currentValue     = "";
            int    rowSelectedIndex = 0;

            DataGridViewTextBoxEditingControl dataGridViewComboBoxEditingControl = sender as DataGridViewTextBoxEditingControl;

            if (ProductBCGridView.CurrentCell.OwningColumn.Name != "productID")
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                currentValue     = dataGridViewComboBoxEditingControl.Text;
                rowSelectedIndex = ProductBCGridView.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = ProductBCGridView.Rows[rowSelectedIndex];

                if (currentValue.Length > 0)
                {
                    string sqlCommand  = "";
                    string productName = "";
                    sqlCommand = "SELECT COUNT(1) FROM MASTER_PRODUCT WHERE PRODUCT_ID = '" + currentValue + "'";

                    if (Convert.ToInt32(DS.getDataSingleValue(sqlCommand)) > 0)
                    {
                        sqlCommand = "SELECT PRODUCT_NAME FROM MASTER_PRODUCT WHERE PRODUCT_ID = '" + currentValue + "'";

                        productName = DS.getDataSingleValue(sqlCommand).ToString();

                        addNewRowFromBarcode(currentValue, productName, rowSelectedIndex);
                    }
                    else
                    {
                        // CALL DATA PRODUK FORM WITH PARAMETER
                        dataProdukForm browseProduk = new dataProdukForm(globalConstants.PRODUCT_BC, this, currentValue, "", rowSelectedIndex);
                        browseProduk.ShowDialog(this);
                    }
                }
                else
                {
                    //clearUpSomeRowContents(selectedRow, rowSelectedIndex);
                }
            }
        }
        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;
            }
        }