Fixed AddAppointmentEnabled to check for the presence of resources in a resource group; otherwise you are given the ability to make an appointment on the resource group itself which causes a crash. Fixes bug EHS#000342.

This commit is contained in:
sam 2012-08-09 17:30:57 +00:00
parent 746b126c6b
commit f53b7a108e
1 changed files with 8 additions and 0 deletions

View File

@ -1626,14 +1626,22 @@ namespace IndianHealthService.ClinicalScheduling
private bool AddAppointmentEnabled()
{
//new in 1.7: If there are no resources in the resource group, just say false.
//otherwise, we end up with being able to add appointments to empty resource groups.
if (this.Document.Resources.Count == 0)
return false;
//No cells selected for appointment. False.
if (this.calendarGrid1.SelectedRange.Cells.CellCount < 1)
return false;
//If manager, can always make appointment
bool bManager = this.DocManager.ScheduleManager;
if (bManager == true)
{
return (true);
}
// otherwise, check permissions, then check slots.
else
{
DateTime dStart = DateTime.Today;