Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string classid = Request.QueryString["classid"];

            backButton.HRef += "?listType=classes&loginid=" + Request.QueryString["loginid"];

            //We will attempt to get the record we need
            if (!String.IsNullOrEmpty(classid))
            {
                var db = new SCHOOLDB();
                Dictionary <String, String> course_record = db.FindInTable(Int32.Parse(classid), "CLASSES");

                if (course_record.Count > 0)
                {
                    pageTypeTitle.InnerHtml = "Edit ";
                    coursecode.Text         = course_record["CLASSCODE"];
                    startdate.Text          = course_record["STARTDATE"];
                    finishdate.Text         = course_record["FINISHDATE"];
                    coursename.Text         = course_record["CLASSNAME"];
                }
                else
                {
                    //course.InnerHtml = "There was an error finding that course.";
                }
            }
            else
            {
                pageTypeTitle.InnerHtml = " Add ";
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string studentid = Request.QueryString["studentid"];

            backButton.HRef += "?listType=students&loginid=" + Request.QueryString["loginid"];
            //We will attempt to get the record we need
            if (!String.IsNullOrEmpty(studentid))
            {
                var db = new SCHOOLDB();
                Dictionary <String, String> student_record = db.FindInTable(Int32.Parse(studentid), "STUDENTS");

                if (student_record.Count > 0)
                {
                    pageTypeTitle.InnerHtml    = "Edit ";
                    studentfname.Text          = student_record["STUDENTFNAME"];
                    studentlname.Text          = student_record["STUDENTLNAME"];
                    studentnumber.Text         = student_record["STUDENTNUMBER"];
                    studentenrollmentdate.Text = student_record["ENROLMENTDATE"];
                }
                else
                {
                    //student.InnerHtml = "There was an error finding that student.";
                }
            }
            else
            {
                pageTypeTitle.InnerHtml = " Add ";
            }
        }