private void comboPartName_SelectedIndexChanged(object sender, EventArgs e) { try { if (comboPartName.Items.Count > 0) { if (comboPartName.SelectedItem == null) { return; } SelectedPartName = comboPartName.SelectedItem.ToString(); PopulateBoardList(); listLifetimeInfo1.Clear(); LifetimePartLimits = GCIDB.GetLifetimeLimits(SelectedPartName); LoadedLifetimeLimitID = LifetimePartLimits.LifetimeLimitID; if (LifetimePartLimits.LifetimeLimitID > 0) { LoadedPartID = GCIDB.GetPartID(SelectedPartName); ExistingSerialNumbers = GCIDB.GetSerialNumberList(SelectedPartName); } } } catch (Exception ex) { MessageBox.Show("comboPartName_SelectedIndexChanged(): " + ex.ToString()); } }
private void listParts_SelectedIndexChanged(object sender, EventArgs e) { if (PinsEdited == true || limitList1.HasEdits() == true || lifetimeLimits1.Edited == true) { // if (MessageBox.Show("There were changes made to the part.\nWould you like to save these changes to the database?", "Edits detected", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) // { SaveChanges(); //} } PinsEdited = false; limitList1.ClearAllEdits(); lifetimeLimits1.Edited = false; buttonSaveChanges.IsEnabled = false; if (listParts.Items.Count > 0) { if (listParts.SelectedItem == null) { return; } SelectedPartName = listParts.SelectedItem.ToString(); SelectedLifetimeLimitID = GCIDB.GetLifetimeLimitID(SelectedPartName); LoadedLimitData = GCIDB.GetProductionLimits(SelectedPartName); lifetimeLimits1.SetEnabled(true); if (SelectedLifetimeLimitID > 0) { LoadedLifetimeLimitData = GCIDB.GetLifetimeLimits(SelectedPartName); lifetimeLimits1.LCL = LoadedLifetimeLimitData.LowerRange; lifetimeLimits1.UCL = LoadedLifetimeLimitData.UpperRange; } else { lifetimeLimits1.LCL = Properties.Settings.Default.LifetimeLimit_DefaultLowerRange; lifetimeLimits1.UCL = Properties.Settings.Default.LifetimeLimit_DefaultUpperRange; } if (LoadedLimitData.Count > 0) { SelectedPartID = LoadedLimitData[0].PartID; SelectedProductionLimitID = LoadedLimitData[0].ProductionLimitID; } else { SelectedPartID = GCIDB.GetPartID(SelectedPartName); SelectedProductionLimitID = 0; } limitList1.ClearLimits(); foreach (LimitEntity Limit in LoadedLimitData) { limitList1.AddLimit(Limit); } buttonEditTestPins.IsEnabled = true; //buttonSaveChanges.IsEnabled = true; } }
private void newBoard_button_Click(object sender, RoutedEventArgs e) { AddBoard window = new AddBoard(); window.ShowDialog(); //AddBoard addBoard = new AddBoard(); //List<String> DeviceNames = window.GetNameList(); if (window.boolVal == true) { List <int> DUTPins = GCIDB.GetDUTPins(SelectedPartName); List <String> DeviceNames = window.GetNameList(); Byte CurrentGCIPin = 1; int SocketIndex = 0; int TestBoardID = GCIDB.GetNextTestBoardID(); int PartID = GCIDB.GetPartID(SelectedPartName); testBoardList1.ClearPins(); foreach (String Device in DeviceNames) { foreach (byte Pin in DUTPins) { //if (CurrentGCIPin == 48) // CurrentGCIPin += 4; GCIDB.AddTestPinMap(TestBoardID, window.BoardName, PartID, SocketIndex, Device, Pin, CurrentGCIPin, DateTime.Now); CurrentGCIPin++; //testBoardList1.AddPinMap(PartID, TestBoardID, Device, Pin, CurrentGCIPin++); } testBoardList1.ExtraSpace += 20; SocketIndex++; } //AddBoardControl window = new AddBoardControl(); //window.ShowDialog(); } List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName); //SelectedBoardName = string.Empty; selectBoard_listBox.ItemsSource = boardNames; }
private void buttonAddNewPart_Click(object sender, EventArgs e) { AddPartName AddPart = new AddPartName(); //AddPart partWindow = new AddPart(); AddPart.ShowDialog(); if (AddPart.closed) { int PartId = GCIDB.GetPartID(AddPart.PartName); if (PartId == 0) { GCIDB.AddPartID(AddPart.PartName); int LifetimeLimitID = GCIDB.AddNewLifetimeLimit(AddPart.PartName, Properties.Settings.Default.LifetimeLimit_DefaultLowerRange, Properties.Settings.Default.LifetimeLimit_DefaultUpperRange); GCIDB.SetLifetimeLimit(AddPart.PartName, LifetimeLimitID); PopulatePartList(); } // else //MessageBox.Show("Error partname already exists in database.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Console.Write(AddPart.PartName); }