/*******************************************************************************************************/ #region LIST private void populateGrid() { //sale barcode Guid?saleID = null; txtBarcode.Text = txtBarcode.Text.Trim(); if (!string.IsNullOrEmpty(txtBarcode.Text)) { if (!Tools.isHexNumber(txtBarcode.Text)) { Tools.hasMessage(String.Format("{0} is an invalid invoice barcode", txtBarcode.Text)); txtBarcode.Focus(); } else { try { saleID = Sale.getIDByBarcode(txtBarcode.Text); } catch { Tools.hasMessage(String.Format("{0} does not exist in database", txtBarcode.Text)); return; } } } //item barcode Guid?inventoryItemID = null; txtInventoryItemBarcode.Text = txtInventoryItemBarcode.Text.Trim(); if (!string.IsNullOrEmpty(txtInventoryItemBarcode.Text)) { if (!InventoryItem.isValidBarcode(txtInventoryItemBarcode.Text)) { txtInventoryItemBarcode.Focus(); } else { try { inventoryItemID = InventoryItem.getIDByBarcode(InventoryItem.getBarcodeWithoutPrefix(txtInventoryItemBarcode.Text)); } catch { Tools.hasMessage(String.Format("{0} does not exist in database", txtBarcode.Text)); return; } } } if (_startingMode == FormModes.Browse) { Util.setGridviewDataSource(grid, true, true, SaleReturn.get_by_BrowsingForFakturPajak_Customers_Id((Guid)_BrowsingForFakturPajak_Customers_Id)); } else { Util.setGridviewDataSource(grid, true, true, SaleReturn.get(idtp_StartDate.ValueAsStartDateFilter, idtp_EndDate.ValueAsEndDateFilter, inventoryItemID, (Guid?)cbCustomers.SelectedValue, saleID)); } }