示例#1
0
        public static void Break(Phone phone)
        {
            //verify that employee is logged in as user
            int  extension   = phone.Extension;
            long employeeNum = phone.EmployeeNum;

            if (!CheckUserCanChangeStatus(phone))
            {
                return;
            }
            try {
                ClockEvents.ClockOut(employeeNum, TimeClockStatus.Break);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);                //This message will tell user that they are already clocked out.
                return;
            }
            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Employee EmpCur = Employees.GetEmp(employeeNum);

            EmpCur.ClockStatus = Lan.g("enumTimeClockStatus", TimeClockStatus.Break.ToString());
            Employees.Update(EmpCur);
            Phones.SetPhoneStatus(ClockStatusEnum.Break, extension);
            PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
        }
 private void menuItemQueueBackup_Click(object sender, EventArgs e)
 {
     if (SetPhoneAvailable(ClockStatusEnum.Backup))
     {
         PhoneAsterisks.SetQueueForExtension(PhoneList[rowI].Extension, AsteriskQueues.Backup);
     }
 }
示例#3
0
        private void menuItemRinggroupsDefault_Click(object sender, EventArgs e)
        {
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneAsterisks.SetToDefaultRingGroups(extension, employeeNum);
        }
示例#4
0
 public static void QueueBackup(Phone phone)
 {
     if (!CheckUserCanChangeStatus(phone))
     {
         return;
     }
     PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.Backup);
 }
示例#5
0
 public static void RinggroupsDefault(PhoneTile tile)
 {
     if (!CheckUserCanChangeStatus(tile))
     {
         return;
     }
     PhoneAsterisks.SetToDefaultRingGroups(tile.PhoneCur.Extension, tile.PhoneCur.EmployeeNum);
 }
示例#6
0
        private void menuItemRinggroupNone_Click(object sender, EventArgs e)
        {
            //This even works if the person is still clocked in.
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneAsterisks.SetRingGroups(extension, AsteriskRingGroups.None);
        }
示例#7
0
 ///<summary>As of 10/9/13 Nathan wants backup ringgroup to go to 'None'. We may go back to using 'Backup' at some point, but for now it is not necessary so just set them to None.</summary>
 public static void RinggroupsBackup(PhoneTile tile)
 {
     if (!CheckUserCanChangeStatus(tile))
     {
         return;
     }
     PhoneAsterisks.SetRingGroups(tile.PhoneCur.Extension, AsteriskRingGroups.Backup);
 }
示例#8
0
 public static void QueueDefault(Phone phone)
 {
     if (!CheckUserCanChangeStatus(phone))
     {
         return;
     }
     PhoneAsterisks.SetToDefaultQueue(phone.EmployeeNum);
 }
示例#9
0
文件: PhoneUI.cs 项目: nampn/ODental
        public static void RinggroupsDefault(PhoneTile tile)
        {
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            PhoneAsterisks.SetToDefaultRingGroups(extension, employeeNum);
        }
示例#10
0
文件: PhoneUI.cs 项目: nampn/ODental
        public static void RinggroupNone(PhoneTile tile)
        {
            //This even works if the person is still clocked in.
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            PhoneAsterisks.SetRingGroups(extension, AsteriskRingGroups.None);
        }
示例#11
0
        private void menuItemBackup_Click(object sender, EventArgs e)
        {
            if (!ClockIn())
            {
                return;
            }
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            PhoneAsterisks.SetRingGroups(extension, AsteriskRingGroups.Backup);
            Phones.SetPhoneStatus(ClockStatusEnum.Backup, extension);
            FillEmps();
        }
示例#12
0
        public static void Available(Phone phone)
        {
            long employeeNum = Security.CurUser.EmployeeNum;

            if (Security.CurUser.EmployeeNum != phone.EmployeeNum)            //We are on someone else's tile. So Let's do some checks before we assume we can take over this extension.
            {
                if (phone.ClockStatus == ClockStatusEnum.NeedsHelp)
                {
                    //Allow the specific state where we are changing their status back from NeedsHelp to Available.
                    //This does not require any security permissions as any tech in can perform this action on behalf of any other tech.
                    Phones.SetPhoneStatus(ClockStatusEnum.Available, phone.Extension, phone.EmployeeNum);                  //green
                    return;
                }
                //We are on a tile that is not our own
                //If another employee is occupying this extension then assume we are trying to change that employee's status back to available.
                if (ClockEvents.IsClockedIn(phone.EmployeeNum))                  //This tile is taken by an employee who is clocked in.
                //Transition the employee back to available.
                {
                    ChangeTileStatus(phone, ClockStatusEnum.Available);
                    PhoneAsterisks.SetToDefaultQueue(phone.EmployeeNum);
                    return;
                }
                if (phone.ClockStatus != ClockStatusEnum.None &&
                    phone.ClockStatus != ClockStatusEnum.Home)
                {
                    //Another person is still actively using this extension.
                    MsgBox.Show(langThis, "Cannot take over this extension as it is currently occuppied by someone who is likely on Break or Lunch.");
                    return;
                }
                //If another employee is NOT occupying this extension then assume we are trying clock in at this extension.
                if (ClockEvents.IsClockedIn(employeeNum))                  //We are already clocked in at a different extension.
                {
                    MsgBox.Show(langThis, "You are already clocked in at a different extension.  You must clock out of the current extension you are logged into before moving to another extension.");
                    return;
                }
                //We got this far so fall through and allow user to clock in.
            }
            //We go here so all of our checks passed and we may login at this extension
            if (!ClockIn())              //Clock in on behalf of yourself
            {
                return;
            }
            //Update the Phone tables accordingly.
            PhoneEmpDefaults.SetAvailable(phone.Extension, employeeNum);
            PhoneAsterisks.SetToDefaultQueue(phone.EmployeeNum);
            Phones.SetPhoneStatus(ClockStatusEnum.Available, phone.Extension, employeeNum);          //green
        }
示例#13
0
文件: PhoneUI.cs 项目: nampn/ODental
        public static void Backup(PhoneTile tile)
        {
            if (!ClockIn(tile))
            {
                return;
            }
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            PhoneAsterisks.SetRingGroups(extension, AsteriskRingGroups.Backup);
            Phones.SetPhoneStatus(ClockStatusEnum.Backup, extension);
        }
示例#14
0
 ///<summary>Verify... 1) Security.CurUser is clocked in. 2) Target status change employee is clocked in. 3) Secruity.CurUser has TimecardsEditAll permission.</summary>
 private static bool ChangeTileStatus(PhoneTile tile, ClockStatusEnum newClockStatus)
 {
     if (!ClockEvents.IsClockedIn(Security.CurUser.EmployeeNum))              //Employee performing the action must be clocked in.
     {
         MsgBox.Show(langThis, "You must clock in before completing this action.");
         return(false);
     }
     if (!ClockEvents.IsClockedIn(tile.PhoneCur.EmployeeNum))              //Employee having action performed must be clocked in.
     {
         MessageBox.Show(Lan.g(langThis, "Target employee must be clocked in before setting this status: ") + tile.PhoneCur.EmployeeName);
         return(false);
     }
     if (!CheckUserCanChangeStatus(tile))
     {
         return(false);
     }
     PhoneEmpDefaults.SetAvailable(tile.PhoneCur.Extension, tile.PhoneCur.EmployeeNum);
     PhoneAsterisks.SetToDefaultRingGroups(tile.PhoneCur.Extension, tile.PhoneCur.EmployeeNum);
     Phones.SetPhoneStatus(newClockStatus, tile.PhoneCur.Extension);
     return(true);
 }
示例#15
0
        public static void Unavailable(Phone phone)
        {
            if (!ClockEvents.IsClockedIn(Security.CurUser.EmployeeNum))              //Employee performing the action must be clocked in.
            {
                MsgBox.Show("PhoneUI", "You must clock in before completing this action.");
                return;
            }
            if (!ClockEvents.IsClockedIn(phone.EmployeeNum))              //Employee having action performed must be clocked in.
            {
                MessageBox.Show(Lan.g("PhoneUI", "Target employee must be clocked in before setting this status:") + " " + phone.EmployeeName);
                return;
            }
            if (!CheckUserCanChangeStatus(phone))
            {
                return;
            }
            int             extension   = phone.Extension;
            long            employeeNum = phone.EmployeeNum;
            PhoneEmpDefault ped         = PhoneEmpDefaults.GetByExtAndEmp(extension, employeeNum);

            if (ped == null)
            {
                MessageBox.Show("PhoneEmpDefault (employee setting row) not found for Extension " + extension.ToString() + " and EmployeeNum " + employeeNum.ToString());
                return;
            }
            FormPhoneEmpDefaultEdit formPED = new FormPhoneEmpDefaultEdit();

            formPED.PedCur = ped;
            formPED.PedCur.StatusOverride = PhoneEmpStatusOverride.Unavailable;
            if (formPED.ShowDialog() == DialogResult.OK && formPED.PedCur.StatusOverride == PhoneEmpStatusOverride.Unavailable)
            {
                //This phone status update can get skipped from within the editor if the employee is not clocked in.
                //This would be the case when you are setting an employee other than yourself to Unavailable.
                //So we will set it here. This keeps the phone table and phone panel in sync.
                Phones.SetPhoneStatus(ClockStatusEnum.Unavailable, formPED.PedCur.PhoneExt, formPED.PedCur.EmployeeNum);
                PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
            }
        }
示例#16
0
        public static void Home(Phone phone)
        {
            //verify that employee is logged in as user
            int  extension   = phone.Extension;
            long employeeNum = phone.EmployeeNum;

            if (!CheckUserCanChangeStatus(phone))
            {
                return;
            }
            try {             //Update the clock event, phone (HQ only), and phone emp default (HQ only).
                ClockEvents.ClockOut(employeeNum, TimeClockStatus.Home);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);                //This message will tell user that they are already clocked out.
                return;
            }
            Employee EmpCur = Employees.GetEmp(employeeNum);

            EmpCur.ClockStatus = Lan.g("enumTimeClockStatus", TimeClockStatus.Home.ToString());
            Employees.Update(EmpCur);
            PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
        }
示例#17
0
 /// <summary>As per Nathan, changing status should set your ring group to None (not Backup as you might think). We are abandoning the Backup ring group for now.</summary>
 public static void Backup(PhoneTile tile)
 {
     ChangeTileStatus(tile, ClockStatusEnum.Backup);
     PhoneAsterisks.SetRingGroups(tile.PhoneCur.Extension, AsteriskRingGroups.None);
 }
 private void menuItemQueueDefault_Click(object sender, EventArgs e)
 {
     PhoneAsterisks.SetToDefaultQueue(PhoneList[rowI].EmployeeNum);
 }
 private void menuItemQueueNone_Click(object sender, EventArgs e)
 {
     //This even works if the person is still clocked out.
     PhoneAsterisks.SetQueueForExtension(PhoneList[rowI].Extension, AsteriskQueues.None);
 }
示例#20
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            //Using a switch statement in case we want special functionality for the other statuses later on.
            switch ((PhoneEmpStatusOverride)listStatusOverride.SelectedIndex)
            {
            case PhoneEmpStatusOverride.None:
                if (_pedOld.StatusOverride == PhoneEmpStatusOverride.Unavailable)
                {
                    MsgBox.Show(this, "Change your status from unavailable by using the small phone panel.");
                    return;
                }
                break;

            case PhoneEmpStatusOverride.OfflineAssist:
                if (_pedOld.StatusOverride == PhoneEmpStatusOverride.Unavailable)
                {
                    MsgBox.Show(this, "Change your status from unavailable by using the small phone panel.");
                    return;
                }
                break;
            }
            if (IsNew)
            {
                if (textEmployeeNum.Text == "")
                {
                    MsgBox.Show(this, "Unique EmployeeNum is required.");
                    return;
                }
                if (textEmpName.Text == "")
                {
                    MsgBox.Show(this, "Employee name is required.");
                    return;
                }
                PedCur.EmployeeNum = PIn.Long(textEmployeeNum.Text);
            }
            //Get the current database state of the phone emp default (before we change it)
            PhoneEmpDefault pedFromDatabase = PhoneEmpDefaults.GetOne(PedCur.EmployeeNum);

            if (pedFromDatabase == null)
            {
                pedFromDatabase = new PhoneEmpDefault();
            }
            else if (pedFromDatabase != null && IsNew)
            {
                MessageBox.Show("Employee Num already in use.\r\nEdit their current phone settings entry instead of creating a duplicate.");
                return;
            }
            int  newExtension    = PIn.Int(textPhoneExt.Text);
            bool extensionChange = pedFromDatabase.PhoneExt != newExtension;

            if (extensionChange)              //Only check when extension has changed and clocked in.
            //We need to prevent changes to phoneempdefault table which involve employees who are currently logged in.
            //Failing to do so would cause subtle race conditions between the phone table and phoneempdefault.
            //Net result would be the phone panel looking wrong.
            {
                if (ClockEvents.IsClockedIn(PedCur.EmployeeNum))                 //Prevent any change if employee being edited is currently clocked in.
                {
                    MsgBox.Show(this, "You must first clock out before making changes");
                    return;
                }
                //Find out if the target extension is already being occuppied by a different employee.
                Phone phoneOccuppied = Phones.GetPhoneForExtensionDB(PIn.Int(textPhoneExt.Text));
                if (phoneOccuppied != null)
                {
                    if (ClockEvents.IsClockedIn(phoneOccuppied.EmployeeNum))                      //Prevent change if employee's new extension is occupied by a different employee who is currently clocked in.
                    {
                        MessageBox.Show(Lan.g(this, "This extension cannot be inherited because it is currently occuppied by an employee who is currently logged in.\r\n\r\nExisting employee: ") + phoneOccuppied.EmployeeName);
                        return;
                    }
                    if (phoneOccuppied.EmployeeNum != PedCur.EmployeeNum)
                    {
                        //We are setting to a new employee so let's clean up the old employee.
                        //This will prevent duplicates in the phone table and subsequently prevent duplicates in the phone panel.
                        Phones.UpdatePhoneToEmpty(phoneOccuppied.EmployeeNum, -1);
                        PhoneEmpDefault pedOccuppied = PhoneEmpDefaults.GetOne(phoneOccuppied.EmployeeNum);
                        if (pedOccuppied != null)                       //prevent duplicate in phoneempdefault
                        {
                            pedOccuppied.PhoneExt = 0;
                            PhoneEmpDefaults.Update(pedOccuppied);
                        }
                    }
                }
                //Get the employee that is normally assigned to this extension (assigned ext set in the employee table).
                long permanentLinkageEmployeeNum = Employees.GetEmpNumAtExtension(pedFromDatabase.PhoneExt);
                if (permanentLinkageEmployeeNum >= 1)                      //Extension is nomrally assigned to an employee.
                {
                    if (PedCur.EmployeeNum != permanentLinkageEmployeeNum) //This is not the normally linked employee so let's revert back to the proper employee.
                    {
                        PhoneEmpDefault pedRevertTo = PhoneEmpDefaults.GetOne(permanentLinkageEmployeeNum);
                        //Make sure the employee we are about to revert is not logged in at yet a different workstation. This would be rare but it's worth checking.
                        if (pedRevertTo != null && !ClockEvents.IsClockedIn(pedRevertTo.EmployeeNum))
                        {
                            //Revert to the permanent extension for this PhoneEmpDefault.
                            pedRevertTo.PhoneExt = pedFromDatabase.PhoneExt;
                            PhoneEmpDefaults.Update(pedRevertTo);
                            //Update phone table to match this change.
                            Phones.SetPhoneStatus(ClockStatusEnum.Home, pedRevertTo.PhoneExt, pedRevertTo.EmployeeNum);
                        }
                    }
                }
            }
            //Ordering of these updates is IMPORTANT!!!
            //Phone Emp Default must be updated first
            PedCur.EmpName        = textEmpName.Text;
            PedCur.IsGraphed      = checkIsGraphed.Checked;
            PedCur.HasColor       = checkHasColor.Checked;
            PedCur.RingGroups     = (AsteriskQueues)listRingGroup.SelectedIndex;
            PedCur.PhoneExt       = PIn.Int(textPhoneExt.Text);
            PedCur.StatusOverride = (PhoneEmpStatusOverride)listStatusOverride.SelectedIndex;
            PedCur.Notes          = textNotes.Text;
            if (comboSite.SelectedIndex > -1)
            {
                PedCur.SiteNum = ((ODBoxItem <Site>)comboSite.SelectedItem).Tag.SiteNum;
            }
            PedCur.IsPrivateScreen  = true;         //we no longer capture screen shots.
            PedCur.IsTriageOperator = checkIsTriageOperator.Checked;
            if (IsNew)
            {
                PhoneEmpDefaults.Insert(PedCur);
                //insert a new Phone record to keep the 2 tables in sync an entry for the new extension in the phone table doesn't already exist.
                if (PedCur.PhoneExt != 0 && Phones.GetPhoneForExtensionDB(PedCur.PhoneExt) == null)
                {
                    Phone phoneNew = new Phone();
                    phoneNew.EmployeeName = PedCur.EmpName;
                    phoneNew.EmployeeNum  = PedCur.EmployeeNum;
                    phoneNew.Extension    = PedCur.PhoneExt;
                    phoneNew.ClockStatus  = ClockStatusEnum.Home;
                    Phones.Insert(phoneNew);
                }
            }
            else
            {
                PhoneEmpDefaults.Update(PedCur);
            }
            //It is now safe to update Phone table as it will draw from the newly updated Phone Emp Default row
            if ((PhoneEmpStatusOverride)listStatusOverride.SelectedIndex == PhoneEmpStatusOverride.Unavailable &&
                ClockEvents.IsClockedIn(PedCur.EmployeeNum))
            {
                //We set ourselves unavailable from this window because we require an explanation.
                //This is the only status that will synch with the phone table, all others should be handled by the small phone panel.
                Phones.SetPhoneStatus(ClockStatusEnum.Unavailable, PedCur.PhoneExt, PedCur.EmployeeNum);
            }
            if (extensionChange)
            {
                //Phone extension has changed so update the phone table as well.
                //We have already guaranteed that this employee is Clocked Out (above) so set to home and update phone table.
                Phones.SetPhoneStatus(ClockStatusEnum.Home, PedCur.PhoneExt, PedCur.EmployeeNum);
            }
            //The user just flagged themselves as a triage operator
            //OR
            //This user used to be a triage operator and they no longer want to be one which will need their ring group set back to their default.
            if ((!_pedOld.IsTriageOperator && checkIsTriageOperator.Checked) ||
                (_pedOld.IsTriageOperator && !checkIsTriageOperator.Checked))
            {
                //Set the queue for this phone emp default to whatever the current ClockStatus is for the phone row associated to this PED.
                PhoneAsterisks.SetQueueForClockStatus(PedCur);
            }
            DialogResult = DialogResult.OK;
        }
示例#21
0
        private void FillData()
        {
            labelDate.Text = dateShowing.ToString("dddd, MMMM d");
            listCalls      = new List <PointF>();
            if (dateShowing.DayOfWeek == DayOfWeek.Friday)
            {
                listCalls.Add(new PointF(5f, 0));
                listCalls.Add(new PointF(5.5f, 50));               //5-6am
                listCalls.Add(new PointF(6.5f, 133));
                listCalls.Add(new PointF(7.5f, 210));
                listCalls.Add(new PointF(8.5f, 332));
                listCalls.Add(new PointF(9f, 360));               //-
                listCalls.Add(new PointF(9.5f, 370));             //was 380
                listCalls.Add(new PointF(10f, 360));              //-
                listCalls.Add(new PointF(10.5f, 352));            //was 348
                listCalls.Add(new PointF(11.5f, 352));
                listCalls.Add(new PointF(12.5f, 340));            //was 313
                listCalls.Add(new PointF(13.5f, 325));            //was 363
                listCalls.Add(new PointF(14.5f, 277));
                listCalls.Add(new PointF(15.5f, 185));
                listCalls.Add(new PointF(16.5f, 141));
                listCalls.Add(new PointF(17f, 50));
                listCalls.Add(new PointF(17.0f, 0));
            }
            else
            {
                listCalls.Add(new PointF(5f, 0));
                listCalls.Add(new PointF(5.5f, 284));               //5-6am
                listCalls.Add(new PointF(6.5f, 767));
                listCalls.Add(new PointF(7.5f, 1246));
                listCalls.Add(new PointF(8.5f, 1753));
                listCalls.Add(new PointF(9f, 1920));               //-
                listCalls.Add(new PointF(9.5f, 2000));             //was 2029
                listCalls.Add(new PointF(10f, 1950));              //-
                listCalls.Add(new PointF(10.5f, 1875));            //1846
                listCalls.Add(new PointF(11.5f, 1890));            //1899
                listCalls.Add(new PointF(12.5f, 1820));
                listCalls.Add(new PointF(13.5f, 1807));
                listCalls.Add(new PointF(14.5f, 1565));
                listCalls.Add(new PointF(15.5f, 1178));
                listCalls.Add(new PointF(16.5f, 733));
                listCalls.Add(new PointF(17.5f, 226));
                listCalls.Add(new PointF(17.5f, 0));
            }
            buckets = new float[28];          //every 30 minutes, starting at 5:15
            //usedLunch=new bool[28];
            List <Schedule> scheds = Schedules.GetDayList(dateShowing);
            TimeSpan        time1;
            TimeSpan        time2;
            TimeSpan        delta;

            for (int i = 0; i < scheds.Count; i++)
            {
                if (scheds[i].SchedType != ScheduleType.Employee)
                {
                    continue;
                }
                if (PhoneEmpDefaults.IsNoGraph(scheds[i].EmployeeNum, ListPED))
                {
                    continue;
                }
                //TimeSpan lunch=scheds[i].StartTime + new TimeSpan((scheds[i].StopTime-scheds[i].StartTime).Ticks/2) - new TimeSpan(0,37,0);//subtract 37 minutes to make it fall within a bucket, and because people seem to like to take lunch early, and because the logic will bump it forward if lunch already used.
                for (int b = 0; b < buckets.Length; b++)
                {
                    time1 = new TimeSpan(5, 0, 0) + new TimeSpan(0, b * 30, 0);
                    time2 = new TimeSpan(5, 30, 0) + new TimeSpan(0, b * 30, 0);
                    //if the lunchtime is within this bucket

                    /*if(lunch >= time1 && lunch < time2) {
                     *      if(usedLunch[b]) {//can't use this bucket for lunch because someone else already did.
                     *              lunch+=new TimeSpan(0,30,0);//move lunch forward half an hour
                     *      }
                     *      else {
                     *              usedLunch[b]=true;
                     *              continue;//used this bucket for lunch (don't add a drop to the bucket)
                     *      }
                     * }*/
                    //situation 1: this bucket is completely within the start and stop times.
                    if (scheds[i].StartTime <= time1 && scheds[i].StopTime >= time2)
                    {
                        buckets[b] += 1;
                    }
                    //situation 2: the start time is after this bucket
                    else if (scheds[i].StartTime >= time2)
                    {
                        continue;
                    }
                    //situation 3: the stop time is before this bucket
                    else if (scheds[i].StopTime <= time1)
                    {
                        continue;
                    }
                    //situation 4: start time falls within this bucket
                    if (scheds[i].StartTime > time1)
                    {
                        delta       = scheds[i].StartTime - time1;
                        buckets[b] += (float)delta.TotalHours * 2f;                       //example, .5 hours would add 1 to the bucket
                    }
                    //situation 5: stop time falls within this bucket
                    if (scheds[i].StopTime < time2)
                    {
                        delta       = time2 - scheds[i].StopTime;
                        buckets[b] += (float)delta.TotalHours * 2f;
                    }
                }
                //break;//just show one sched for debugging.
            }
            //missed calls
            missedCalls = new int[28];
            List <DateTime> callTimes = PhoneAsterisks.GetMissedCalls(dateShowing);

            for (int i = 0; i < callTimes.Count; i++)
            {
                for (int b = 0; b < missedCalls.Length; b++)
                {
                    time1 = new TimeSpan(5, 0, 0) + new TimeSpan(0, b * 30, 0);
                    time2 = new TimeSpan(5, 30, 0) + new TimeSpan(0, b * 30, 0);
                    if (callTimes[i].TimeOfDay >= time1 && callTimes[i].TimeOfDay < time2)
                    {
                        missedCalls[b]++;
                    }
                }
            }
            this.Invalidate();
        }
示例#22
0
 public static void Training(Phone phone)
 {
     ChangeTileStatus(phone, ClockStatusEnum.Training);
     PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
 }
示例#23
0
 public static void OfflineAssist(Phone phone)
 {
     ChangeTileStatus(phone, ClockStatusEnum.OfflineAssist);
     PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
 }
示例#24
0
 public static void TCResponder(Phone phone)
 {
     ChangeTileStatus(phone, ClockStatusEnum.TCResponder);
     PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None);
 }
示例#25
0
 public static void Backup(Phone phone)
 {
     ChangeTileStatus(phone, ClockStatusEnum.Backup);
     PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.Backup);
 }