コード例 #1
0
        protected void LoadCourseDetail()
        {
            int     courseID = int.Parse(Request.QueryString["ID"].ToString());
            DataSet ds       = _course.FetchCourses(courseID);

            txtCourseID.Text    = ds.Tables[0].Rows[0]["courseID"].ToString();
            txtCourseName.Text  = ds.Tables[0].Rows[0]["courseName"].ToString();
            txtDescription.Text = ds.Tables[0].Rows[0]["courseDescription"].ToString();
            departmentList.Text = ds.Tables[0].Rows[0]["departmentID"].ToString();
            txtFaculty.Text     = ds.Tables[0].Rows[0]["facultyID"].ToString();
            txtStartDate.Text   = ds.Tables[0].Rows[0]["startDate"].ToString();
            txtEndDate.Text     = ds.Tables[0].Rows[0]["endDate"].ToString();
            txtExamDate.Text    = ds.Tables[0].Rows[0]["examDate"].ToString();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Course Delete";
            if (!IsPostBack)
            {
                try
                {
                    if (!_auth.IsStaff(Session["role"].ToString()))
                    {
                        Page.ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('You do not have permission to use this function. Please login to continue');document.location.href='Login.aspx';", true);
                    }
                }
                catch (Exception)
                {
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('You do not have permission to use this function. Please login to continue');document.location.href='Login.aspx';", true);
                }

                DataSet ds = _course.FetchCourses(int.Parse(Request.QueryString["ID"].ToString()));
                lblCourseID.Text   = ds.Tables[0].Rows[0]["courseID"].ToString();
                lblCourseName.Text = ds.Tables[0].Rows[0]["courseName"].ToString();
            }
        }