コード例 #1
0
        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 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;
                }

            }
        }