Beispiel #1
0
 protected void FireMissing(MissingEventArgs args)
 {
     if (OnMissing != null)
     {
         OnMissing(args);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Checks existing portions sequense. If sequences are not equal - generates arrays of existing and missinf elements
        /// portionList - list of existing portions
        /// controlList - list of control values
        /// </summary>
        private void CheckProjectSequence(Project project, int portionNumber)
        {
            List <int> portionList = importRepo.PortionRepo.CheckPortionSequence(project);
            List <int> controlList = (portionNumber == 1) ? new List <int>()
            {
                0
            } : Enumerable.Range(1, portionNumber - 1).ToList();

            if (!portionList.SequenceEqual(controlList))
            {
                MissingEventArgs args = new MissingEventArgs();
                args.MillName         = project.MillName;
                args.ExistingPortions = portionList.ToArray <int>();
                args.MissingPortions  = (from i in controlList let found = portionList.Any(j => j == i) where !found select i).ToArray <int>();
                FireMissing(args);
            }
        }
Beispiel #3
0
 protected void FireMissing(MissingEventArgs args)
 {
     if (OnMissing != null)
         OnMissing(args);
 }
Beispiel #4
0
 private void MissingPortionsDialogCreation(MissingEventArgs args)
 {
     MissingPortionsDialog dialog = new MissingPortionsDialog(args.ExistingPortions, args.MissingPortions, args.MillName);
     dialog.ShowDialog();
     if (dialog.DialogResult != System.Windows.Forms.DialogResult.No)
     {
         importer.TaskIsCancelled = true;
     }
 }
Beispiel #5
0
 void importer_OnMissing(MissingEventArgs args)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action(() => { MissingPortionsDialogCreation(args); }));
     }
     else
     {
         MissingPortionsDialogCreation(args);
     }
 }