public void removeAlarm(PartAlarm pa)
        {
            partAlarmsPanel.Controls.Remove(pa);

            if (information.isUnqueued(pa))
            {
                information.removeUnqueuedAlarm(pa);
            }
            else
            {
                information.removeAlarm(pa);
            }

            List <PartAlarm> paList = new List <PartAlarm>();

            foreach (PartAlarm p in partAlarmsPanel.Controls)
            {
                paList.Add(p);
            }

            foreach (PartAlarm p in paList)
            {
                partAlarmsPanel.Controls.Remove(p);
            }

            foreach (PartAlarm p in paList)
            {
                slideUpAlarm(p);
            }
        }
        public void personalAlarmIsInQueue(PartAlarm pa, Card c)
        {
            removeAlarm(pa);
            String alarmTime = pa.getAlarmTime();

            partAlarmsPanel.AutoScrollPosition = new Point(0, 0);
            PartAlarm pa1       = new PartAlarm(pa.getPartType(), pa.getLine(), pa.getStation(), alarmTime, pa.getDeskNot(), pa.getEmailNot(), pa.getN(), c, this);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            if (c != null)
            {
                if (c.getTimeRemaining() / 60 >= Int32.Parse(alarmTime))
                {
                    information.addAlarm(pa1);
                    pa1.update_alarm(); //gotta set the timer
                    pa1.startTimer();   //gotta start the timer
                }
            }
            else
            {
                Debug.WriteLine("card is still null");
                information.addAlarmNotQueued(pa1);
            }
        }
        private void slideUpAlarm(PartAlarm pa1)
        {
            int numAlarms = partAlarmsPanel.Controls.Count;
            int locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
        }
Exemple #4
0
        public void addAlarmtoPanel(String partType, String lineNum, String station, String alarmTime, Boolean desktopNotification, Boolean emailNotification, int n, Timer timer1)
        {
            PartAlarm pa1       = new PartAlarm(partType, lineNum, station, alarmTime, desktopNotification, emailNotification, n, timer1);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            alarms.Add(pa1);
            information.addAlarm(pa1);
        }
        public void addAlarmtoPanel(string partType, string lineNum, string station, string alarmTime, bool desktopNotification, bool emailNotification, int n, Timer timer1)
        {
            partAlarmsPanel.AutoScrollPosition = new Point(0, 0);
            Card      c         = information.getCard(partType, Int32.Parse(lineNum));
            PartAlarm pa1       = new PartAlarm(partType, lineNum, station, alarmTime, desktopNotification, emailNotification, n, c, this);
            int       numAlarms = partAlarmsPanel.Controls.Count;
            int       locY      = numAlarms * pa1.Height + 10 * numAlarms;

            pa1.Location = new Point(partAlarmsPanel.Location.X + partAlarmsPanel.Width / 2 - pa1.Width / 2, locY);
            partAlarmsPanel.Controls.Add(pa1);
            if (c != null)
            {
                if (c.getTimeRemaining() / 60 >= Int32.Parse(alarmTime))
                {
                    information.addAlarm(pa1);
                    pa1.update_alarm(); //gotta set the timer
                    pa1.startTimer();   //gotta start the timer
                }
            }
            else
            {
                information.addAlarmNotQueued(pa1);
            }
        }
Exemple #6
0
 public void removeAlarm(PartAlarm pa)
 {
     this.alarms.Remove(pa);
 }
Exemple #7
0
 public void addAlarm(PartAlarm pa)
 {
     this.alarms.Add(pa);
 }
Exemple #8
0
 public void removeAlarm(PartAlarm pa)
 {
     alarms.Remove(pa);
     partAlarmsPanel.Controls.Remove(pa);
     information.removeAlarm(pa);
 }
Exemple #9
0
 public bool isUnqueued(PartAlarm pa)
 {
     return(this.alarmsNotQueued.Contains(pa));
 }
Exemple #10
0
 public void removeUnqueuedAlarm(PartAlarm pa)
 {
     this.alarmsNotQueued.Remove(pa);
 }
Exemple #11
0
 public void addAlarmNotQueued(PartAlarm pa)
 {
     this.alarmsNotQueued.Add(pa);
 }