protected void btnSubmit_Click(object sender, EventArgs e)
    {
        AppointmentAppDbEntities dbcon = new AppointmentAppDbEntities();

        dbcon.AppointmentTables.Load();

        int hour   = Convert.ToInt32(ddlHour.SelectedValue.ToString());
        int minute = Convert.ToInt32(ddlMinute.SelectedValue.ToString());

        if (validateAppointment(txtAdvisorName.Text, Convert.ToDateTime(lblDate.Text), new TimeSpan(hour, minute, 0)))
        {
            AppointmentTable myAppointment = new AppointmentTable();
            myAppointment.AdvisorName = txtAdvisorName.Text;
            myAppointment.Location    = txtLocation.Text;
            myAppointment.Date        = Convert.ToDateTime(lblDate.Text);
            myAppointment.Time        = new TimeSpan(hour, minute, 0);
            myAppointment.Reason      = txtReason.Text;
            dbcon.AppointmentTables.Add(myAppointment);
            dbcon.SaveChanges();
            gvBrowse.DataBind();
            lstResult.Items.Clear();
            lstResult.Items.Add("Student name: name, Advisor Name: " + txtAdvisorName.Text);
            lstResult.Items.Add("Location: " + txtLocation.Text);
            lstResult.Items.Add("Date: " + Convert.ToDateTime(lblDate.Text));
            lstResult.Items.Add("Time: " + new TimeSpan(hour, minute, 0));
            lstResult.Items.Add("Reason: " + txtReason.Text);
        }
    }