示例#1
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);
                }
            }
        }
示例#2
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);
        }
示例#3
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();
 }
示例#4
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();
        }
 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();
 }
示例#6
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;
        }
示例#7
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");
        }
示例#8
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()]);
        }
示例#9
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));
        }
示例#10
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));
        }
示例#11
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;
 }
        private void FillGrid()
        {
            //get PhoneGraph entries for this date
            ListPhoneGraphsForDate = PhoneGraphs.GetAllForDate(DateEdit);
            //get current employee defaults
            ListPhoneEmpDefaults = PhoneEmpDefaults.Refresh();
            ListPhoneEmpDefaults.Sort(new PhoneEmpDefaults.PhoneEmpDefaultComparer(PhoneEmpDefaults.PhoneEmpDefaultComparer.SortBy.name));
            //get schedules
            ListSchedulesForDate = Schedules.GetDayList(DateEdit);
            long selectedEmployeeNum = -1;

            if (gridGraph.Rows.Count >= 1 &&
                gridGraph.GetSelectedIndex() >= 0 &&
                gridGraph.Rows[gridGraph.GetSelectedIndex()].Tag != null &&
                gridGraph.Rows[gridGraph.GetSelectedIndex()].Tag is PhoneEmpDefault)
            {
                selectedEmployeeNum = ((PhoneEmpDefault)gridGraph.Rows[gridGraph.GetSelectedIndex()].Tag).EmployeeNum;
            }
            gridGraph.BeginUpdate();
            gridGraph.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TablePhoneGraphDate", "Employee"), 80);

            gridGraph.Columns.Add(col);             //column 0 (name - not clickable)
            col           = new ODGridColumn(Lan.g("TablePhoneGraphDate", "Schedule"), 130);
            col.TextAlign = HorizontalAlignment.Center;
            gridGraph.Columns.Add(col);             //column 1 (schedule - clickable)
            col           = new ODGridColumn(Lan.g("TablePhoneGraphDate", "Graph Default"), 90);
            col.TextAlign = HorizontalAlignment.Center;
            gridGraph.Columns.Add(col);             //column 2 (default - not clickable)
            col           = new ODGridColumn(Lan.g("TablePhoneGraphDate", "Set Graph Status"), 110);
            col.TextAlign = HorizontalAlignment.Center;
            gridGraph.Columns.Add(col);             //column 3 (set graph status - clickable)
            col           = new ODGridColumn(Lan.g("TablePhoneGraphDate", "Is Overridden?"), 80);
            col.TextAlign = HorizontalAlignment.Center;
            gridGraph.Columns.Add(col);             //column 4 (is value an overridde of default? - not clickable)
            gridGraph.Rows.Clear();
            int selectedRow = -1;

            //loop through all employee defaults and create 1 row per employee
            for (int iPED = 0; iPED < ListPhoneEmpDefaults.Count; iPED++)
            {
                PhoneEmpDefault phoneEmpDefault = ListPhoneEmpDefaults[iPED];
                Employee        employee        = Employees.GetEmp(phoneEmpDefault.EmployeeNum);
                if (employee == null || employee.IsHidden)               //only deal with current employees
                {
                    continue;
                }
                List <Schedule> scheduleForEmployee = Schedules.GetForEmployee(ListSchedulesForDate, phoneEmpDefault.EmployeeNum);
                bool            isGraphed           = phoneEmpDefault.IsGraphed; //set default
                bool            hasOverride         = false;
                for (int iPG = 0; iPG < ListPhoneGraphsForDate.Count; iPG++)     //we have a default, now loop through all known exceptions and find a match
                {
                    PhoneGraph phoneGraph = ListPhoneGraphsForDate[iPG];
                    if (phoneEmpDefault.EmployeeNum == ListPhoneGraphsForDate[iPG].EmployeeNum)                   //found a match so no op necessary for this employee
                    {
                        isGraphed   = phoneGraph.IsGraphed;
                        hasOverride = true;
                        break;
                    }
                }
                ODGridRow row;
                row = new ODGridRow();
                row.Cells.Add(phoneEmpDefault.EmpName);                                                           //column 0 (name - not clickable)
                row.Cells.Add(Schedules.GetCommaDelimStringForScheds(scheduleForEmployee).Replace(", ", "\r\n")); //column 1 (shift times - not clickable)
                row.Cells.Add(phoneEmpDefault.IsGraphed?"X":"");                                                  //column 2 (default - not clickable)
                row.Cells.Add(isGraphed?"X":"");                                                                  //column 3 (set graph status - clickable)
                row.Cells.Add(hasOverride && isGraphed != phoneEmpDefault.IsGraphed?"X":"");                      //column 4 (is overridden to IsGraphed? - not clickable)
                row.Tag = phoneEmpDefault;                                                                        //store the employee for click events
                int rowIndex = gridGraph.Rows.Add(row);
                if (selectedEmployeeNum == phoneEmpDefault.EmployeeNum)
                {
                    selectedRow = rowIndex;
                }
            }
            gridGraph.EndUpdate();
            if (selectedRow >= 0)
            {
                gridGraph.SetSelected(selectedRow, true);
            }
        }
示例#13
0
 private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
 {
     refreshCurrentTabHelper(PhoneEmpDefaults.Refresh(), Phones.GetPhoneList(), PhoneEmpSubGroups.GetAll());
 }
示例#14
0
 private void FormGraphEmployeeTime_Load(object sender, EventArgs e)
 {
     ListPED     = PhoneEmpDefaults.Refresh();
     dateShowing = AppointmentL.DateSelected;
     FillData();
 }