protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["FCKeditor:UserFilesPath"] = ConfigurationManager.AppSettings["UserFilePath"];

                if (CurrentPage != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetPage(CurrentPage);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiTextBoxEnPageTitle.Text = ds.Tables[0].Rows[0]["EnPageTitle"].ToString();
                        uiTextBoxArPageTitle.Text = ds.Tables[0].Rows[0]["ArPageTitle"].ToString();
                        uiFCKeditorEnContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["EnPageContent"].ToString());
                        uiFCKeditorArContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString());
                    }
                    uiPanelCurrentPages.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentPages.Visible = true;
                    uiPanelCurrent.Visible = false;
                    BindData();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (CurrentSchoolYear != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetSchoolYear(CurrentSchoolYear);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["EnName"].ToString();
                 uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString();
                 uiCheckBoxCurrentYear.Checked = (bool)ds.Tables[0].Rows[0]["CurrentYear"];
             }
             uiPanelCurrentSchoolYear.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentSchoolYear.Visible = true;
             uiPanelCurrent.Visible = false;
             BindData();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadDDLs();
         if (CurrentStudentToPay != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetInstallmentsByStudentIDAndSchoolYearID(CurrentStudentToPay, Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue));
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxQty.Text = ds.Tables[0].Rows[0]["Quantity"].ToString();
                 uiTextBoxDate.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Parse(ds.Tables[0].Rows[0]["Date"].ToString()));
                 uiTextBoxPayOrderNo.Text = ds.Tables[0].Rows[0]["PayOrderNo"].ToString();
             }
             uiPanelCurrentInstallments.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentInstallments.Visible = true;
             uiPanelCurrent.Visible = false;
             BindStudentsData();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadDDLs();
         if (CurrentCheckedStudent != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetStudent(CurrentCheckedStudent);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiGridViewStudentsAbsence.DataSource = db.GetMonthlyAttendanceReportByStudentID(CurrentCheckedStudent);
                 uiGridViewStudentsAbsence.DataBind();
                 uiLabelStudentName.Text = ds.Tables[0].Rows[0]["ArStudentName"].ToString() + ds.Tables[0].Rows[0]["ArFatherName"].ToString();
                 DataSet StudentClassRoom = new DataSet();
                 StudentClassRoom = db.GetClassRoom(Convert.ToInt32(ds.Tables[0].Rows[0]["ClassRoomID"].ToString()));
                 DataSet StudentClass = new DataSet();
                 StudentClass = db.GetClass(Convert.ToInt32(StudentClassRoom.Tables[0].Rows[0]["ClassID"].ToString()));
                 uiLabelClass.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
             }
             uiPanelCurrentStudents.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentStudents.Visible = true;
             uiPanelCurrent.Visible = false;
             BindStudentData();
         }
     }
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (CurrentCourse != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetCourse(CurrentCourse);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["ENName"].ToString();
                 uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ARName"].ToString();
                 uiTextBoxMaxGrade.Text = ds.Tables[0].Rows[0]["MinGrade"].ToString();
                 uiTextBoxMinGrade.Text = ds.Tables[0].Rows[0]["MaxGrade"].ToString();
                 uiCheckBoxInTotal.Checked = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["InTotal"].ToString()) ? false : (bool)ds.Tables[0].Rows[0]["InTotal"];
             }
             uiPanelCurrentCourses.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentCourses.Visible = true;
             uiPanelCurrent.Visible = false;
             LoadDDLs();
             BindData();
         }
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadDDLs();
         if (CurrentActiveStudent != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetStudent(CurrentActiveStudent);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiGridViewStudentResults.DataSource = db.GetResultByStudentIDAndSchoolYearForAdmin(CurrentActiveStudent, Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue));
                 uiGridViewStudentResults.DataBind();
                 uiLabelStudentName.Text = ds.Tables[0].Rows[0]["ArStudentName"].ToString() + ds.Tables[0].Rows[0]["ArFatherName"].ToString();
                 DataSet StudentClassRoom = new DataSet();
                 StudentClassRoom = db.GetClassRoom(Convert.ToInt32(ds.Tables[0].Rows[0]["ClassRoomID"].ToString()));
                 DataSet StudentClass = new DataSet();
                 StudentClass = db.GetClass(Convert.ToInt32(StudentClassRoom.Tables[0].Rows[0]["ClassID"].ToString()));
                 uiLabelClass.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
             }
             uiPanelCurrentStudents.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentStudents.Visible = true;
             uiPanelCurrent.Visible = false;
             BindStudentData();
         }
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadDDLs();
         if (CurrentClass != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetClass(CurrentClass);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["EnName"].ToString();
                 uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString();
                 if (ds.Tables[0].Rows[0]["ClassTypeID"] != null)
                 {
                     uiDropDownListClassType.SelectedValue = ds.Tables[0].Rows[0]["ClassTypeID"].ToString();
                 }
             }
             uiPanelCurrentClasses.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentClasses.Visible = true;
             uiPanelCurrent.Visible = false;
             BindData();
         }
     }
 }
Exemplo n.º 8
0
 private void BindData()
 {
     DBLayer db = new DBLayer();
     if (!string.IsNullOrEmpty( uiDropDownListCat.SelectedValue) && uiDropDownListCat.SelectedValue != "0")
         uiDataListPhotos.DataSource = db.GetGalleryPhotoByCategoryID(Convert.ToInt32(uiDropDownListCat.SelectedValue));
     uiDataListPhotos.DataBind();
 }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (CurrentSchoolBus != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetSchoolBus(CurrentSchoolBus);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["ENLineName"].ToString();
                        uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArLineName"].ToString();
                        uiTextBoxENDriverName.Text = ds.Tables[0].Rows[0]["ENDriverName"].ToString();
                        uiTextBoxARDriverName.Text = ds.Tables[0].Rows[0]["ArDriverName"].ToString();
                        uiTextBoxDriverTele.Text = ds.Tables[0].Rows[0]["DriverTele"].ToString();
                        uiTextBoxENSupName.Text = ds.Tables[0].Rows[0]["ENSupervisorName"].ToString();
                        uiTextBoxARSupName.Text = ds.Tables[0].Rows[0]["ARSupervisorName"].ToString();
                        uiTextBoxSupTele.Text = ds.Tables[0].Rows[0]["SupervisorTele"].ToString();
                        uiTextBoxENNotes.Text = ds.Tables[0].Rows[0]["ENNotes"].ToString();
                        uiTextBoxARNotes.Text = ds.Tables[0].Rows[0]["ARNotes"].ToString();
                    }
                    uiPanelCurrentSchoolBus.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentSchoolBus.Visible = true;
                    uiPanelCurrent.Visible = false;
                    BindData();
                }
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["FCKeditor:UserFilesPath"] = ConfigurationManager.AppSettings["OutstandingFilePath"];

                if (CurrentOutStanding != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetOutstanding(CurrentOutStanding);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["ENName"].ToString();
                        uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString();
                        uiImagePic.ImageUrl = ds.Tables[0].Rows[0]["PicturePath"].ToString();
                        uiTextBoxYear.Text = ds.Tables[0].Rows[0]["Date"].ToString();
                        uiFCKeditorEnComment.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ENComments"].ToString());
                        uiFCKeditorArComment.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ARComments"].ToString());
                        uiDropDownListClass.SelectedValue = ds.Tables[0].Rows[0]["ClassID"].ToString();
                    }
                    uiPanelCurrentOutStanding.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentOutStanding.Visible = true;
                    uiPanelCurrent.Visible = false;
                    BindData();
                    LoadDDLs();
                }
            }
        }
Exemplo n.º 11
0
 protected void uiButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     string temp = "";
     string filepath = "";
     DataSet ds = new DataSet();
     if (uiFileUploadPicture.HasFile)
     {
         uiFileUploadPicture.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["OutstandingFilePath"] + uiFileUploadPicture.FileName));
         filepath = ConfigurationManager.AppSettings["OutstandingFilePath"].Substring(1) + uiFileUploadPicture.FileName;
     }
     ds = db.GetOutstanding(CurrentOutStanding);
     if (ds.Tables[0].Rows.Count > 0)
     {
         temp = ds.Tables[0].Rows[0]["PicturePath"].ToString();
     }
     if (CurrentOutStanding != 0)
     {
         if (temp != filepath && string.IsNullOrEmpty(filepath))
             db.UpdateOutstanding(CurrentOutStanding, uiTextBoxEnName.Text, uiTextBoxArName.Text, temp, DateTime.Now, Convert.ToInt32(uiDropDownListClass.SelectedValue), Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
         else
             db.UpdateOutstanding(CurrentOutStanding, uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, DateTime.Now, Convert.ToInt32(uiDropDownListClass.SelectedValue), Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
     }
     else
     {
         db.AddOutStanding(uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, DateTime.Now, Convert.ToInt32(uiDropDownListClass.SelectedValue), Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
     }
     CurrentOutStanding = 0;
     uiPanelCurrentOutStanding.Visible = true;
     uiPanelCurrent.Visible = false;
     BindData();
 }
Exemplo n.º 12
0
 protected void uiButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     string temp = "";
     string filepath = "";
     DataSet ds = new DataSet();
     if (uiFileUploadPicture.HasFile)
     {
         uiFileUploadPicture.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["HonorPanelFilePath"] + uiFileUploadPicture.FileName));
         filepath = ConfigurationManager.AppSettings["HonorPanelFilePath"] + uiFileUploadPicture.FileName;
     }
     ds = db.GetHonorPanel(CurrentHonorPanel);
     if (ds.Tables[0].Rows.Count > 0)
     {
         temp = ds.Tables[0].Rows[0]["PicturePath"].ToString();
     }
     if (CurrentHonorPanel != 0)
     {
         if (temp != filepath && string.IsNullOrEmpty(filepath))
             db.UpdateHonorPanel(CurrentHonorPanel, uiTextBoxEnName.Text, uiTextBoxArName.Text, temp, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
         else
             db.UpdateHonorPanel(CurrentHonorPanel, uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
     }
     else
     {
         db.AddHonorPanel(uiTextBoxEnName.Text, uiTextBoxArName.Text, filepath, Server.HtmlEncode(uiFCKeditorEnComment.Value), Server.HtmlEncode(uiFCKeditorArComment.Value));
     }
     CurrentHonorPanel = 0;
     uiPanelCurrentHonorPanel.Visible = true;
     uiPanelCurrent.Visible = false;
     BindData();
 }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["FCKeditor:UserFilesPath"] = ConfigurationManager.AppSettings["HonorPanelFilePath"];

                if (CurrentHonorPanel != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetHonorPanel(CurrentHonorPanel);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["ENName"].ToString();
                        uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString();
                        uiImagePic.ImageUrl = ds.Tables[0].Rows[0]["PicturePath"].ToString();
                        uiFCKeditorEnComment.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ENComments"].ToString());
                        uiFCKeditorArComment.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ARComments"].ToString());
                    }
                    uiPanelCurrentHonorPanel.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentHonorPanel.Visible = true;
                    uiPanelCurrent.Visible = false;
                    BindData();
                }
            }
        }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (CurrentClassType != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetClassType(CurrentClassType);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["EnName"].ToString();
                 uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString();
             }
             uiPanelCurrentClassType.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentClassType.Visible = true;
             uiPanelCurrent.Visible = false;
             BindData();
         }
     }
 }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (CurrentSchedule != 0)
                {
                    //BindData();
                    DBLayer db = new DBLayer();
                    DataSet ds = new DataSet();
                    ds = db.GetSchedule(CurrentSchedule);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiDropDownListSection.SelectedValue = ds.Tables[0].Rows[0]["SectionID"].ToString();
                        uiTextBoxArDetails.Text = ds.Tables[0].Rows[0]["ARDetails"].ToString();
                        uiTextBoxEnDetails.Text = ds.Tables[0].Rows[0]["ENDetails"].ToString();
                    }
                    uiPanelCurrentSchedule.Visible = false;
                    uiPanelCurrent.Visible = true;
                }
                else
                {
                    uiPanelCurrentSchedule.Visible = true;
                    uiPanelCurrent.Visible = false;
                    LoadDDLs();
                    BindData();
                }
            }
        }
Exemplo n.º 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadDDLs();
         if (CurrentStudentActive != 0)
         {
             //BindData();
             DBLayer db = new DBLayer();
             DataSet ds = new DataSet();
             ds = db.GetFeesByStudentIDAndSchoolYear(CurrentStudentActive,Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue));
             if (ds.Tables[0].Rows.Count > 0)
             {
                 uiTextBoxRemainingFees.Text = ds.Tables[0].Rows[0]["RemainingFeesLastYear"].ToString();
                 uiTextBoxBooksFees.Text = ds.Tables[0].Rows[0]["BooksFees"].ToString();
                 uiTextBoxBusFees.Text = ds.Tables[0].Rows[0]["BusFees"].ToString();
                 uiTextBoxUniformFees.Text = ds.Tables[0].Rows[0]["UniformFees"].ToString();
                 uiTextBoxActFees.Text = ds.Tables[0].Rows[0]["ActivitiesFees"].ToString();
                 uiTextBoxOtherFees.Text = ds.Tables[0].Rows[0]["OtherFees"].ToString();
             }
             uiPanelCurrentFees.Visible = false;
             uiPanelCurrent.Visible = true;
         }
         else
         {
             uiPanelCurrentFees.Visible = true;
             uiPanelCurrent.Visible = false;
             BindStudentsData();
         }
     }
 }
Exemplo n.º 17
0
        private void BindData()
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();

            int id = 0;
            bool done = int.TryParse(Request.QueryString["NID"].ToString(), out id);
            if (done)
            {
                ds = db.GetNews(Convert.ToInt32(Request.QueryString["NID"].ToString()));
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        uiLabelTitle.Text = ds.Tables[0].Rows[0]["ArTitle"].ToString();
                        uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArBody"].ToString());
                    }
                    else
                    {
                        Response.Redirect("~/News.aspx");
                    }

                }
                else
                {
                    Response.Redirect("~/News.aspx");
                }
            }
            else
            {
                Response.Redirect("~/News.aspx");
            }
        }
Exemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetAllOutstanding();
     uiDataListOutStanding.DataSource = ds;
     uiDataListOutStanding.DataBind();
 }
Exemplo n.º 19
0
 protected void uiDropDownListClasses_SelectedIndexChanged(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     uiDropDownListClassRooms.DataSource = db.GetAllClassRoomsByClassID(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
     uiDropDownListClassRooms.DataTextField = "ArName";
     uiDropDownListClassRooms.DataValueField = "ClassRoomID";
     uiDropDownListClassRooms.DataBind();
 }
Exemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLayer db = new DBLayer();
         uiRepeaterTopNews.DataSource = db.GetTopNews();
         uiRepeaterTopNews.DataBind();
     }
 }
Exemplo n.º 21
0
 protected void uiButtonUpdate_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     db.UpdatePage(CurrentPage, uiTextBoxEnPageTitle.Text, uiTextBoxArPageTitle.Text, Server.HtmlEncode(uiFCKeditorEnContent.Value), Server.HtmlEncode(uiFCKeditorArContent.Value));
     CurrentPage = 0;
     uiPanelCurrentPages.Visible = true;
     uiPanelCurrent.Visible = false;
     BindData();
 }
Exemplo n.º 22
0
 protected void uiDataListPhotos_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         DBLayer db = new DBLayer();
         db.DeleteGalleryPhoto(Convert.ToInt32(e.CommandArgument.ToString()));
         BindData();
     }
 }
Exemplo n.º 23
0
        protected void uiButtonViewResult_Click(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();
            DataSet Student= new DataSet();
            Student = db.GetStudent(Convert.ToInt32(Session["CurrentLoggedInStudent"].ToString()));
            DataSet StudentClassRoom = new DataSet();
            StudentClassRoom = db.GetClassRoom(Convert.ToInt32(Student.Tables[0].Rows[0]["ClassRoomID"].ToString()));
            DataSet StudentClass = new DataSet();
            StudentClass = db.GetClass(Convert.ToInt32(StudentClassRoom.Tables[0].Rows[0]["ClassID"].ToString()));
            DataSet ClassType = new DataSet();
            ClassType = db.GetClassType(Convert.ToInt32(StudentClass.Tables[0].Rows[0]["ClassTypeID"].ToString()));

            DataSet CoursesInTotal = new DataSet();
            DataSet CoursesRemaining = new DataSet();

            CoursesInTotal = db.GetAllCoursesByClassAndInTotal(Convert.ToInt32(StudentClassRoom.Tables[0].Rows[0]["ClassID"].ToString()), true);
            CoursesRemaining = db.GetAllCoursesByClassAndInTotal(Convert.ToInt32(StudentClassRoom.Tables[0].Rows[0]["ClassID"].ToString()), false);

            switch (StudentClass.Tables[0].Rows[0]["ClassTypeID"].ToString())
            {
                case "1":
                    uiDataListKidResults.DataSource = db.GetResultByStudentIDAndSchoolYear(Convert.ToInt32(Session["CurrentLoggedInStudent"].ToString()), Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue),FHMT, FHF, SHMT, SHF);
                    uiDataListKidResults.DataBind();
                    uiLabelKidName.Text = Student.Tables[0].Rows[0]["ArStudentname"].ToString() + " " + Student.Tables[0].Rows[0]["Arfathername"].ToString();
                    uiLabelClass.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
                    uiPanelKids.Visible = true;
                    uiPanelPrepratory.Visible = false;
                    uiPanelPrimary.Visible = false;
                    break;
                case "2":
                    DataSet AllCoursesPrimary = db.GetResultByStudentIDAndSchoolYear(Convert.ToInt32(Session["CurrentLoggedInStudent"].ToString()), Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue), FHMT, FHF, SHMT, SHF);
                    /*DataRow[] InTotalCourses = AllCoursesPrimary.Tables[0].Select("InTotal = 1");                    */
                    uiDataListCourseInTotalPrimary.DataSource = AllCoursesPrimary;
                    uiDataListCourseInTotalPrimary.DataBind();
                    uiLabelStudentName.Text = Student.Tables[0].Rows[0]["ArStudentname"].ToString() + " " + Student.Tables[0].Rows[0]["Arfathername"].ToString();
                    uiLabelClassPrim.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
                    uiLabelClassPrimary.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
                    uiPanelKids.Visible = false;
                    uiPanelPrepratory.Visible = false;
                    uiPanelPrimary.Visible = true;
                    break;
                case "3":
                    DataSet AllCoursesPrep = db.GetResultByStudentIDAndSchoolYear(Convert.ToInt32(Session["CurrentLoggedInStudent"].ToString()), Convert.ToInt32(uiDropDownListSchoolYear.SelectedValue), FHMT, FHF, SHMT, SHF);
                    uiDataListPrep.DataSource = AllCoursesPrep;
                    uiDataListPrep.DataBind();
                    uiLabelStudentNamePrep.Text = Student.Tables[0].Rows[0]["ArStudentname"].ToString() + " " + Student.Tables[0].Rows[0]["Arfathername"].ToString();
                    uiLabelClassPrep.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
                    uiLabelClassPreparatory.Text = StudentClass.Tables[0].Rows[0]["ArName"].ToString();
                    uiPanelKids.Visible = false;
                    uiPanelPrepratory.Visible = true;
                    uiPanelPrimary.Visible = false;
                    break;
                default:
                    break;
            }
        }
Exemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetHomePageBlock(6);
         uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArBlockContent"].ToString());
     }
 }
Exemplo n.º 25
0
 private void LoadDDL()
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetAllCategory();
     uiDropDownListCat.DataSource = ds;
     uiDropDownListCat.DataTextField = "ArTitle";
     uiDropDownListCat.DataValueField = "CategoryID";
     uiDropDownListCat.DataBind();
 }
Exemplo n.º 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetAllHonorPanel();
         uiDataListHonorPanel.DataSource = ds;
         uiDataListHonorPanel.DataBind();
     }
 }
Exemplo n.º 27
0
 protected void uiButtonLogin_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetUserByUserNameAndPassword(uiTextBoxUserName.Text, uiTextBoxPassword.Text);
     if (ds.Tables[0].Rows.Count > 0)
     {
         Session["CurrentUser"] = ds.Tables[0].Rows[0]["UserID"].ToString();
         Response.Redirect("AdminCP.aspx");
     }
 }
Exemplo n.º 28
0
 protected void uiButtonUpload_Click(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     string path = "";
     if (uiFileUploadPhoto.HasFile)
     {
         path = "/UserFiles/Gallery/" + uiDropDownListCat.SelectedValue+ "_"+DateTime.Now.ToString("ddMMhhmmss")+"_"+uiFileUploadPhoto.FileName;
         uiFileUploadPhoto.SaveAs(Server.MapPath("~" + path));
         db.AddGalleryPhoto(uiTextBoxEnNewsTitle.Text, uiTextBoxArNewsTitle.Text, path, Convert.ToInt32(uiDropDownListCat.SelectedValue));
         BindData();
     }
 }
Exemplo n.º 29
0
        protected void uiImageButtonLogin_Click(object sender, ImageClickEventArgs e)
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();
            ds = db.GetStudentByUserNameAndSecertCode(uiTextBoxUserName.Text, uiTextBoxSecertCode.Text);

            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["CurrentLoggedInStudent"] = ds.Tables[0].Rows[0]["StudentID"].ToString();
                Response.Redirect("MyAccount.aspx");
            }
        }
        private void BindData()
        {
            DBLayer db = new DBLayer();

            DataSet attendance = new DataSet();

            attendance = db.GetMonthlyAttendanceReportByStudentIDAndDate(Convert.ToInt32(Session["CurrentLoggedInStudent"].ToString()), DateTime.ParseExact("01/" + (uiDropDownListMonth.SelectedValue.Length == 1 ? "0" + uiDropDownListMonth.SelectedValue : uiDropDownListMonth.SelectedValue) + "/" + uiDropDownListYear.SelectedValue, "dd/MM/yyyy", null));

            uiRepeaterAttendance.DataSource = attendance;
            uiRepeaterAttendance.DataBind();

            uiPanelAttendance.Visible = true;
        }