/
kiselevivan
/
serviceCenter
Обзор
Документация
Войти
/
kiselevivan
/
serviceCenter
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Windows/replaceUpgradeModuleWindow.xaml.cs
91 строка
3 KB
Ivan
added the function of upgrading and replacing modules in the repairer's interface
09 май 2021, 15:33
09 май 2021, 15:33
0c38d65
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace serviceCenter.Windows { public partial class replaceUpgradeModuleWindow : Window { public List<upgradeReplacement> UR { get; private set; } private clientDevice currentDevice; private employee currentEmployee; public replaceUpgradeModuleWindow(clientDevice device,employee employee) { InitializeComponent(); UR = new List<upgradeReplacement>(); currentDevice = device; currentEmployee = employee; updateModulesList(); } public replaceUpgradeModuleWindow(List<upgradeReplacement> ur,clientDevice device,employee employee) { InitializeComponent(); UR = ur; currentDevice = device; currentEmployee = employee; updateModulesList(); } private void updateModulesList() { dgModules.ItemsSource = UR.ToList(); } private void bAddModule_Click(object sender, RoutedEventArgs e) { Windows.selectModuleWindow w = new selectModuleWindow(); w.ShowDialog(); if (w.DialogResult == true) { w.currentURmodule.clientDevice = currentDevice; w.currentURmodule.employee = currentEmployee; UR.Add(w.currentURmodule); updateModulesList(); } } private void bDelModule_Click(object sender, RoutedEventArgs e) { UR.Remove(dgModules.SelectedItem as upgradeReplacement); updateModulesList(); } private void bSave_Click(object sender, RoutedEventArgs e) { DialogResult = true; Close(); } private void bCancel_Click(object sender, RoutedEventArgs e) { DialogResult = false; Close(); } private void bEdit_Click(object sender, RoutedEventArgs e) { Windows.selectModuleWindow w = new selectModuleWindow(dgModules.SelectedItem as upgradeReplacement); w.ShowDialog(); if (w.DialogResult == true) { UR.Remove(dgModules.SelectedItem as upgradeReplacement); w.currentURmodule.clientDevice = currentDevice; w.currentURmodule.employee = currentEmployee; UR.Add(w.currentURmodule); updateModulesList(); } } } }