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)); }
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)); }
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); } } }