public MainWindow(IPCInfo pc) { InitializeComponent(); this.DataContext = (pc != null) ? new MainViewModel(pc) : new MainViewModel(new SystemInfo(), new PersonalInfo()); }
public static void Log(IPCInfo pc) { Tracer.Append($"Информирую о входе в систему."); var result = new Report <PCInfo>().Update(root + $@"certification/pc/log/", (PCInfo)pc); Tracer.Append($"Информация передана"); }
public static bool UpdatePcInfo(IPCInfo pc) { Tracer.Append($"Передаю информацию о системе на сервер"); var result = new Report <PCInfo>().Update(root + $@"certification/pc/{pc.id}/", (PCInfo)pc); Tracer.Append($"Информация {((result.IsSuccess)?"":"НЕ ")} передана."); return(result.IsSuccess); }
public MainViewModel(IPCInfo pc) { OVDList = Getway.LoadOvdInfo(); if (OVDList.Count == 0) { MainWindow.MayIGoOut = true; } ListPcInfo = new ObservableCollection <IPCInfo>(Getway.LoadPcInfo()); this.SystemParameters = new SystemInfo(); this.PersonalParameters = pc.GetPersonalInfo(); SelectedOVD = OVDList.First(x => x.Id == pc.ovd); if (pc.department != null) { SelectedDepartment = SelectedOVD.Departments?.First(x => x.Id == pc.department); } var obj = OVD.AllObjects.First(x => x.id == pc.@object); SelectedAttestObject = obj; FilterText = PersonalParameters.InventoryNumber; SelectedPc = pc; IsDropDownPcList = false; }
private static void ShowView(IPCInfo pc = null) { var view = new MainWindow(pc); view.Show(); }