private void populateDetails(Guid SaleID) { gridSummary.DataSource = SaleItem.getItemSummary(SaleID); gridSummary.Sort(col_gridsummary_code, ListSortDirection.Ascending); gridDetail.DataSource = SaleItem.getItems(SaleID); gridDetail.Sort(gridDetail.Columns[col_gridDetail_barcode.Name], ListSortDirection.Ascending); }
private void GridSales_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), col_gridSales_Sales_No.Name)) { Sale sale = new Sale(new Guid(gridSales.Rows[e.RowIndex].Cells[col_gridSales_Sales_Id.Name].Value.ToString())); var form = new Sales.Invoice_Form(sale, SaleItem.getItems(sale.id), false); Tools.displayForm(form); } }
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); } } }
/*******************************************************************************************************/ #region INITIALIZATION public Invoice_Form(Guid saleID) : this(new Sale(saleID), SaleItem.getItems(saleID), false) { }