Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AddClass, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/StudentAfair/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        StdClass sttclass = new StdClass();
                        sttclass.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        //txtNoOfStudent.Text=sttclass.
                        txtClassName.Text        = sttclass.Name;
                        ddlEdtYear.SelectedValue = sttclass.EdID.ToString();
                        if (sttclass.SupID != 0)
                        {
                            ddlSup.SelectedValue = sttclass.SupID.ToString();
                        }

                        ASPxGridView1.DataSource = sttclass.CoursesTeachers;
                        ASPxGridView1.DataBind();
                        string    sql = "select ID as TeacherID,Name as TeacherName from Std_Teacher ";
                        DataTable dt  = DataAccess.ExecuteSQLQuery(sql);
                        GridViewDataComboBoxColumn regioncolumn = (ASPxGridView1.Columns["clTeacher"] as GridViewDataComboBoxColumn);
                        regioncolumn.PropertiesComboBox.DataSource = dt;
                        regioncolumn.PropertiesComboBox.ValueField = "TeacherID";
                        regioncolumn.PropertiesComboBox.TextField  = "TeacherName";
                        Session["table"] = sttclass.CoursesTeachers;
                        btnSave.Visible  = false;
                        btnEdit.Visible  = true;
                    }
                    else
                    {
                        btnSave.Visible = true;
                        btnEdit.Visible = false;
                    }
                }
            }
            if (IsPostBack)
            {
                ASPxGridView1.DataSource = Session["table"];
                ASPxGridView1.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewDocuments, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/StudentAfair/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "notpass")
                {
                    Response.Write("<script>alert('لم يتم الحفظ');</script>");
                }
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        Document doc = new Document();
                        doc.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        txtName.Text = doc.Name;
                        //FileUpload1.ResolveUrl(doc.URL);
                        Course course = new Course();
                        course.get(doc.CourseID);
                        ddlcourses.Text = course.Name;
                        StdClass stdclass = new StdClass();
                        stdclass.get(doc.ClassID);
                        ddlClasse.Text      = stdclass.Name;
                        btnEdit.Visible     = true;
                        linkButton1.Visible = true;
                        //   downloadUrl = doc.URL;
                    }
                    else
                    {
                        linkButton1.Visible = false;

                        btnEdit.Visible = false;
                    }
                }
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["user"] == null)
     {
         Response.Redirect("~/Default.aspx");
     }
     else
     {
         if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewClass, Request.Cookies["user"]["Permission"].ToString()))
         {
             Response.Redirect("~/StudentAfair/UnAuthorized.aspx");
         }
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["id"].ToString() != null)
         {
             if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
             {
                 StdClass sttclass = new StdClass();
                 sttclass.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                 EducationalYear edy = new EducationalYear();
                 edy.get(sttclass.EdID);
                 txtClassName.Text = sttclass.Name;
                 ddlEdtYear.Text   = edy.Name;
                 Teacher teacher = new Teacher();
                 teacher.get(sttclass.SupID);
                 ddlSup.Text = teacher.Name;
                 ASPxGridView1.DataSource = sttclass.CoursesTeachers;
                 ASPxGridView1.DataBind();
                 btnEdit.Visible = true;
             }
             else
             {
                 btnEdit.Visible = false;
             }
         }
     }
 }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewStudent, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/StudentAfair/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"].ToString() != null)
                {
                    if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                    {
                        Student student = new Student();
                        student.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                        lblStudentID.Text = student.ID.ToString();
                        Parent parent = new Parent();
                        lblStudentName.Text = student.Name;
                        parent.get(student.ParentID);
                        lblParentName.Text = parent.Name;
                        lblParentJob.Text  = parent.Job;
                        lblBirthDate.Text  = student.BirthDate.ToShortDateString();
                        DateTime ioct = new DateTime(DateTime.Now.Year, 10, 1);
                        lbl1oct.Text    = (((ioct - student.BirthDate)).TotalDays / 365).ToString();
                        ddlType.Text    = student.Type.ToString();
                        lblAddress.Text = student.Address.ToString();
                        lblPhone.Text   = student.Phone;
                        StdClass sclass = new StdClass();
                        sclass.get(student.StudClass);
                        lblClass.Text    = sclass.Name;
                        lblGender.Text   = student.Gender;
                        lblReligion.Text = student.Religion;
                        if (student.LearningDisabilities == 1)
                        {
                            cbtxtDisabilities.Checked = true;
                        }
                        else
                        {
                            cbtxtDisabilities.Checked = false;
                        }
                        txtDisabilities.Text = student.Note;
                        if (student.Father != 0)
                        {
                            parent.get(student.Father);
                            lblFather.Text   = parent.Name;
                            txtfjob.Text     = parent.Job;
                            txtfPhone.Text   = parent.Phone;
                            txtfAddress.Text = parent.Address;
                        }
                        if (student.Mother != 0)
                        {
                            parent.get(student.Mother);
                            ddlMpther.Text   = parent.Name;
                            txtmJob.Text     = parent.Job;
                            txtmphone.Text   = parent.Phone;
                            txtmAddress.Text = parent.Address;
                        }

                        btnEdit.Visible = true;
                        DataTable dt = new DataTable();//Exams
                        ASPxGridView3.DataSource = dt;
                        ASPxGridView3.DataBind();
                        StdClass c = new StdClass();
                        c.get(student.StudClass);
                        DataTable dt2 = new EducationalYear().GetCourses(c.EdID);//Courses
                        coursesGrid.DataSource = dt2;
                        coursesGrid.DataBind();
                        DataTable dt3 = new Student().getAbsent(int.Parse(lblStudentID.Text));//Absents
                        absentGrid.DataSource = dt3;
                        absentGrid.DataBind();
                    }
                    else
                    {
                        btnEdit.Visible = false;
                    }
                }
                AddSubmitEvent();
            }
            AddSubmitEvent();
        }