protected void Page_Load(object sender, EventArgs e)
        {
            teacher_result.InnerHtml = "";

            string searchkey = "";
            string query     = "";

            if (IsPostBack)
            {
                searchkey = teacher_search.Text;
            }
            if (searchkey == "" || searchkey == null)
            {
                query = "select * from TEACHERS;";
            }
            else
            {
                query = "select * from TEACHERS where TEACHERFNAME LIKE '%" + searchkey + "%' OR TEACHERLNAME LIKE '%" + searchkey + "%' OR EMPLOYEENUMBER LIKE '%" + searchkey + "%' OR HIREDATE LIKE '%" + searchkey + "%' OR SALARY LIKE '%" + searchkey + "%';";
            }

            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                teacher_result.InnerHtml += "<div class=\"listitem\">";

                string teacherid = row["TEACHERID"];

                string teacherfirstname = row["TEACHERFNAME"];
                teacher_result.InnerHtml += "<div class=\"cul1\"><a href=\"Showteachers.aspx?teacherid=" + teacherid + "\">" + teacherfirstname + "</a></div>";

                string teacherlastname = row["TEACHERLNAME"];
                teacher_result.InnerHtml += "<div class=\"cul2\">" + teacherlastname + "</div>";

                string teacheremployeenumber = row["EMPLOYEENUMBER"];
                teacher_result.InnerHtml += "<div class=\"cul2\">" + teacheremployeenumber + "</div>";

                string hiredate = row["HIREDATE"];
                teacher_result.InnerHtml += "<div class=\"cul2\">" + hiredate + "</div>";

                string salary = row["SALARY"];
                teacher_result.InnerHtml += "<div class=\"cul2\">" + salary + "</div>";

                teacher_result.InnerHtml += "<div class=\"cul2\"><a href=\"UpdateTeacher.aspx?teacherid=" + teacherid + "\">Update</a>/<a href=\"DeleteTeacher.aspx?teacherid=" + teacherid + "\">Delete</a></div>";
                teacher_result.InnerHtml += "</div>";
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string cid = Request.QueryString["classid"];

            string query = "select * from CLASSES where classid =" + cid + ";";

            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                class_code.InnerHtml  = row["CLASSCODE"];
                start_date.InnerHtml  = row["STARTDATE"];
                finish_date.InnerHtml = row["FINISHDATE"];
                class_name.InnerHtml  = row["CLASSNAME"];
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string sid = Request.QueryString["studentid"];

            string query = "select * from STUDENTS where studentid =" + sid + ";";

            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                student_fname.Text  = row["STUDENTFNAME"];
                student_lname.Text  = row["STUDENTLNAME"];
                student_number.Text = row["STUDENTNUMBER"];
                enrolment_date.Text = row["ENROLMENTDATE"];
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            students_result.InnerHtml = "";

            string searchkey = "";
            string query;

            if (IsPostBack)
            {
                searchkey = student_search.Text;
            }
            if (searchkey == "" || searchkey == null)
            {
                query = "select * from STUDENTS;";
            }
            else
            {
                query = "select * from STUDENTS where STUDENTFNAME LIKE '%" + searchkey + "%' OR STUDENTLNAME LIKE '%" + searchkey + "%' OR STUDENTNUMBER LIKE '%" + searchkey + "%' OR ENROLMENTDATE LIKE '%" + searchkey + "%';";
            }

            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                students_result.InnerHtml += "<div class=\"listitem\">";

                string studentid = row["STUDENTID"];

                string studentfirstname = row["STUDENTFNAME"];
                students_result.InnerHtml += "<div class=\"cul1\"><a href=\"ShowStudent.aspx?studentid=" + studentid + "\">" + studentfirstname + "</a></div>";

                string studentlastname = row["STUDENTLNAME"];
                students_result.InnerHtml += "<div class=\"cul2\">" + studentlastname + "</div>";

                string studentnumber = row["STUDENTNUMBER"];
                students_result.InnerHtml += "<div class=\"cul2\">" + studentnumber + "</div>";

                string enrolmentdate = row["ENROLMENTDATE"];
                students_result.InnerHtml += "<div class=\"cul2\">" + enrolmentdate + "</div>";

                students_result.InnerHtml += "<div class=\"cul2\"><a href=\"UpdateStudent.aspx?studentid=" + studentid + "\">Update</a>/<a href=\"DeleteStudent.aspx?studentid=" + studentid + "\">Delete</a></div>";

                students_result.InnerHtml += "</div>";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string tid = Request.QueryString["teacherid"];

            string query = "select * from TEACHERS where teacherid =" + tid + ";";

            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                teacher_fname.Text   = row["TEACHERFNAME"];
                teacher_lname.Text   = row["TEACHERLNAME"];
                hire_date.Text       = row["HIREDATE"];
                employee_number.Text = row["EMPLOYEENUMBER"];
                salary_amount.Text   = row["SALARY"];
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            classes_result.InnerHtml = "";

            string searchkey = "";
            string query     = "";

            if (IsPostBack)
            {
                searchkey = classes_search.Text;
            }
            if (searchkey == "" || searchkey == null)
            {
                query = "select * from CLASSES;";
            }
            else
            {
                query = "select * from CLASSES where CLASSCODE like '%" + searchkey + "%' OR STARTDATE like '%" + searchkey + "%' OR FINISHDATE = '%" + searchkey + "%' OR CLASSNAME like '%" + searchkey + "%';";
            }
            var db = new DATABASE();
            List <Dictionary <String, String> > rs = db.showdata(query);

            foreach (Dictionary <String, String> row in rs)
            {
                classes_result.InnerHtml += "<div class=\"listitem\">";

                string classid = row["CLASSID"];

                string classcode = row["CLASSCODE"];
                classes_result.InnerHtml += "<div class=\"cul1\"><a href=\"ShowClasses.aspx?classid=" + classid + "\">" + classcode + "</a></div>";

                string startdate = row["STARTDATE"];
                classes_result.InnerHtml += "<div class=\"cul2\">" + startdate + "</div>";

                string finishdate = row["FINISHDATE"];
                classes_result.InnerHtml += "<div class=\"cul2\">" + finishdate + "</div>";

                string classname = row["CLASSNAME"];
                classes_result.InnerHtml += "<div class=\"cul2\">" + classname + "</div>";
                classes_result.InnerHtml += "<div class=\"cul2\"><a href=\"UpdateClasses.aspx?classid=" + classid + "\">Update</a>/<a href=\"DeleteClasses.aspx?classid=" + classid + "\">Delete</a></div>";

                classes_result.InnerHtml += "</div>";
            }
        }