示例#1
0
 private void gridvendorinvoice_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), col_gridvendorinvoice_PayableAmount.Name))
     {
         var form = new Invoices.Payment_Form(typeof(VendorInvoice), new Guid(gridvendorinvoice.Rows[e.RowIndex].Cells[col_gridvendorinvoice_id.Name].Value.ToString()));
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             populateGridVendorInvoices();
         }
     }
     else if (Util.isColumnMatch(sender, e, col_gridVendorInvoice_TogglePayment))
     {
         decimal value = Util.wrapNullable <decimal>(Util.getClickedRowValue(sender, e, col_gridVendorInvoice_PaymentAmount));
         if (value != 0)
         {
             value = 0;
         }
         else
         {
             value = Util.wrapNullable <decimal>(Util.getClickedRowValue(sender, e, col_gridvendorinvoice_PayableAmount));
         }
         Util.setRowValue(sender, e, col_gridVendorInvoice_PaymentAmount, value);
     }
     else if (Util.isColumnMatch(sender, e, col_gridVendorInvoice_PaidAmount))
     {
         VendorInvoicePayments_Form form = (VendorInvoicePayments_Form)Util.displayMDIChild(new VendorInvoicePayments_Form());
         form.searchVendorInvoiceNo(Util.getClickedRowValue(sender, e, col_gridvendorinvoice_invoiceno).ToString());
     }
     else if (Util.isColumnMatch(sender, e, col_gridVendorInvoices_Approved))
     {
         VendorInvoice.update_Approved(Util.getClickedRowValue <Guid>(sender, e, col_gridvendorinvoice_id), !Util.getCheckboxValue(sender, e));
         populateGridVendorInvoices();
     }
 }
示例#2
0
        private void btnPayment_Click(object sender, EventArgs e)
        {
            var form = new Invoices.Payment_Form(typeof(Sale), _sale.id);

            Tools.displayForm(form);
            if (form.DialogResult == DialogResult.OK)
            {
                this.DialogResult = DialogResult.OK;
            }
        }
示例#3
0
 private void gridMaster_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), Sale.COL_HEXBARCODE))
     {
         Sale sale = new Sale(new Guid(gridMaster.Rows[e.RowIndex].Cells[col_gridmaster_saleid.Name].Value.ToString()));
         var  form = new Sales.Invoice_Form(sale, SaleItem.getItems(sale.id), false);
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             populateMasterGrid();
         }
     }
     else if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), gridMasterSaleAmount.Name))
     {
         var form = new Invoices.Payment_Form(typeof(Sale), new Guid(gridMaster.Rows[e.RowIndex].Cells[col_gridmaster_saleid.Name].Value.ToString()));
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             populateMasterGrid();
         }
     }
     else if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewCheckBoxColumn), col_gridmaster_completed.Name))
     {
         DataGridViewRow row = gridMaster.Rows[e.RowIndex];
         Sale.updateCompleted((Guid)row.Cells[col_gridmaster_saleid.Name].Value, !(bool)((DataGridViewCheckBoxCell)row.Cells[e.ColumnIndex]).Value);
         populateMasterGrid();
     }
     else if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewCheckBoxColumn), col_gridmaster_specialuseronly.Name))
     {
         DataGridViewRow row = gridMaster.Rows[e.RowIndex];
         Sale.updateSpecialUserOnly((Guid)row.Cells[col_gridmaster_saleid.Name].Value, !(bool)((DataGridViewCheckBoxCell)row.Cells[e.ColumnIndex]).Value);
         populateMasterGrid();
     }
     else if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewCheckBoxColumn), col_gridmaster_isReported.Name))
     {
         DataGridViewRow row = gridMaster.Rows[e.RowIndex];
         Sale.updateIsReported((Guid)row.Cells[col_gridmaster_saleid.Name].Value, !(bool)((DataGridViewCheckBoxCell)row.Cells[e.ColumnIndex]).Value);
         populateMasterGrid();
     }
 }
 private void GridSaleInvoices_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Util.isColumnMatch(sender, e, col_gridSaleInvoices_removeFakturPajaks_Id))
     {
         Sale.update_FakturPajaks_Id((Guid)Util.getSelectedRowValue(sender, col_gridSaleInvoices_Sales_id), null);
         populateGridSaleInvoices(true);
     }
     else if (Util.isColumnMatch(sender, e, col_gridSaleInvoices_hexbarcode))
     {
         Sale sale = new Sale((Guid)Util.getSelectedRowValue(sender, col_gridSaleInvoices_Sales_id));
         var  form = new Sales.Invoice_Form(sale, SaleItem.getItems(sale.id), false);
         Tools.displayForm(form);
     }
     else if (Util.isColumnMatch(sender, e, col_gridSaleInvoices_SaleAmount))
     {
         var form = new Invoices.Payment_Form(typeof(Sale), (Guid)Util.getSelectedRowValue(sender, col_gridSaleInvoices_Sales_id));
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             populateGridSaleInvoices(true);
         }
     }
 }