private void gridData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (gridData.SelectedRows.Count > 0) { SUPPLIER_OS_INVOICE = (CustomerOutStandingInvoice)gridData.SelectedRows[0].Tag; this.Close(); } }
private void OKkryptonButton_Click(object sender, EventArgs e) { if (gridData.SelectedRows.Count > 0) { SUPPLIER_OS_INVOICE = (CustomerOutStandingInvoice)gridData.SelectedRows[0].Tag; this.Close(); } }
public void ClearForm() { try { m_prn = new CustomerOutStandingInvoice(); textBoxCode.Text = ""; dateKryptonDateTimePicker.Value = DateTime.Today; employeeKryptonComboBox.SelectedIndex = 0; notesKryptonTextBox.Text = ""; supplierkryptonComboBox.SelectedIndex = 0; netAmountkryptonNumericUpDown.Value = 0; currencyKryptonComboBox.SelectedIndex = 0; itemsDataGrid.Rows.Clear(); errorProvider1.Clear(); } catch (Exception x) { KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void searchToolStripButton_Click(object sender, EventArgs e) { IList result = searchToolStripTextBox.Text == string.Empty ? new ArrayList() : r_soinv.Search(searchToolStripTextBox.Text); if (result.Count == 1) { m_prn = (CustomerOutStandingInvoice)result[0]; m_prn = (CustomerOutStandingInvoice)r_soinv.Get(m_prn.ID); m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE); // m_prn.VENDOR = (Customer)r_sup.GetById(m_prn.VENDOR); setEditMode(EditMode.View); loadData(); setEnableForm(false); } else { using (SearchCustomerOSInvoiceForm frm = new SearchCustomerOSInvoiceForm(searchToolStripTextBox.Text, result, m_mainForm.CurrentUser)) { frm.ShowDialog(); if (frm.SUPPLIER_OS_INVOICE == null) { return; } else { m_prn = frm.SUPPLIER_OS_INVOICE; m_prn = (CustomerOutStandingInvoice)r_soinv.Get(m_prn.ID); m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE); // m_prn.VENDOR = (Customer)r_sup.GetById(m_prn.VENDOR); setEditMode(EditMode.View); loadData(); setEnableForm(false); } } } }
private void runReporttoolStripButton_Click(object sender, EventArgs e) { Customer s = (Customer)supplierkryptonComboBox.SelectedItem; bool allStatus = statuskryptonComboBox2.Text == "ALL"; bool status = true; if (!allStatus) { status = Boolean.Parse(statuskryptonComboBox2.Text); } string type = trtypekryptonComboBox1.Text; IList trs = r_sup.GetAllTransactions(s.ID, startdateKryptonDateTimePicker.Value, enDatekryptonDateTimePicker1.Value, allStatus, status); transactionkryptonDataGridView.Rows.Clear(); if (trs.Count > 0) { foreach (object ev in trs) { if (ev is Event) { Event t = (Event)ev; if (type != "ALL") { if (t.STOCK_CARD_ENTRY_TYPE.ToString() != type) { continue; } } int r = transactionkryptonDataGridView.Rows.Add(); transactionkryptonDataGridView[datetrColumn.Index, r].Value = t.TRANSACTION_DATE; transactionkryptonDataGridView[typeTrColumn.Index, r].Value = t.STOCK_CARD_ENTRY_TYPE.ToString(); transactionkryptonDataGridView[codeTrColumn.Index, r].Value = t.CODE; transactionkryptonDataGridView[postedColumn.Index, r].Value = t.POSTED.ToString(); Customer sup = (Customer)r_sup.GetById((Customer)t.VENDOR); Employee emp = (Employee)r_emp.GetById(t.EMPLOYEE); transactionkryptonDataGridView[supplierColumn.Index, r].Value = sup.NAME; transactionkryptonDataGridView[supCodeColumn.Index, r].Value = sup.CODE; transactionkryptonDataGridView[supAddressColumn.Index, r].Value = sup.ADDRESS; transactionkryptonDataGridView[employeeColumn.Index, r].Value = emp.CODE; if (t is SalesOrder) { SalesOrder p = (SalesOrder)t; p.TOP = (TermOfPayment)r_top.GetById(p.TOP); p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[topColumn.Index, r].Value = p.TOP.CODE; transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } if (t is CustomerInvoice) { CustomerInvoice p = (CustomerInvoice)t; p.TOP = (TermOfPayment)r_top.GetById(p.TOP); p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[topColumn.Index, r].Value = p.TOP.CODE; transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } if (t is POS) { POS p = (POS)t; p.TOP = (TermOfPayment)r_top.GetById(p.TOP); p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[topColumn.Index, r].Value = p.TOP.CODE; transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } } if (ev is EventJournal) { EventJournal t = (EventJournal)ev; if (type != "ALL") { if (t.VENDOR_BALANCE_ENTRY_TYPE.ToString() != type) { continue; } } int r = transactionkryptonDataGridView.Rows.Add(); transactionkryptonDataGridView[datetrColumn.Index, r].Value = t.TRANSACTION_DATE; transactionkryptonDataGridView[typeTrColumn.Index, r].Value = t.VENDOR_BALANCE_ENTRY_TYPE.ToString(); transactionkryptonDataGridView[codeTrColumn.Index, r].Value = t.CODE; transactionkryptonDataGridView[postedColumn.Index, r].Value = t.POSTED.ToString(); Customer sup = (Customer)r_sup.GetById((Customer)t.VENDOR); Employee emp = (Employee)r_emp.GetById(t.EMPLOYEE); transactionkryptonDataGridView[supplierColumn.Index, r].Value = sup.NAME; transactionkryptonDataGridView[supCodeColumn.Index, r].Value = sup.CODE; transactionkryptonDataGridView[supAddressColumn.Index, r].Value = sup.ADDRESS; transactionkryptonDataGridView[employeeColumn.Index, r].Value = emp.CODE; if (t is Receipt) { Receipt p = (Receipt)t; p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } if (t is CustomerOutStandingInvoice) { CustomerOutStandingInvoice p = (CustomerOutStandingInvoice)t; p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } if (t is ARCreditNote) { ARCreditNote p = (ARCreditNote)t; p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY); transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT; transactionkryptonDataGridView[ccyColumn.Index, r].Value = p.CURRENCY.CODE; } } } } }
private void CANCELkryptonButton_Click(object sender, EventArgs e) { SUPPLIER_OS_INVOICE = null; this.Close(); }