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); }
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(); }
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(); }
public static void Unavailable(Phone phone) { if (!ClockEvents.IsClockedIn(Security.CurUser.EmployeeNum)) //Employee performing the action must be clocked in. { MsgBox.Show("PhoneUI", "You must clock in before completing this action."); return; } if (!ClockEvents.IsClockedIn(phone.EmployeeNum)) //Employee having action performed must be clocked in. { MessageBox.Show(Lan.g("PhoneUI", "Target employee must be clocked in before setting this status:") + " " + phone.EmployeeName); return; } if (!CheckUserCanChangeStatus(phone)) { return; } int extension = phone.Extension; long employeeNum = phone.EmployeeNum; 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.PedCur.StatusOverride = PhoneEmpStatusOverride.Unavailable; if (formPED.ShowDialog() == DialogResult.OK && formPED.PedCur.StatusOverride == PhoneEmpStatusOverride.Unavailable) { //This phone status update can get skipped from within the editor if the employee is not clocked in. //This would be the case when you are setting an employee other than yourself to Unavailable. //So we will set it here. This keeps the phone table and phone panel in sync. Phones.SetPhoneStatus(ClockStatusEnum.Unavailable, formPED.PedCur.PhoneExt, formPED.PedCur.EmployeeNum); PhoneAsterisks.SetQueueForExtension(phone.Extension, AsteriskQueues.None); } }