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"];
                }
            }
        }
Пример #2
0
 protected void ddlTC_SelectedIndexChanged(object sender, EventArgs e)
 {
     int tuitionClassID = Convert.ToInt32(ddlTC.SelectedValue);
     TuitionClass objTuitionClass = new TuitionClass();
     objTuitionClass.tuitionClassID = tuitionClassID;
     DataSet ds = new DataSet();
     objTuitionClass.getTuitionDetails(ref ds);
     gvCT.DataSource = ds.Tables["tuitionclassdetails"];
     gvCT.DataBind();
 }