private void DeleteTray() { if (SelectedTray == null) { return; } //if (SelectedTray.Status != TrayStatus.TS_Idle) //{ // // 警告:料盘装载中,无法删除 // return; //} if (SelectedTray.Placed) { // 警告:料盘装载中,无法删除 return; } foreach (var item in SelectedTray.Parts) { item.Placed = false; item.SlotNb = -1; item.TrayNb = -1; } Trays.Remove(SelectedTray); TraysRepository.UpdateTrays(Trays); }
private void LoadTrays() { if (SelectedTray == null || SelectedTrayInRack == null) { return; } //SelectedTrayInRack = SelectedTray; int index = SelectedTrayInRack.SlotNb; Rack.Trays[index - 1] = SelectedTray; Rack.Trays[index - 1].Status = TrayStatus.TS_Idle; Rack.Trays[index - 1].SlotNb = index; Rack.Trays[index - 1].Placed = true; Trays.Remove(SelectedTray); }