Beispiel #1
0
        private void MapAreaRoomControl_MouseUp(object sender, MouseEventArgs e)
        {
            if (!_allowClickOptions)
            {
                return;                //disable click options in setup window.
            }
            if (e == null || e.Button != MouseButtons.Right)
            {
                if (e.Button == MouseButtons.Left && !IsFlashing && Status != "OnWay")
                {
                    if (_rectName.Contains(e.Location))
                    {
                        PhoneUI.EmployeeSettings(_phoneCur);
                        return;
                    }
                    if (_rectPhone.Contains(e.Location) && _phoneCur.PatNum != 0)
                    {
                        OnGoToChanged();
                    }
                }
                return;
            }
            bool allowStatusEdit = ClockEvents.IsClockedIn(EmployeeNum);

            if (EmployeeNum == Security.CurUser.EmployeeNum)           //can always edit yourself
            {
                allowStatusEdit = true;
            }
            if (Status == Phones.ConvertClockStatusToString(ClockStatusEnum.NeedsHelp))
            {
                //Always allow any employee to change any other employee from NeedsAssistance to Available
                allowStatusEdit = true;
            }
            string statusOnBehalfOf      = EmployeeName;
            bool   allowSetSelfAvailable = false;

            if (!ClockEvents.IsClockedIn(EmployeeNum) &&         //No one is clocked in at this extension.
                !ClockEvents.IsClockedIn(Security.CurUser.EmployeeNum))                    //This user is not clocked in either.
            {
                //Vacant extension and this user is not clocked in so allow this user to clock in at this extension.
                statusOnBehalfOf      = Security.CurUser.UserName;
                allowSetSelfAvailable = true;
            }
            AddToolstripGroup("menuItemStatusOnBehalf", "Status for: " + statusOnBehalfOf);
            AddToolstripGroup("menuItemRingGroupOnBehalf", "Queues for ext: " + Extension.ToString());
            AddToolstripGroup("menuItemClockOnBehalf", "Clock event for: " + EmployeeName);
            AddToolstripGroup("menuItemCustomer", "Customer: " + _phoneCur.CustomerNumber);
            AddToolstripGroup("menuItemEmployee", "Employee: " + EmployeeName);
            SetToolstripItemText("menuItemAvailable", allowStatusEdit || allowSetSelfAvailable);
            SetToolstripItemText("menuItemTraining", allowStatusEdit);
            SetToolstripItemText("menuItemTeamAssist", allowStatusEdit);
            SetToolstripItemText("menuItemNeedsHelp", allowStatusEdit);
            SetToolstripItemText("menuItemWrapUp", allowStatusEdit);
            SetToolstripItemText("menuItemOfflineAssist", allowStatusEdit);
            SetToolstripItemText("menuItemUnavailable", allowStatusEdit);
            SetToolstripItemText("menuItemTCResponder", allowStatusEdit);
            SetToolstripItemText("menuItemBackup", allowStatusEdit);
            SetToolstripItemText("menuItemLunch", allowStatusEdit);
            SetToolstripItemText("menuItemHome", allowStatusEdit);
            SetToolstripItemText("menuItemBreak", allowStatusEdit);
            menuItemGoTo.Enabled = true;
            if (_phoneCur.PatNum == 0)           //disable go to if not a current patient
            {
                menuItemGoTo.Enabled = false;
            }
            Point p = new Point(Location.X + e.Location.X, Location.Y + e.Location.Y);

            menuStatus.Show(Cursor.Position);
        }
 private void menuItemEmployeeSettings_Click(object sender,EventArgs e)
 {
     PhoneUI.EmployeeSettings(_phoneCur);
 }