protected void Page_Load(object sender, EventArgs e)
 {
     if (Session[SessionVariables.UserIdInSession] == null)
     {
         Response.Redirect("~/AccountManagement/Logout.aspx");
     }
     if (Session[SessionVariables.UserIdInSession] != null)
     {
         var currentlyLoggedInUser =
             PageDataService.GetUserByIdInAdoNet(Convert.ToInt32(Session[SessionVariables.UserIdInSession].ToString()));
         var isAdmin =
             PageDataService.IsUserAdminEntityFrameWork(currentlyLoggedInUser.UserId);
         txtStudentDiscount.Enabled = isAdmin;
     }
 }
示例#2
0
 protected override void OnInit(EventArgs e)
 {
     if (HttpContext.Current.Session[SessionVariables.UserIdInSession] != null)
     {
         var currentlyLoggedInUser =
             PageDataService.GetUserByIdInAdoNet(Convert.ToInt32(Session[SessionVariables.UserIdInSession].ToString()));
         var isAdmin =
             PageDataService.IsUserAdminEntityFrameWork(currentlyLoggedInUser.UserId);
         if (!isAdmin)
         {
             Response.Redirect("/AccountManagement/Logout.aspx", false);
         }
     }
 }
示例#3
0
        protected void ApproveFeeDetailsOfStudent(object sender, EventArgs e)
        {
            var transactionDetail =
                PageDataService.GetTransactionDetailByTransactionDetailIdAdoNet(Convert.ToInt32(hdnTransactionDetailId.Value));

            if (Session[SessionVariables.UserIdInSession] != null && transactionDetail != null)
            {
                var currentlyLoggedInUser =
                    PageDataService.GetUserByIdInAdoNet(Convert.ToInt32(Session[SessionVariables.UserIdInSession].ToString()));

                var isAdmin =
                    PageDataService.IsUserAdminEntityFrameWork(currentlyLoggedInUser.UserId);

                if (isAdmin && chkReject != null && chkApprove != null)
                {
                    PageDataService.UpdateTransactionDetailByTransactionIdAdoNet(transactionDetail.TransactionDetailsId,
                                                                                 chkReject.Checked, chkApprove.Checked);
                    Response.Redirect(Request.RawUrl, false);
                }
            }
        }