public DatabaseModule() { db = new RecordsDataSet(); dbmgr = new TableAdapterManager(); qadp = new QueriesTableAdapter(); //Initialize Adapters for Reference Tables dbmgr.ClientTableAdapter = new ClientTableAdapter(); dbmgr.ItemTableAdapter = new ItemTableAdapter(); dbmgr.WarehouseTableAdapter = new WarehouseTableAdapter(); //Initialize Adapters for Transaction Tables dbmgr.ItemInventoryTableAdapter = new ItemInventoryTableAdapter(); dbmgr.ReturnsInventoryTableAdapter = new ReturnsInventoryTableAdapter(); dbmgr.ItemReturnedTableAdapter = new ItemReturnedTableAdapter(); dbmgr.InvoiceTableAdapter = new InvoiceTableAdapter(); dbmgr.InvoiceItemTableAdapter = new InvoiceItemTableAdapter(); dbmgr.InventoryMovementTableAdapter = new InventoryMovementTableAdapter(); dbmgr.ItemServedTableAdapter = new ItemServedTableAdapter(); dbmgr.ItemReturnedTableAdapter = new ItemReturnedTableAdapter(); dbmgr.ReturnServedTableAdapter = new ReturnServedTableAdapter(); }
private void invoice_fillDataGrid(RecordsDataSet.InvoiceRow invoice) { disp_grid_inv.Rows.Clear(); if (invoice != null) { RecordsDataSet.InvoiceItemRow[] rows = (from invoiceItem in db.InvoiceItem where invoiceItem.invoiceNo.Equals(invoice.invoiceNo) select invoiceItem).ToArray(); foreach (RecordsDataSet.InvoiceItemRow r in rows) { disp_grid_inv.Rows.Add(r.itemId, r.ItemRow.itemName, r.quantity, r.orderStatus); } } }
public bool ExcludeItemsInDataSet(IList <string> itemsToExclude) { try { if (DataSet != null) { FilteredDataSet = DataSet.CopyExcludingItems(itemsToExclude); } else { return(false); } return(true); } catch (Exception ex) { Logger.Log(ex.Message); return(false); } }
public void CopyExcludingItemsTest() { var dataSet = new RecordsDataSet { Headers = new List <string> { "test1", "test2", "test3", "test4", "test5" }, Records = new List <DynamicRecord> { new DynamicRecord(), new DynamicRecord(), new DynamicRecord(), new DynamicRecord(), new DynamicRecord(), } }; Assert.AreEqual(dataSet.Headers.Count, dataSet.Records.Count); var columnsToExlude = new List <string> { "test2", "test3", "test4" }; var newDataSet = dataSet.CopyExcludingItems(columnsToExlude); Assert.AreEqual(newDataSet.Headers.Count, dataSet.Headers.Count - columnsToExlude.Count); Assert.AreEqual(newDataSet.Records.Count, dataSet.Records.Count - columnsToExlude.Count); Assert.AreNotEqual(newDataSet.Headers.Count, dataSet.Headers.Count); Assert.AreNotEqual(newDataSet.Records.Count, dataSet.Records.Count); }
public void LoadItemSet(RecordsDataSet data) { DataSet = data; FilteredDataSet = data; }
/* * METHODS */ public void setWarehouse(RecordsDataSet.WarehouseRow warehouse) { this.warehouse = warehouse; }
private void showInvoiceInfo(RecordsDataSet.InvoiceRow invoice) { disp_client.Text = invoice.ClientRow.clientName; disp_date.Text = invoice.orderDate.ToShortDateString(); }
private int addInvoiceItems(RecordsDataSet.InvoiceRow invoice) { foreach (DataGridViewRow r in disp_grid.Rows) { DataGridViewCellCollection c = r.Cells; db.InvoiceItem.AddInvoiceItemRow( invoice, c["itemName"].Value as RecordsDataSet.ItemRow, (int)c["quantity"].Value, "PENDING"); } return disp_grid.Rows.Count; }