Пример #1
0
        private void dataSupplierDataGridView_DoubleClick(object sender, EventArgs e)
        {
            if (dataSupplierDataGridView.Rows.Count <= 0)
            {
                return;
            }

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

            DataGridViewRow selectedRow = dataSupplierDataGridView.Rows[selectedrowindex];

            selectedSupplierID = Convert.ToInt32(selectedRow.Cells["SUPPLIER_ID"].Value);

            if (originModuleID == globalConstants.PEMBAYARAN_HUTANG)
            {
                if (null == pembayaranHutangForm || pembayaranHutangForm.IsDisposed)
                {
                    pembayaranHutangForm = new pembayaranLumpSumForm(originModuleID, selectedSupplierID);
                }

                pembayaranHutangForm.Show();
                pembayaranHutangForm.WindowState = FormWindowState.Normal;
            }
            else
            {
                if (null == editSupplierForm || editSupplierForm.IsDisposed)
                {
                    editSupplierForm = new dataSupplierDetailForm(globalConstants.EDIT_SUPPLIER, selectedSupplierID);
                }

                editSupplierForm.Show();
                editSupplierForm.WindowState = FormWindowState.Normal;
            }
        }
        private void dataSupplierDataGridView_KeyDown(object sender, KeyEventArgs e)
        {
            if (dataSupplierDataGridView.Rows.Count <= 0)
            {
                return;
            }

            if (e.KeyCode == Keys.Enter)
            {
                int selectedrowindex = dataSupplierDataGridView.SelectedCells[0].RowIndex;

                DataGridViewRow selectedRow = dataSupplierDataGridView.Rows[selectedrowindex];
                selectedSupplierID = Convert.ToInt32(selectedRow.Cells["SUPPLIER_ID"].Value);

                if (originModuleID == globalConstants.PEMBAYARAN_HUTANG)
                {
                    pembayaranLumpSumForm pembayaranHutangForm = new pembayaranLumpSumForm(originModuleID, selectedSupplierID);
                    pembayaranHutangForm.ShowDialog(this);
                }
                else
                {
                    dataSupplierDetailForm displayedForm = new dataSupplierDetailForm(globalConstants.EDIT_SUPPLIER, selectedSupplierID);
                    displayedForm.ShowDialog(this);
                }
            }
        }
Пример #3
0
        private void newButton_Click(object sender, EventArgs e)
        {
            if (null == newSupplierForm || newSupplierForm.IsDisposed)
            {
                newSupplierForm = new dataSupplierDetailForm(globalConstants.NEW_SUPPLIER);
            }

            newSupplierForm.Show();
            newSupplierForm.WindowState = FormWindowState.Normal;
        }
        private void newButton_Click(object sender, EventArgs e)
        {
            dataSupplierDetailForm displayedForm = new dataSupplierDetailForm(globalConstants.NEW_SUPPLIER);

            displayedForm.ShowDialog(this);
        }