Ejemplo n.º 1
0
 private void gridData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (gridData.SelectedRows.Count > 0)
     {
         SUPPLIER_OS_INVOICE = (SupplierOutStandingInvoice)gridData.SelectedRows[0].Tag;
         this.Close();
     }
 }
Ejemplo n.º 2
0
 private void OKkryptonButton_Click(object sender, EventArgs e)
 {
     if (gridData.SelectedRows.Count > 0)
     {
         SUPPLIER_OS_INVOICE = (SupplierOutStandingInvoice)gridData.SelectedRows[0].Tag;
         this.Close();
     }
 }
Ejemplo n.º 3
0
        public void ClearForm()
        {
            try
            {
                m_prn            = new SupplierOutStandingInvoice();
                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);
            }
        }
Ejemplo n.º 4
0
        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          = (SupplierOutStandingInvoice)result[0];
                m_prn          = (SupplierOutStandingInvoice)r_soinv.Get(m_prn.ID);
                m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE);
                // m_prn.VENDOR = (Supplier)r_sup.GetById(m_prn.VENDOR);
                setEditMode(EditMode.View);
                loadData();
                setEnableForm(false);
            }
            else
            {
                using (SearchSupplierOSInvoiceForm frm = new SearchSupplierOSInvoiceForm(searchToolStripTextBox.Text, result, m_mainForm.CurrentUser))
                {
                    frm.ShowDialog();
                    if (frm.SUPPLIER_OS_INVOICE == null)
                    {
                        return;
                    }
                    else
                    {
                        m_prn          = frm.SUPPLIER_OS_INVOICE;
                        m_prn          = (SupplierOutStandingInvoice)r_soinv.Get(m_prn.ID);
                        m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE);
                        // m_prn.VENDOR = (Supplier)r_sup.GetById(m_prn.VENDOR);
                        setEditMode(EditMode.View);
                        loadData();
                        setEnableForm(false);
                    }
                }
            }
        }
        private void runReporttoolStripButton_Click(object sender, EventArgs e)
        {
            Supplier s         = (Supplier)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();
                        Supplier sup = (Supplier)r_sup.GetById((Supplier)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 PurchaseOrder)
                        {
                            PurchaseOrder p = (PurchaseOrder)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 SupplierInvoice)
                        {
                            SupplierInvoice p = (SupplierInvoice)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();
                        Supplier sup = (Supplier)r_sup.GetById((Supplier)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 Payment)
                        {
                            Payment p = (Payment)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 SupplierOutStandingInvoice)
                        {
                            SupplierOutStandingInvoice p = (SupplierOutStandingInvoice)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 APDebitNote)
                        {
                            APDebitNote p = (APDebitNote)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;
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
 private void CANCELkryptonButton_Click(object sender, EventArgs e)
 {
     SUPPLIER_OS_INVOICE = null;
     this.Close();
 }