Exemplo n.º 1
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            IErrorService errorService = new ErrorService();
            var           manager      = new ProductManager();

            try
            {
                using (var splash = new WorkingSplash())
                {
                    splash.DisableProgressBar();
                    splash.Show();
                    var t = new Task(() => manager.Load(manager.DefaultFeed, true));
                    t.Start();
                    t.Wait();
                }
            }
            catch (Exception e)
            {
                errorService.ShowError("An unrecoverable error occured. Please check the Event Log to see the details.", e);
                Application.Exit();
            }

            Application.Run(new DependencyCheckerForm(errorService, manager));
        }
 private bool ModelIsValid(IList selectedSpecificationData)
 {
     if (selectedSpecificationData == null || selectedSpecificationData.Count == 0)
     {
         ErrorService.ShowError(this, selectedSpecificationData.GetType().GetGenericArguments().First().Name, "Pole nie może być puste");
         return(false);
     }
     return(true);
 }
Exemplo n.º 3
0
        private void NewObjectAction_Executing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (((ListView)View).CollectionSource.GetCount() == specificCount)
            {
                newObjectViewController.NewObjectAction.Enabled.SetItemValue(disableNewAction, false);

                var selectedItemName = ((SingleChoiceAction)sender).SelectedItem.ToString();

                ErrorService.ShowError(this, selectedItemName, "Pole może posiadać tylko 1 numer.");

                e.Cancel = true;
            }
        }
Exemplo n.º 4
0
        private bool DataIsValid(CheckSubject currentObject, IList selectedSpecificationData)
        {
            if (selectedSpecificationData == null || selectedSpecificationData.Count == 0)
            {
                ErrorService.ShowError(this, selectedSpecificationData.GetType().GetGenericArguments().First().Name, "Pole nie może być puste");
                return(false);
            }
            if (currentObject.BankAccount == null || currentObject.BankAccount.Count == 0)
            {
                ErrorService.ShowError(this, currentObject.BankAccount.GetType().GetGenericArguments().First().Name, "Pole nie może być puste");
                return(false);
            }

            return(true);
        }