Exemplo 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.AddYear, 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)
                    {
                        EducationalYear ed = new EducationalYear();
                        ed.get(Convert.ToInt32(Request.QueryString["id"].ToString()));

                        txtYearName.Text      = ed.Name;
                        ddlRank.SelectedValue = ed.Rank.ToString();
                        txtNoOfLec.Text       = ed.NoOfLec.ToString();
                        txtLecTime.Text       = ed.LecTimeMin.ToString();
                        if (ed.Breaks != null && ed.Breaks.Rows != null && ed.Breaks.Rows.Count > 0)
                        {
                            txtBreakFrom.Text = ed.Breaks.Rows[0]["BreakFrom"].ToString();
                            txtBreakTo.Text   = ed.Breaks.Rows[0]["BreakTo"].ToString();
                        }
                        btnSave.Visible = false;
                        btnEdit.Visible = true;
                    }
                    else
                    {
                        btnSave.Visible = true;
                        btnEdit.Visible = false;
                    }
                }
            }
        }
Exemplo 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.ViewYear, 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)
             {
                 EducationalYear ed = new EducationalYear();
                 ed.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                 lblEducationYearID.Text   = ed.ID.ToString();
                 lblEducationYearName.Text = ed.Name;
                 lblRank.Text             = ed.Rank.ToString();
                 lblLastModifiedDate.Text = ed.LastModifiedDate.ToString();
                 lblCreationDate.Text     = ed.CreationDate.ToString();
                 txtBreakFrom.Text        = ed.Breaks.Rows[0]["BreakFrom"].ToString();
                 txtBreakTo.Text          = ed.Breaks.Rows[0]["BreakTo"].ToString();
                 txtLecTime.Text          = ed.LecTimeMin.ToString();
                 txtNoOfLec.Text          = ed.NoOfLec.ToString();
                 DataTable dt = ed.GetClasses(ed.ID);
                 ASPxGridView2.DataSource = dt;
                 ASPxGridView2.DataBind();
                 DataTable dt2 = ed.GetCourses(ed.ID);
                 ASPxGridView1.DataSource = dt2;
                 ASPxGridView1.DataBind();
                 btnEdit.Visible = true;
             }
             else
             {
                 btnEdit.Visible = false;
             }
         }
     }
     AddSubmitEvent();
 }
Exemplo 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;
             }
         }
     }
 }