public IList <BOM> readAll(string filter) { List <BOM> recordset = new List <BOM>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT BOMHeaderKey, SIFHeaderKey, TopPartNumber, PartDescription, " + "Revision, InquiryNumber, AnnualVolume, MarketSector, SalesPerson, CustomerName, AssignedTo " + "FROM viewBOMHeader_ReadAll " + filter + " ORDER BY PartDescription"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { BOM bom = new BOM(); bom.Id = long.Parse(table.Rows[i][0].ToString()); bom.SifId = long.Parse(table.Rows[i][1].ToString()); bom.TopPartNumber = table.Rows[i][2].ToString(); bom.PartDescription = table.Rows[i][3].ToString(); bom.Revision = table.Rows[i][4].ToString(); bom.InquiryNumber = table.Rows[i][5].ToString(); bom.AnnualVolume = int.Parse(table.Rows[i][6].ToString()); bom.MarketSector = table.Rows[0][7].ToString(); bom.SalesPerson = table.Rows[0][8].ToString(); bom.CustomerName = table.Rows[0][9].ToString(); bom.AssignedTo = table.Rows[0][10].ToString(); recordset.Add(bom); } return(recordset); }
public IList <Supplier_Commodity> readAll() { List <Supplier_Commodity> recordset = new List <Supplier_Commodity>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT SupplierCommodityKey, SupplierKey, CommodityKey " + "FROM Supplier_Commodity " + "ORDER BY SupplierKey"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Supplier_Commodity supplier_Commodity = new Supplier_Commodity(); supplier_Commodity.Id = long.Parse(table.Rows[i][0].ToString()); supplier_Commodity.SupplierKey = long.Parse(table.Rows[i][1].ToString()); supplier_Commodity.CommodityKey = long.Parse(table.Rows[i][2].ToString()); recordset.Add(supplier_Commodity); } return(recordset); }
public IList <Token> readAll() { List <Token> recordset = new List <Token>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT TokenKey, Token, [Subject], SubjectKey, DeadDate, Acknowledgement FROM TokenMaster " + "ORDER BY TokenKey DESC"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Token token = new Token(); token.Id = long.Parse(table.Rows[i][0].ToString()); token.TokenNumber = table.Rows[i][1].ToString(); token.Subject = table.Rows[i][2].ToString(); token.SubjectKey = long.Parse(table.Rows[i][3].ToString()); token.DeadDate = DateTime.Parse(table.Rows[i][4].ToString()); token.Acnkowledgment = table.Rows[i][5].ToString(); recordset.Add(token); } return(recordset); }
public IList <MarketSector> readAll() { List <MarketSector> recordset = new List <MarketSector>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT MarketSectorID, Name " + "FROM MarketSector " + "ORDER BY Name"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { MarketSector marketSector = new MarketSector(); marketSector.Id = long.Parse(table.Rows[i][0].ToString()); marketSector.Name = table.Rows[i][1].ToString(); recordset.Add(marketSector); } return(recordset); }
public IList <Commodity> readAll() { List <Commodity> recordset = new List <Commodity>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT CommodityKey, CommodityCode, Commodity " + "FROM CommodityMaster ORDER BY Commodity"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Commodity commodity = new Commodity(); commodity.Id = long.Parse(table.Rows[i][0].ToString()); commodity.CommodityCode = table.Rows[i][1].ToString(); commodity.CommidityName = table.Rows[i][2].ToString(); recordset.Add(commodity); } return(recordset); }
public IList <Supplier> readAll() { List <Supplier> recordset = new List <Supplier>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT SupplierMasterKey, SupplierName, ManufacturingLocation, " + "ShipLocation, QuotedCurrency, ContactName, ContactPhoneNumber, ContactEmail, " + "Capabilities, Comments, Visible, Commodity, ContactCellPhoneNumber " + "FROM SupplierMaster ORDER BY SupplierName"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Supplier supplier = new Supplier(); supplier.Id = long.Parse(table.Rows[i][0].ToString()); supplier.SupplierName = table.Rows[i][1].ToString(); supplier.ManufacturingLocation = table.Rows[i][2].ToString(); supplier.ShipLocation = table.Rows[i][3].ToString(); supplier.QuotedCurrency = table.Rows[i][4].ToString(); supplier.ContactName = table.Rows[i][5].ToString(); supplier.ContactPhone = table.Rows[i][6].ToString(); supplier.ContactEmail = table.Rows[i][7].ToString(); supplier.Capabilities = table.Rows[i][8].ToString(); supplier.Comments = table.Rows[i][9].ToString(); supplier.Visible = bool.Parse(table.Rows[i][10].ToString()); supplier.Commodity = table.Rows[i][11].ToString(); supplier.ContactCellPhone = table.Rows[i][12].ToString(); recordset.Add(supplier); } return(recordset); }
public IList <Item> readAll() { List <Item> recordset = new List <Item>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT ItemMasterKey, PartNumber, Description, UM, Material, Cost, " + "CapsonicPN, CustomerPN, ManufacturePN, SupplierPN, CommCode " + "FROM ItemMaster ORDER BY PartNumber"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Item item = new Item(); item.Id = long.Parse(table.Rows[i][0].ToString()); item.PartNumber = table.Rows[i][1].ToString(); item.Description = table.Rows[i][2].ToString(); item.Um = table.Rows[i][3].ToString(); item.Material = table.Rows[i][4].ToString(); item.Cost = float.Parse(table.Rows[i][5].ToString()); item.CapsonicPN = table.Rows[i][6].ToString(); item.CustomerPN = table.Rows[i][7].ToString(); item.ManufacturePN = table.Rows[i][8].ToString(); item.SupplierPN = table.Rows[i][9].ToString(); item.CommCode = table.Rows[i][10].ToString(); //item.EAU = int.Parse(table.Rows[i][11].ToString()); recordset.Add(item); } return(recordset); }
public IList <Customer> readAll() { List <Customer> recordset = new List <Customer>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT CustomerKey, CustomerName FROM CustomerMaster ORDER BY CustomerName"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { Customer customer = new Customer(); customer.Id = long.Parse(table.Rows[i][0].ToString()); customer.CustomerName = table.Rows[i][1].ToString(); recordset.Add(customer); } return(recordset); }
public List <SalesReportDetail> readAllByBomHeaderKey(long id) { List <SalesReportDetail> recordset = new List <SalesReportDetail>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT distinct PartNumber, CapsonicPN, CustomerPN, ManufacturePN, SupplierPN, CommCode, Material, " + "VendorQuoteEst, Qty, EAU, MOQ, SupplierName, CapComAssm, PurchasingComments, ToolingDetail, " + "ProductionToolingLeadTime, BOMHeaderKey, LinePosition, [Status], " + "RFQStatus, TotalACost, ProductionTooling, [User], BOMDetailKey, " + "LeadTimeFirstProductionOrder, LeadTimePPAP_FAIR, LeadTimeNormalProductionOrders, EAUCalendarYears, Um, EAV_Status, " + "PrototypeTooling, CommentsToBuyer, Quote100ToPrint, ExceptionTo100ToPrint, PurchasingStatus, ReasonNoQuote, rfqHeaderKey " + "FROM viewSalesReportDetail " + "WHERE [BOMHeaderKey] = " + id + " ORDER BY LinePosition, BOMDetailKey"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { SalesReportDetail salesReportDetailLocal = new SalesReportDetail(); salesReportDetailLocal.PartNumber = table.Rows[i][0].ToString(); salesReportDetailLocal.CapsonicPN = table.Rows[i][1].ToString(); salesReportDetailLocal.CustomerPN = table.Rows[i][2].ToString(); salesReportDetailLocal.ManufacturePN = table.Rows[i][3].ToString(); salesReportDetailLocal.SupplierPN = table.Rows[i][4].ToString(); salesReportDetailLocal.CommCode = table.Rows[i][5].ToString(); salesReportDetailLocal.Material = table.Rows[i][6].ToString(); salesReportDetailLocal.VendorQuoteEst = table.Rows[i][7].ToString(); salesReportDetailLocal.Qty = float.Parse(table.Rows[i][8].ToString()); salesReportDetailLocal.EAU = table.Rows[i][9].ToString(); salesReportDetailLocal.MOQ = table.Rows[i][10].ToString(); salesReportDetailLocal.SupplierName = table.Rows[i][11].ToString(); salesReportDetailLocal.CapComAssm = table.Rows[i][12].ToString(); salesReportDetailLocal.PurchasingComments = table.Rows[i][13].ToString(); salesReportDetailLocal.ToolingDetail = table.Rows[i][14].ToString(); salesReportDetailLocal.ProductionToolingLeadTime = table.Rows[i][15].ToString(); salesReportDetailLocal.BOMHeaderKey = long.Parse(table.Rows[i][16].ToString()); salesReportDetailLocal.LinePosition = table.Rows[i][17].ToString(); salesReportDetailLocal.Status = table.Rows[i][18].ToString(); salesReportDetailLocal.RFQStatus = table.Rows[i][19].ToString(); salesReportDetailLocal.TotalACost = float.Parse(table.Rows[i][20].ToString()); salesReportDetailLocal.ProductionTooling = table.Rows[i][21].ToString(); salesReportDetailLocal.User = table.Rows[i][22].ToString(); salesReportDetailLocal.BOMDetailKey = long.Parse(table.Rows[i][23].ToString()); salesReportDetailLocal.LeadTimeFirstProductionOrder = table.Rows[i][24].ToString(); salesReportDetailLocal.LeadTimePPAPFAIR = table.Rows[i][25].ToString(); salesReportDetailLocal.LeadTimeNormalProductionOrders = table.Rows[i][26].ToString(); salesReportDetailLocal.EauCalendarYears = table.Rows[i][27].ToString(); salesReportDetailLocal.Um = table.Rows[i][28].ToString(); salesReportDetailLocal.Eau_status = table.Rows[i][29].ToString(); try { salesReportDetailLocal.PrototypeTooling = float.Parse(table.Rows[i][30].ToString()); } catch { } salesReportDetailLocal.CommentsToBuyer = table.Rows[i][31].ToString(); try { salesReportDetailLocal.Quote100ToDrawing = bool.Parse(table.Rows[i][32].ToString()); } catch { } salesReportDetailLocal.ExceptionsToDrawing = table.Rows[i][33].ToString(); try { salesReportDetailLocal.PurchasingStatus = table.Rows[i][34].ToString(); } catch { } salesReportDetailLocal.ReasonNoQuote = table.Rows[i][35].ToString(); try { salesReportDetailLocal.RfqHeaderKey = long.Parse(table.Rows[i][36].ToString()); } catch { } recordset.Add(salesReportDetailLocal); } return(recordset); }
public IList <BOMDetail> readAll() { List <BOMDetail> recordset = new List <BOMDetail>(); recordset.Clear(); DM = connectionManager.getDataManager(); string query = "SELECT BOMDetailKey, BOMHeaderKey, ItemMasterKey, Qty, Cost, [Status], Description, LinePosition, " + "SalesStatus, [User], PurchasingStatus, DirectedBuy, Material, Um, VendorQuoteEst, SalesComments, " + "PurchasingComments, CapComAssm, " + "CapsonicPN, CustomerPN, ManufacturePN, SupplierPN, CommCode, Sequence, AttachmentsFolder " + "FROM BOMDetail ORDER BY Sequence, LinePosition"; DataTable table = new DataTable(); table = DM.Execute_Query(query); for (int i = 0; i < table.Rows.Count; i++) { BOMDetail bomDetail = new BOMDetail(); bomDetail.Id = long.Parse(table.Rows[i][0].ToString()); if (table.Rows[i][1].ToString() != "") { bomDetail.BomHeaderKey = long.Parse(table.Rows[i][1].ToString()); } else { bomDetail.BomHeaderKey = -1; } if (table.Rows[i][2].ToString() != "") { bomDetail.ItemMasterkey = long.Parse(table.Rows[i][2].ToString()); } else { bomDetail.ItemMasterkey = -1; } if (table.Rows[i][3].ToString() != "") { bomDetail.Qty = float.Parse(table.Rows[i][3].ToString()); } else { bomDetail.Qty = -1; } if (table.Rows[i][4].ToString() != "") { bomDetail.Cost = float.Parse(table.Rows[i][4].ToString()); } else { bomDetail.Cost = -1; } bomDetail.Status = table.Rows[i][5].ToString(); bomDetail.Description = table.Rows[i][6].ToString(); bomDetail.LinePosition = table.Rows[i][7].ToString(); bomDetail.SalesStatus = table.Rows[i][8].ToString(); bomDetail.User = table.Rows[i][9].ToString(); bomDetail.PurchasingStatus = table.Rows[i][10].ToString(); bomDetail.DirectedBuy = bool.Parse(table.Rows[i][11].ToString()); bomDetail.Material = table.Rows[i][12].ToString(); bomDetail.Um = table.Rows[i][13].ToString(); bomDetail.VendorQuoteEst = table.Rows[i][14].ToString(); bomDetail.SalesComments = table.Rows[i][15].ToString(); bomDetail.PurchasingComments = table.Rows[i][16].ToString(); bomDetail.CapComAssm = table.Rows[i][17].ToString(); bomDetail.CapsonicPN = table.Rows[i][18].ToString(); bomDetail.CustomerPN = table.Rows[i][19].ToString(); bomDetail.ManufacturePN = table.Rows[i][20].ToString(); bomDetail.SupplierPN = table.Rows[i][21].ToString(); bomDetail.CommCode = table.Rows[i][22].ToString(); bomDetail.Sequence = int.Parse(table.Rows[i][23].ToString()); bomDetail.AttachmentsFolder = table.Rows[i][24].ToString(); bomDetail.internalAction = bomDetail.Status; recordset.Add(bomDetail); } return(recordset); }