protected void btnSubmit_Click(object sender, EventArgs e)
        {
            // Ensure that there is no validation errors
            if (Page.IsValid)
            {
                // Create a new object from the Tutor Class
                TutorClass objTutor = new TutorClass();

                // Pass details to Tutor objects with necessary conversion if needed
                // objTutor.tutorid = Convert.ToInt32(lblTutorID.Text);
                objTutor.salutation = lblSalutation.Text;
                objTutor.name = lblName.Text;
                objTutor.telno = lblContactNumber.Text;
                objTutor.email = lblEmailAddress.Text;
                // objTutor.password = lblPassword.Text;
                objTutor.experience = Convert.ToInt32(lblYearsOfExperience.Text);

                // Call method to add
                int error = objTutor.add();

                // Added successfully if Tutor.cs returned 1
                if (error == 1)
                    lblText.Text = "Adding of new tutor is successful";
                else
                    lblText.Text = "Adding of new tutor is unsucessful";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // populate the dropdownlist ddlTutor and ddlClass

            if (!Page.IsPostBack)
            {
                // populate the dropdownlist ddlTutor from the method

                TutorClass objTutor = new TutorClass();

                DataSet ds = new DataSet();

                int errorcode = objTutor.getTutorDetails();

                if (errorcode == 0)
                {
                    ddlTName.DataSource = ds.Tables["tutordetails"];
                    ddlTName.DataTextField = "TName";
                    ddlTName.DataBind();

                    txtStudentID.Text = Request.QueryString["StudentID"];
                    txtTitle.Text = Request.QueryString["Title"];
                    txtText.Text = Request.QueryString["Text"];

                    ddlTName.SelectedValue = Request.QueryString["TName"];
                    ddlTClass.SelectedValue = Request.QueryString["tuitionClassID"];
                }

                TuitionClass objTuitionClass = new TuitionClass();

                DataSet result = new DataSet();

                int code = objTuitionClass.getTuitionDetails();

                if (code == 0)
                {
                    ddlTClass.DataSource = ds.Tables["tuitionclassdetails"];
                    ddlTClass.DataTextField = "tuitionClassID";
                    ddlTClass.DataBind();

                    ddlTName.SelectedValue = Convert.ToString(objTutor.name);
                    ddlTClass.SelectedValue = Convert.ToString(objTuitionClass.tuitionClassID);
                }

                DiscussionTopic objDiscussionTopic = new DiscussionTopic();

                DataSet ds1 = new DataSet();

                int errorcode2 = objDiscussionTopic.getDiscussionTopicDetails(ref ds1);

                if (errorcode2 == 0)
                {
                    txtTitle.Text = Request.QueryString["Title"];
                    txtText.Text = Request.QueryString["Text"];
                }
            }
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            TutorClass objTutor = new TutorClass();
            objTutor.tutorid = Convert.ToInt32(Request.QueryString["tutorid"]);
            objTutor.name = lblName.Text;
            objTutor.telno = txtTelNo.Text;
            objTutor.email = txtNewEmailAddr.Text;
            objTutor.freedayofweek = ddlFreeDay.SelectedValue;
            objTutor.timeslot = ddlTimeSlot.SelectedValue;
            if (txtOldPass.Text != "" && txtNewPass.Text == "")
                objTutor.password = txtOldPass.Text;
            else
                objTutor.password = txtNewPass.Text;

            int error = objTutor.update();
            if (error == 100)
            {
                lblMessage2.Text = "Tutor successfully updated.";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                ddlFreeDay.Items.Add("Monday");
                ddlFreeDay.Items.Add("Tuesday");
                ddlFreeDay.Items.Add("Wednesday");
                ddlFreeDay.Items.Add("Thursday");
                ddlFreeDay.Items.Add("Friday");
                ddlFreeDay.Items.Add("Saturday");
                ddlFreeDay.Items.Add("Sunday");

                ddlTimeSlot.Items.Add("9am - 11am");
                ddlTimeSlot.Items.Add("11am - 1pm");
                ddlTimeSlot.Items.Add("1pm - 3pm");
                ddlTimeSlot.Items.Add("3pm - 5pm");
                ddlTimeSlot.Items.Add("5pm - 7pm");
                ddlTimeSlot.Items.Add("7pm - 9pm");

                TutorClass objTutor = new TutorClass();
                objTutor.tutorid = Convert.ToInt32(Request.QueryString["tutorid"]);
                int code = objTutor.getTutorDetails();

                if(code==0)
                {
                     lblTutorID.Text = Convert.ToString(objTutor.tutorid);
                     lblSalutation.Text = objTutor.salutation;
                     lblName.Text = objTutor.name;
                     txtTelNo.Text = objTutor.telno;
                     txtNewEmailAddr.Text = objTutor.email;
                     txtOldPass.Text = objTutor.password;
                     ddlTimeSlot.SelectedValue = objTutor.timeslot;
                     ddlFreeDay.SelectedValue = objTutor.freedayofweek;
                }

            }
        }