コード例 #1
0
        private void dataPelangganDataGridView_DoubleClick(object sender, EventArgs e)
        {
            if (dataPelangganDataGridView.Rows.Count <= 0)
            {
                return;
            }

            int selectedrowindex = dataPelangganDataGridView.SelectedCells[0].RowIndex;

            DataGridViewRow selectedRow = dataPelangganDataGridView.Rows[selectedrowindex];

            selectedCustomerID = Convert.ToInt32(selectedRow.Cells["CUSTOMER_ID"].Value);

            if (originModuleID == globalConstants.CASHIER_MODULE)
            {
                parentForm.setCustomerID(selectedCustomerID);
                this.Close();
            }
            else if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT)
            {
                dataReturPenjualanForm displayedReturForm = new dataReturPenjualanForm(originModuleID, "", selectedCustomerID);
                displayedReturForm.ShowDialog(this);
            }
            else if (originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
            {
                pembayaranLumpSumForm pembayaranForm = new pembayaranLumpSumForm(originModuleID, selectedCustomerID);
                pembayaranForm.ShowDialog(this);
            }
            else
            {
                dataPelangganDetailForm displayedForm = new dataPelangganDetailForm(globalConstants.EDIT_CUSTOMER, selectedCustomerID);
                displayedForm.ShowDialog(this);
            }
        }
コード例 #2
0
        private void dataInvoiceDataGridView_DoubleClick(object sender, EventArgs e)
        {
            if (dataInvoiceDataGridView.Rows.Count <= 0)
            {
                return;
            }

            int             rowSelectedIndex = dataInvoiceDataGridView.SelectedCells[0].RowIndex;
            DataGridViewRow selectedRow      = dataInvoiceDataGridView.Rows[rowSelectedIndex];

            if (selectedRow.Cells["STATUS BAYAR"].Value.ToString() == "LUNAS" && originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
            {
                return;
            }

            selectedSO = selectedRow.Cells["NO INVOICE"].Value.ToString();

            switch (originModuleID)
            {
            case globalConstants.PEMBAYARAN_PIUTANG:
                pembayaranPiutangForm pembayaranForm = new pembayaranPiutangForm(selectedSO);
                pembayaranForm.ShowDialog(this);
                break;

            case globalConstants.RETUR_PENJUALAN:
                dataReturPenjualanForm displayedForm = new dataReturPenjualanForm(originModuleID, selectedSO);
                displayedForm.ShowDialog(this);
                break;
            }
        }
コード例 #3
0
        private void barcodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            string productID = "";

            if (e.KeyChar == 13)
            {
                productNameTextBox.Text = getProductName(barcodeTextBox.Text);
                productID = getProductID(barcodeTextBox.Text);

                if (productNameTextBox.Text.Length > 0)
                {
                    switch (originModuleID)
                    {
                    case globalConstants.CASHIER_MODULE:
                        originCashierForm = (cashierForm)parentForm;
                        originCashierForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.PENERIMAAN_BARANG:
                        originPenerimaanForm = (penerimaanBarangForm)parentForm;
                        originPenerimaanForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.NEW_PURCHASE_ORDER:
                        originPOForm = (purchaseOrderDetailForm)parentForm;
                        originPOForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.MUTASI_BARANG:
                        originMutasiForm = (dataMutasiBarangDetailForm)parentForm;
                        originMutasiForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.NEW_REQUEST_ORDER:
                        originRequestForm = (permintaanProdukForm)parentForm;
                        originRequestForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.RETUR_PENJUALAN:
                        originReturJualForm = (dataReturPenjualanForm)parentForm;
                        originReturJualForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.RETUR_PEMBELIAN:
                        originReturBeliForm = (dataReturPermintaanForm)parentForm;
                        originReturBeliForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;
                    }
                }
                barcodeTextBox.SelectAll();
            }
            else if (e.KeyChar == 27)
            {
                this.Close();
            }
        }
コード例 #4
0
        private void unknownCustomerButton_Click(object sender, EventArgs e)
        {
            if (null == unknownCustReturPenjualanForm || unknownCustReturPenjualanForm.IsDisposed)
            {
                unknownCustReturPenjualanForm = new dataReturPenjualanForm(originModuleID, "", 0);
            }

            unknownCustReturPenjualanForm.Show();
            unknownCustReturPenjualanForm.WindowState = FormWindowState.Normal;
        }
コード例 #5
0
        public dataProdukForm(int moduleID, dataReturPenjualanForm thisParentForm, string searchParam = "")
        {
            InitializeComponent();

            originModuleID       = moduleID;
            parentReturJualForm  = thisParentForm;
            returJualSearchParam = searchParam;
            // accessed from other form other than Master -> Data Produk
            // it means that this form is only displayed for browsing / searching purpose only
            newButton.Visible = false;
        }
コード例 #6
0
        public POSSearchProductForm(int moduleID, dataReturPenjualanForm thisParentForm, string productName = "", int rowIndex = -1)
        {
            InitializeComponent();

            originModuleID      = moduleID;
            parentReturJualForm = thisParentForm;

            // accessed from other form other than Master -> Data Produk
            // it means that this form is only displayed for browsing / searching purpose only

            namaProdukTextBox.Text = productName;
            selectedRowIndex       = rowIndex;
        }
コード例 #7
0
        private void dataPelangganDataGridView_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (dataPelangganDataGridView.Rows.Count <= 0)
                {
                    return;
                }

                int selectedrowindex = dataPelangganDataGridView.SelectedCells[0].RowIndex;

                DataGridViewRow selectedRow = dataPelangganDataGridView.Rows[selectedrowindex];
                selectedCustomerID = Convert.ToInt32(selectedRow.Cells["CUSTOMER_ID"].Value);

                if (originModuleID == globalConstants.CASHIER_MODULE)
                {
                    parentForm.setCustomerID(selectedCustomerID);
                    this.Close();
                }
                else if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT)
                {
                    if (null == returPenjualanForm || returPenjualanForm.IsDisposed)
                    {
                        returPenjualanForm = new dataReturPenjualanForm(originModuleID, "", selectedCustomerID);
                    }

                    returPenjualanForm.Show();
                    returPenjualanForm.WindowState = FormWindowState.Normal;
                }
                else if (originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
                {
                    if (null == pembayaranPiutangLumpSumForm || pembayaranPiutangLumpSumForm.IsDisposed)
                    {
                        pembayaranPiutangLumpSumForm = new pembayaranLumpSumForm(originModuleID, selectedCustomerID);
                    }

                    pembayaranPiutangLumpSumForm.Show();
                    pembayaranPiutangLumpSumForm.WindowState = FormWindowState.Normal;
                }
                else
                {
                    if (null == editPelangganForm || editPelangganForm.IsDisposed)
                    {
                        editPelangganForm = new dataPelangganDetailForm(globalConstants.EDIT_CUSTOMER, selectedCustomerID);
                    }

                    editPelangganForm.Show();
                    editPelangganForm.WindowState = FormWindowState.Normal;
                }
            }
        }
コード例 #8
0
        public dataProdukForm(int moduleID, dataReturPenjualanForm thisParentForm, string productID = "", string productName = "", int rowIndex = -1, string searchParam = "")
        {
            InitializeComponent();

            originModuleID      = moduleID;
            parentReturJualForm = thisParentForm;

            // accessed from other form other than Master -> Data Produk
            // it means that this form is only displayed for browsing / searching purpose only
            newButton.Visible    = false;
            returJualSearchParam = searchParam;

            namaProdukTextBox.Text  = productName;
            kodeProductTextBox.Text = productID;
            selectedRowIndex        = rowIndex;
        }
コード例 #9
0
        private void unknownCustomerButton_Click(object sender, EventArgs e)
        {
            dataReturPenjualanForm displayedReturForm = new dataReturPenjualanForm(originModuleID, "", 0);

            displayedReturForm.ShowDialog(this);
        }