Example #1
0
        public override void AddLogic(ICoatingScheduleLogic newController = null)
        {
            CoatingScheduleLine newLogic;

            if (newController != null)
            {
                newLogic = (CoatingScheduleLine)newController;
                newLogic.Connect(this);
                if (Control != null)
                {
                    Control.AddControlToBottom(newLogic);
                }
            }
            else
            {
                newLogic       = new CoatingScheduleLine();
                newLogic.Shift = GetNextShift();
                newLogic.Connect(this);
                if (Control != null)
                {
                    Control.AddControlToBottom(newLogic);
                }
                newLogic.AddLogic();
            }
            ChildrenLogic.Add(newLogic);
        }
Example #2
0
 public override void AddLogic(ICoatingScheduleLogic newController = null) //update with a picker window. include a default.
 {
     try
     {
         if (newController != null)
         {
             newController.CoatingLine = CoatingLine;
         }
         else
         {
             newController = new CoatingScheduleProduct(0, "", "", "", "")
             {
                 CoatingLine = CoatingLine
             };
         }
         ChildrenLogic.Add(newController);
         newController.Connect(this);
         if (Control != null)
         {
             Control.AddControlToBottom(newController);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
     }
 }
Example #3
0
 public override void AddLogic(ICoatingScheduleLogic newController = null)
 {
     if (newController == null)
     {
         foreach (string coatingLine in StaticFactoryValuesManager.CoatingLines)
         {
             CoatingScheduleShift newLogic = new CoatingScheduleShift();
             newLogic.CoatingLine = coatingLine;
             ChildrenLogic.Add(newLogic);
             newLogic.Connect(this);
             if (Control != null)
             {
                 Control.AddControlToBottom(newLogic);
             }
         }
     }
     else
     {
         ChildrenLogic.Add(newController);
         newController.Connect(this);
         if (Control != null)
         {
             Control.AddControlToBottom(newController);
         }
     }
 }
Example #4
0
 public CoatingScheduleLine(List <CoatingScheduleShift> shifts)
 {
     foreach (CoatingScheduleShift shift in shifts)
     {
         ChildrenLogic.Add(shift);
         shift.Connect(this);
         if (Control != null)
         {
             Control.AddControlToBottom(shift);
         }
     }
 }
Example #5
0
        public override void AddControlToTop(ICoatingScheduleLogic newController)
        {
            CoatingScheduleLine newLogic;

            if (newController != null)
            {
                if (newController.GetType() == typeof(CoatingScheduleLine))
                {
                    newLogic = (CoatingScheduleLine)newController;

                    newLogic.Shift = GetNextShift();
                    ChildrenLogic.Add(newLogic);
                    newLogic.Connect(this);
                    Control.AddControlToTop(newLogic);
                    newLogic.AddLogic();
                }
                else if (ChildrenLogic.Count > 0)
                {
                    ChildrenLogic[0].AddControlToTop(newController);
                }
                else
                {
                    newLogic = new CoatingScheduleLine();

                    newLogic.Date  = Date;
                    newLogic.Shift = GetNextShift();
                    ChildrenLogic.Add(newLogic);
                    newLogic.Connect(this);
                    Control.AddControlToTop(newLogic);
                    newLogic.AddLogic();

                    newLogic.AddControlToTop(newController);
                }
            }
            else
            {
                newLogic = new CoatingScheduleLine();

                newLogic.Date  = Date;
                newLogic.Shift = GetNextShift();
                ChildrenLogic.Add(newLogic);
                newLogic.Connect(this);
                Control.AddControlToTop(newLogic);
                newLogic.AddLogic();
            }
        }
        public override void AddLogic(ICoatingScheduleLogic newController = null)
        {
            CoatingScheduleDay newLogic;

            if (newController != null)
            {
                newLogic = (CoatingScheduleDay)newController;
            }
            else
            {
                newLogic      = new CoatingScheduleDay();
                newLogic.Date = GetNextDay();
            }
            ChildrenLogic.Add(newLogic);
            newLogic.Connect(this);
            if (Control != null)
            {
                Control.AddControlToBottom(newLogic);
            }
            UpdateDateText();
        }
Example #7
0
 public override void AddControlToBottom(ICoatingScheduleLogic upChild)
 {
     ChildrenLogic.Add(upChild);
     upChild.Connect(this);
     Control.AddControlToBottom(upChild);
 }