Ejemplo n.º 1
0
        private void gridGraph_CellClick(object sender, ODGridClickEventArgs e)
        {
            //only allow clicking on the 'Desired Graph Status' column
            if (e.Col != 3 || gridGraph.Rows[e.Row].Tag == null || !(gridGraph.Rows[e.Row].Tag is PhoneEmpDefault))
            {
                return;
            }
            PhoneEmpDefault phoneEmpDefault = (PhoneEmpDefault)gridGraph.Rows[e.Row].Tag;
            bool            uiGraphStatus   = gridGraph.Rows[e.Row].Cells[e.Col].Text.ToLower() == "x";
            bool            dbGraphStatus   = PhoneEmpDefaults.GetGraphedStatusForEmployeeDate(phoneEmpDefault.EmployeeNum, DateEdit);

            if (uiGraphStatus != dbGraphStatus)
            {
                MessageBox.Show(Lan.g(this, "Graph status has changed unexpectedly for employee: ") + phoneEmpDefault.EmpName + Lan.g(this, ". Exit and reopen this form, and try again."));
                return;
            }
            //flip the bit in the db and reload the grid
            PhoneGraph pg = new PhoneGraph();

            pg.EmployeeNum = phoneEmpDefault.EmployeeNum;
            pg.DateEntry   = DateEdit;
            pg.IsGraphed   = !uiGraphStatus;         //flip the bit
            PhoneGraphs.InsertOrUpdate(pg);          //update the db
            FillGrid();
        }
Ejemplo n.º 2
0
        public static void Unavailable(PhoneTile tile)
        {
            if (!ClockIn(tile))
            {
                return;
            }
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            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.ShowDialog();
            Phones.SetPhoneStatus(ClockStatusEnum.Unavailable, extension);
        }
Ejemplo n.º 3
0
        private void FillTiles(bool refreshList)
        {
            if (refreshList)              //Refresh the phone list. This will cause a database refresh for our list and call this function again with the new list.
            {
                SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), ChatUsers.GetAll());
                return;
            }
            if (PhoneList == null)
            {
                return;
            }
            PhoneTile tile;

            for (int i = 0; i < TileCount; i++)
            {
                //Application.DoEvents();
                Control[] controlMatches = Controls.Find("phoneTile" + (i + 1).ToString(), false);
                if (controlMatches.Length == 0)               //no match found for some reason.
                {
                    continue;
                }
                tile                 = ((PhoneTile)controlMatches[0]);
                tile.TimeDelta       = timeDelta;
                tile.ShowImageForced = checkBoxAll.Checked;
                if (PhoneList.Count > i)
                {
                    tile.SetPhone(PhoneList[i], PhoneEmpDefaults.GetEmpDefaultFromList(PhoneList[i].EmployeeNum, PhoneEmpDefaultList),
                                  ChatList.Where(x => x.Extension == PhoneList[i].Extension).FirstOrDefault(), PhoneEmpDefaults.IsTriageOperatorForExtension(PhoneList[i].Extension, PhoneEmpDefaultList));
                }
                else
                {
                    Controls.Remove(tile);
                }
            }
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        private void menuItemBreak_Click(object sender, EventArgs e)
        {
            //verify that employee is logged in as user
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            if (PrefC.GetBool(PrefName.TimecardSecurityEnabled))
            {
                if (Security.CurUser.EmployeeNum != employeeNum)
                {
                    if (!Security.IsAuthorized(Permissions.TimecardsEditAll))
                    {
                        MsgBox.Show(this, "Not authorized.");
                        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);
            FillEmps();
        }
Ejemplo n.º 6
0
        public static void Break(PhoneTile tile)
        {
            //verify that employee is logged in as user
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (Security.CurUser.EmployeeNum != employeeNum)
            {
                if (!Security.IsAuthorized(Permissions.TimecardsEditAll, true))
                {
                    if (!CheckSelectedUserPassword(employeeNum))
                    {
                        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);
        }
Ejemplo n.º 7
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     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);
     }
     PedCur.EmpName         = textEmpName.Text;
     PedCur.NoGraph         = checkNoGraph.Checked;
     PedCur.NoColor         = checkNoColor.Checked;
     PedCur.RingGroups      = (AsteriskRingGroups)listRingGroup.SelectedIndex;
     PedCur.PhoneExt        = PIn.Int(textPhoneExt.Text);
     PedCur.StatusOverride  = (PhoneEmpStatusOverride)listStatusOverride.SelectedIndex;
     PedCur.Notes           = textNotes.Text;
     PedCur.ComputerName    = textComputerName.Text;
     PedCur.IsPrivateScreen = checkIsPrivateScreen.Checked;
     if (IsNew)
     {
         PhoneEmpDefaults.Insert(PedCur);
     }
     else
     {
         PhoneEmpDefaults.Update(PedCur);
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 8
0
        private void FillGrid()
        {
            int  sortedColumnIdx = gridMain.SortedByColumnIdx;
            bool isSortAsc       = gridMain.SortedIsAscending;

            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("EmployeeNum", 80, GridSortingStrategy.AmountParse);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("EmpName", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("IsGraphed", 65, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("HasColor", 60, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Queue", 65);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("PhoneExt", 55, GridSortingStrategy.AmountParse);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("StatusOverride", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Notes", 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Private", 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Triage", 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            ListPED = PhoneEmpDefaults.Refresh();
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListPED.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ListPED[i].EmployeeNum.ToString());
                row.Cells.Add(ListPED[i].EmpName);
                row.Cells.Add(ListPED[i].IsGraphed?"X":"");
                row.Cells.Add(ListPED[i].HasColor?"X":"");
                row.Cells.Add(ListPED[i].RingGroups.ToString());
                row.Cells.Add(ListPED[i].PhoneExt.ToString());
                if (ListPED[i].StatusOverride == PhoneEmpStatusOverride.None)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListPED[i].StatusOverride.ToString());
                }
                row.Cells.Add(ListPED[i].Notes);
                row.Cells.Add(ListPED[i].IsPrivateScreen?"X":"");
                row.Cells.Add(ListPED[i].IsTriageOperator?"X":"");
                row.Tag = ListPED[i];
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            gridMain.SortForced(sortedColumnIdx, isSortAsc);
        }
Ejemplo n.º 9
0
 private void FormGraphEmployeeTime_Load(object sender, EventArgs e)
 {
     butEdit.Visible = Security.IsAuthorized(Permissions.Schedules);
     ListPED         = PhoneEmpDefaults.Refresh();
     DateShowing     = AppointmentL.DateSelected.Date;
     //fill in the missing PhoneGraph entries for today
     PhoneGraphs.AddMissingEntriesForToday(ListPED);
     FillData();
 }
Ejemplo n.º 10
0
        private void FillGrid()
        {
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("EmployeeNum", 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("EmpName", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("IsGraphed", 65, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("HasColor", 60, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("RingGroup", 65);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("PhoneExt", 55);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("StatusOverride", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Notes", 250);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("ComputerName", 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Private", 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn("Triage", 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            ListPED = PhoneEmpDefaults.Refresh();
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < ListPED.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(ListPED[i].EmployeeNum.ToString());
                row.Cells.Add(ListPED[i].EmpName);
                row.Cells.Add(ListPED[i].IsGraphed?"X":"");
                row.Cells.Add(ListPED[i].HasColor?"X":"");
                row.Cells.Add(ListPED[i].RingGroups.ToString());
                row.Cells.Add(ListPED[i].PhoneExt.ToString());
                if (ListPED[i].StatusOverride == PhoneEmpStatusOverride.None)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(ListPED[i].StatusOverride.ToString());
                }
                row.Cells.Add(ListPED[i].Notes);
                row.Cells.Add(ListPED[i].ComputerName);
                row.Cells.Add(ListPED[i].IsPrivateScreen?"X":"");
                row.Cells.Add(ListPED[i].IsTriageOperator?"X":"");
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Ejemplo n.º 11
0
 private void FillTiles(bool doRefreshList)
 {
     if (doRefreshList)              //Refresh the phone list. This will cause a database refresh for our list and call this function again with the new list.
     {
         SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), ChatUsers.GetAll());
         return;
     }
     Invalidate();
 }
Ejemplo n.º 12
0
        private void FormPhoneTiles_Load(object sender, EventArgs e)
        {
#if !DEBUG
            if (Environment.MachineName.ToLower() != "jordans" &&
                Environment.MachineName.ToLower() != "nathan")
            {
                checkBoxAll.Visible = false;                      //so this will also be visible in debug
            }
#endif
            timeDelta = MiscData.GetNowDateTime() - DateTime.Now;
            PhoneTile tile;
            int       x = 0;
            int       y = 0;
            SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), ChatUsers.GetAll(), false);         //Do not call FillTiles() yet. Need to create PhoneTile controls first.
            for (int i = 1; i < TileCount + 1; i++)
            {
                tile                      = new PhoneTile();
                tile.Name                 = "phoneTile" + (i).ToString();
                tile.Location             = new Point(tile.Width * x, butOverride.Bottom + 15 + (tile.Height * y));
                tile.GoToChanged         += new System.EventHandler(this.phoneTile_GoToChanged);
                tile.SelectedTileChanged += new System.EventHandler(this.phoneTile_SelectedTileChanged);
                tile.MenuNumbers          = menuNumbers;
                tile.MenuStatus           = menuStatus;
                //adding this in case we ever want to show the NeedsHelp button in the big phones. Currently, it is hidden.
                tile.NeedsHelpClicked += new System.EventHandler(this.tiletoggleHelp_Click);
                this.Controls.Add(tile);
                y++;
                if (i % (TilesPerColumn) == 0)             //If number is divisble by the number of tiles per column, move over to a new column.  TilesPerColumn subtracts one because i is zero based.
                {
                    y = 0;
                    x++;
                }
            }
            FillTiles(false);            //initial fast load and anytime data changes.  After this, pumped in from main form.
            Control[] topLeftMatch = Controls.Find("phoneTile1", false);
            if (PhoneList.Count >= 1 &&
                topLeftMatch != null &&
                topLeftMatch.Length >= 1)
            {
                //Size the window to fit contents
                tile = ((PhoneTile)topLeftMatch[0]);
                int columns    = (int)Math.Ceiling((double)PhoneList.Count / TilesPerColumn);
                int autoWidth  = columns * tile.Width;
                int autoHeight = tile.Top + (tile.Height * TilesPerColumn);
                if (autoWidth > 1650)                 //Window was going off side of screen.  1650 chosen to accommodate side mounted windows taskbar.
                //Resize window to fit, add height for showing horizontal scrollbar.
                //Doesn't use #*column width here because the column width is changing soon, and want to show partial columns so user knows to scroll.
                {
                    autoWidth  = 1650;
                    autoHeight = autoHeight + 20;
                }
                this.ClientSize = new Size(autoWidth, autoHeight);
            }
            radioByExt.CheckedChanged  += radioSort_CheckedChanged;
            radioByName.CheckedChanged += radioSort_CheckedChanged;
        }
Ejemplo n.º 13
0
        public static void EmployeeSettings(Phone phone)
        {
            if (phone == null || phone.EmployeeNum < 1)
            {
                return;
            }
            PhoneEmpDefault         ped  = PhoneEmpDefaults.GetByExtAndEmp(phone.Extension, phone.EmployeeNum);
            FormPhoneEmpDefaultEdit form = new FormPhoneEmpDefaultEdit();

            form.PedCur = ped;
            form.ShowDialog();
        }
Ejemplo n.º 14
0
        private void escalationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }
            FormPhoneEmpDefaultEscalationEdit FormE = new FormPhoneEmpDefaultEscalationEdit();

            FormE.ShowDialog();
            refreshCurrentTabHelper(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), PhoneEmpSubGroups.GetAll());
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Escalation team changed");
        }
Ejemplo n.º 15
0
        private void menuItemOfflineAssist_Click(object sender, EventArgs e)
        {
            if (!ClockIn())
            {
                return;
            }
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Phones.SetPhoneStatus(ClockStatusEnum.OfflineAssist, extension);
            FillEmps();
        }
Ejemplo n.º 16
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     PhoneEmpDefaults.Delete(PedCur.EmployeeNum);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 17
0
        ///<summary>Sets the current phone's employee and extension as "available" and then sets the phone status to the clock status passed in.
        ///Returns false if the user currently clocked in does not have permission or the credentials to do the desired action.
        ///Also, calls FillEmps() if action was successfully taken.</summary>
        private bool SetPhoneAvailable(ClockStatusEnum clockStatus)
        {
            if (!ClockIn())
            {
                return(false);
            }
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Phones.SetPhoneStatus(clockStatus, extension);
            FillEmps();
            return(true);
        }
Ejemplo n.º 18
0
        private void menuItemWrapUp_Click(object sender, EventArgs e)
        {
            if (!ClockIn())
            {
                return;
            }
            int  extension   = PhoneList[rowI].Extension;
            long employeeNum = PhoneList[rowI].EmployeeNum;

            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Phones.SetPhoneStatus(ClockStatusEnum.WrapUp, extension);
            //this is usually an automatic status
            FillEmps();
        }
Ejemplo n.º 19
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();
        }
Ejemplo n.º 20
0
        public static void Training(PhoneTile tile)
        {
            if (!ClockIn(tile))
            {
                return;
            }
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Phones.SetPhoneStatus(ClockStatusEnum.Training, extension);
        }
Ejemplo n.º 21
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
        }
Ejemplo n.º 22
0
        public static void WrapUp(PhoneTile tile)
        {
            if (!ClockIn(tile))
            {
                return;
            }
            int  extension   = tile.PhoneCur.Extension;
            long employeeNum = tile.PhoneCur.EmployeeNum;

            if (!CheckSelectedUserPassword(employeeNum))
            {
                return;
            }
            PhoneEmpDefaults.SetAvailable(extension, employeeNum);
            Phones.SetPhoneStatus(ClockStatusEnum.WrapUp, extension);
            //this is usually an automatic status
        }
Ejemplo n.º 23
0
        public FormPhoneEmpDefaultEscalationEdit(PhoneEmpSubGroupType tabDefault = PhoneEmpSubGroupType.Avail)
        {
            InitializeComponent();
            Lan.F(this);
            FillTabs();
            List <PhoneEmpSubGroup> listGroupsAll = PhoneEmpSubGroups.GetAll();

            _dictSubGroupsOld = Enum.GetValues(typeof(PhoneEmpSubGroupType)).Cast <PhoneEmpSubGroupType>().ToDictionary(x => x, x => listGroupsAll.FindAll(y => y.SubGroupType == x));
            _dictSubGroupsNew = _dictSubGroupsOld.ToDictionary(x => x.Key, x => x.Value.Select(y => y.Copy()).ToList());
            //Get all employees.
            _listPED = PhoneEmpDefaults.Refresh();
            //Sort by name.
            _listPED.Sort(new PhoneEmpDefaults.PhoneEmpDefaultComparer(PhoneEmpDefaults.PhoneEmpDefaultComparer.SortBy.name));
            FillGrids();
            //This can change to a switch statement on tabDefault if we ever add custom named tabs.
            tabMain.SelectTab(tabMain.TabPages[tabDefault.ToString()]);
        }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
        private void FillTile()
        {
            //Get the new phone list from the database and redraw control.
            SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList());
            //Set the currently selected phone accordingly.
            if (phoneList == null)           //No phone list. Shouldn't get here.
            {
                phoneTile.SetPhone(null, null, false);
                return;
            }
            Phone           phone           = Phones.GetPhoneForExtension(phoneList, Extension);
            PhoneEmpDefault phoneEmpDefault = null;

            if (phone != null)
            {
                phoneEmpDefault = PhoneEmpDefaults.GetEmpDefaultFromList(phone.EmployeeNum, phoneEmpDefaultList);
            }
            phoneTile.SetPhone(phone, phoneEmpDefault, PhoneEmpDefaults.IsTriageOperatorForExtension(Extension, phoneEmpDefaultList));
        }
Ejemplo n.º 26
0
        private void labelExtensionName_DoubleClicked(Phone phoneCur)
        {
            if (phoneCur == null || phoneCur.EmployeeNum < 1)
            {
                return;
            }
            PhoneEmpDefault phoneEmpDefault = PhoneEmpDefaults.GetOne(phoneCur.EmployeeNum);

            if (phoneEmpDefault == null)
            {
                MessageBox.Show("No 'phoneempdefault' row found for EmployeeNum " + phoneCur.EmployeeNum
                                + ".\r\nGo to Phone Settings window and add a row for this employee.");
                return;
            }
            FormPhoneEmpDefaultEdit FormPEDE = new FormPhoneEmpDefaultEdit();

            FormPEDE.PedCur = phoneEmpDefault;
            FormPEDE.ShowDialog();
        }
Ejemplo n.º 27
0
        public static void EmployeeSettings(Phone phone)
        {
            if (phone == null || phone.EmployeeNum < 1)
            {
                return;
            }
            PhoneEmpDefault ped = PhoneEmpDefaults.GetByExtAndEmp(phone.Extension, phone.EmployeeNum);

            if (ped == null)
            {
                MsgBox.Show(Lan.g("PhoneUI", "Could not find the selected EmployeeNum/Extension pair in database. " +
                                  "Please verify that the correct extension is listed for this user in map setup."));
                return;
            }
            FormPhoneEmpDefaultEdit form = new FormPhoneEmpDefaultEdit();

            form.PedCur = ped;
            form.ShowDialog();
        }
Ejemplo n.º 28
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(Phone phoneCur, 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(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:") + " " + phoneCur.EmployeeName);
         return(false);
     }
     if (!CheckUserCanChangeStatus(phoneCur))
     {
         return(false);
     }
     PhoneEmpDefaults.SetAvailable(phoneCur.Extension, phoneCur.EmployeeNum);
     Phones.SetPhoneStatus(newClockStatus, phoneCur.Extension);
     return(true);
 }
Ejemplo n.º 29
0
 private void FormPhoneTiles_Load(object sender, EventArgs e)
 {
     if (!ODBuild.IsDebug() && Environment.MachineName.ToLower() != "jordans" &&
         Environment.MachineName.ToLower() != "nathan")
     {
         checkBoxAll.Visible = false;              //so this will also be visible in debug
     }
     _tileStart      = butSettings.Bottom + 8;
     _isFlashingPink = false;
     _timeSpanDelta  = MiscData.GetNowDateTime() - DateTime.Now;
     _listPhoneTiles = new List <PhoneTile>();
     SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), ChatUsers.GetAll(), false);         //Do not call FillTiles() yet. Need to create PhoneTile controls first.
     if (_listPhones.Count >= 1)
     {
         int columns    = (int)Math.Ceiling((double)_listPhones.Count / _tilesPerColumn);
         int widthForm  = 1780;             //This width and height is changed to accomadate Jordan's taskbar and sidebar setup.
         int heightForm = 1026;
         this.Size = new Size(widthForm, heightForm);
     }
     radioByExt.CheckedChanged  += radioSort_CheckedChanged;
     radioByName.CheckedChanged += radioSort_CheckedChanged;
 }
Ejemplo n.º 30
0
        private void FillTile()
        {
            //UpdateComboRooms();//We can't do this in the constructor and all the other methods fire too often.  FillTile is a good place for this.
            //Get the new phone list from the database and redraw control.
            SetPhoneList(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList());
            //Set the currently selected phone accordingly.
            if (_listPhones == null)           //No phone list. Shouldn't get here.
            {
                phoneTile.SetPhone(null, null, null, false);
                return;
            }
            Phone           phone           = Phones.GetPhoneForExtension(_listPhones, Extension);
            PhoneEmpDefault phoneEmpDefault = null;
            ChatUser        chatUser        = null;

            if (phone != null)
            {
                phoneEmpDefault = PhoneEmpDefaults.GetEmpDefaultFromList(phone.EmployeeNum, _listPhoneEmpDefaults);
                chatUser        = ChatUsers.GetFromExt(phone.Extension);
            }
            phoneTile.SetPhone(phone, phoneEmpDefault, chatUser, PhoneEmpDefaults.IsTriageOperatorForExtension(Extension, _listPhoneEmpDefaults));
        }