예제 #1
0
        public void CarOut(string licensePlate, int camId)
        {
            Gate gate = Gates.FirstOrDefault(gt => gt.Id == camId);

            if (gate == null)
            {
                Form.Invoke((MethodInvoker) delegate { ConsoleLog.Add("Kameros klaida"); });
                return;
            }

            Vehicle vehicle = NotParkedVehicles.FirstOrDefault(veh => veh.LicensePlate == licensePlate);

            if (vehicle == null)
            {
                Form.Invoke((MethodInvoker) delegate { ConsoleLog.Add("Mašina sistemoje nerasta!!! " + licensePlate); });
                gate.OpenVehicle(licensePlate, false);
                return;
            }

            if (!vehicle.Paid)
            {
                if (ResidentsList.FirstOrDefault(s => s.LicensePlate == vehicle.LicensePlate) == null)
                {
                    Form.Invoke((MethodInvoker) delegate { ConsoleLog.Add("Važiuoja nesusimokėjus " + vehicle); });
                    return;
                }

                vehicle.Resident = true;
                vehicle.Paid     = true;
            }

            gate.OpenVehicle(licensePlate, false);
        }
예제 #2
0
        private async void ConvertToPDFExecute(object obj)
        {
            //show dialog
            var dlg = new System.Windows.Forms.FolderBrowserDialog();

            System.Windows.Forms.DialogResult result = dlg.ShowDialog();
            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            IsDataLoading = true;
            var path = dlg.SelectedPath;
            await Task.Run(() => XlsConverters.CreateExcelDoc(ResidentsList.ToList(), path));

            IsDataLoading = false;
        }
예제 #3
0
 public void RemoveResident(Resident resident)
 {
     ResidentsList.Remove(resident);
 }