Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             if (Session["Username"] != null && Session["Token"] != null)
             {
                 ReadAllTopicCommand cmd = new ReadAllTopicCommand();
                 cmd.Execute();
                 list_topi = cmd.Topics;
                 foreach (Topic topic in list_topi)
                 {
                     top_data.DataSource = list_topi;
                     top_data.DataBind();
                 }
             }
             else
             {
                 Response.Redirect("/site/admin/login.aspx");
             }
         }
         catch (Exception ex)
         {
         }
     }
 }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             if (Session["Username"] != null && Session["Token"] != null)
             {
                 ReadAllCourseCommand cmd = new ReadAllCourseCommand();
                 cmd.Execute();
                 list_mate = cmd.Courses;
                 foreach (Course course in list_mate)
                 {
                     suma_mat = suma_mat + 1;
                 }
                 ReadAllSectionCommand cmd_ = new ReadAllSectionCommand();
                 cmd_.Execute();
                 list_sec = cmd_.Sections;
                 foreach (Section section in list_sec)
                 {
                     suma_mod = suma_mod + 1;
                 }
                 ReadAllTopicCommand _cmd_ = new ReadAllTopicCommand();
                 _cmd_.Execute();
                 list_top = _cmd_.Topics;
                 foreach (Topic topic in list_top)
                 {
                     suma_top = suma_top + 1;
                 }
                 ReadAllStudentsCommand __cmd_ = new ReadAllStudentsCommand();
                 __cmd_.Execute();
                 list_stu = __cmd_.Students;
                 foreach (Student student in list_stu)
                 {
                     if (student.Grade.Id == 1)
                     {
                         suma_prig = suma_prig + 1;
                     }
                     else if (student.Grade.Id == 2)
                     {
                         suma_segg = suma_segg + 1;
                     }
                     else if (student.Grade.Id == 3)
                     {
                         suma_terg = suma_terg + 1;
                     }
                     else if (student.Grade.Id == 4)
                     {
                         suma_cuag = suma_cuag + 1;
                     }
                     else if (student.Grade.Id == 5)
                     {
                         suma_quig = suma_quig + 1;
                     }
                     else if (student.Grade.Id == 6)
                     {
                         suma_sexg = suma_sexg + 1;
                     }
                     total = total + 1;
                 }
             }
             else
             {
                 Response.Redirect("login.aspx");
             }
         }
         catch (Exception ex)
         {
         }
     }
 }