Пример #1
0
 public MainWindow(IPCInfo pc)
 {
     InitializeComponent();
     this.DataContext = (pc != null)
         ? new MainViewModel(pc)
         : new MainViewModel(new SystemInfo(), new PersonalInfo());
 }
Пример #2
0
        public static void Log(IPCInfo pc)
        {
            Tracer.Append($"Информирую о входе в систему.");
            var result = new Report <PCInfo>().Update(root + $@"certification/pc/log/", (PCInfo)pc);

            Tracer.Append($"Информация передана");
        }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }
Пример #5
0
        private static void ShowView(IPCInfo pc = null)
        {
            var view = new MainWindow(pc);

            view.Show();
        }