protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["supervisorsignin"] != null)
     {
         supervisor = Session["supervisorsignin"] as _Supervisor;
         if (!IsPostBack)
         {
             GetData();
         }
         if (RouteData.Values["id"] != null)
         {
             student.DeleteProfile(Convert.ToInt64(RouteData.Values["id"]));
             Response.Redirect("/Supervisor/Student");
         }
         if (Session["success"] != null)
         {
             pnlResponseSuccess.Visible = true;
             Session.Remove("sucess");
         }
         else if (Session["fail"] != null)
         {
             pnlResponseFail.Visible = true;
             Session.Remove("fail");
         }
     }
     else
     {
         Response.Redirect("/Home");
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Check User is sign in
     if (Session["adminsignin"] != null)
     {
         if (!IsPostBack)
         {
             GetData();
         }
         // Delete
         if (RouteData.Values["id"] != null)
         {
             student.DeleteProfile(Convert.ToInt64(RouteData.Values["id"]));
             Session.Add("delete", true);
             Response.Redirect("/Admin/Student");
         }
         if (Session["delete"] != null)
         {
             pnlDeleteSuccess.Visible = true;
             Session.Remove("delete");
         }
         // Check If Profile Updated
         if (Session["success"] != null)
         {
             pnlResponseSuccess.Visible = true;
             Session.Remove("success");
         }
         else if (Session["fail"] != null)
         {
             pnlResponseFail.Visible = true;
             Session.Remove("fail");
         }
     }
     else
     {
         Response.Redirect("/Home");
     }
 }