예제 #1
0
 public static void QueueDefault(Phone phone)
 {
     if (!CheckUserCanChangeStatus(phone))
     {
         return;
     }
     PhoneAsterisks.SetToDefaultQueue(phone.EmployeeNum);
 }
예제 #2
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
        }
예제 #3
0
 private void menuItemQueueDefault_Click(object sender, EventArgs e)
 {
     PhoneAsterisks.SetToDefaultQueue(PhoneList[rowI].EmployeeNum);
 }