Ejemplo n.º 1
0
        private void WeeklyScheduleUI_Load(object sender, EventArgs e)
        {
            DataTable dt;

            do
            {
                dt = WeeklySchedule.getWeeklySchedule(doctorID);
                if (dt.Rows.Count == 0)
                {
                    WeeklySchedule.setDefaultWeeklySchedule(doctorID);
                }
            } while (dt.Rows.Count == 0);

            for (int row = 1; row < tableLayoutPanel1.RowCount; row++)
            {
                for (int col = 1; col < tableLayoutPanel1.ColumnCount; col++)
                {
                    Label  label  = (Label)tableLayoutPanel1.GetControlFromPosition(col, row);
                    string status = dt.Rows[col - 1][row].ToString();

                    if (status == "BUSY")
                    {
                        label.BackColor = Color.Red;
                        toolTip.SetToolTip(label, "Scheduled");
                    }
                    else
                    {
                        toolTip.SetToolTip(label, "Click to Change Schedule");
                    }
                    label.Text = status;
                }
            }

            if (patientHome != null)
            {
                toolTip.SetToolTip(btnDone, "Last selected schedule will be set.");
            }
        }