Example #1
0
        private void cbo_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblamin.Text = "AM_IN :";
            lblamout.Text = "AM_OUT :";
            lblpmin.Text = "PM_IN :";
            lblpmout.Text = "PM_OUT :";
            lblhour.Text = "HOUR :";

            if (cbo.Text != "")
            {
                Schedule s, s1 = new Schedule();
                s1.template_name = cbo.Text;
                s = s1.SELECT_BY_TEMPLATE_NAME();
                hours_allocated = s.hours_allocated;

                lblamin.Text += s.first_half_in.ToString("HH:mm");
                lblamout.Text += s.first_half_out.ToString("HH:mm");
                lblpmin.Text += s.second_half_in.ToString("HH:mm");
                lblpmout.Text += s.second_half_out.ToString("HH:mm");
                lblhour.Text = "HOURS :" + hours_allocated.ToString();

            }
            else {
                lblamin.Text = "AM_IN :";
                lblamout.Text = "AM_OUT :";
                lblpmin.Text = "PM_IN :";
                lblpmout.Text = "PM_OUT :";
                lblhour.Text = "HOUR :";
                hours_allocated = TimeSpan.Parse("0:00:00");
            }
        }