コード例 #1
0
 private void BindScreen()
 {
     if (ddlRole.SelectedValue != "-1")
     {
         RoleRightsBL      objRoleRightsBL = new RoleRightsBL();
         ApplicationResult objResult       = new ApplicationResult();
         objResult = objRoleRightsBL.RoleRightsScreenName_SelectAll(Convert.ToInt32(rblSelect.SelectedValue));
         if (objResult != null)
         {
             DataTable dtResult = new DataTable();
             dtResult = objResult.resultDT;
             if (dtResult.Rows.Count > 0)
             {
                 gvSelectRights.Visible    = true;
                 gvSelectRights.DataSource = dtResult;
                 gvSelectRights.DataBind();
                 divRoleRight.Visible = true;
             }
             else
             {
                 divRoleRight.Visible   = false;
                 gvSelectRights.Visible = false;
             }
         }
     }
 }
コード例 #2
0
        protected void ddlRole_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                RoleRightsBL      objRoleRightsBL      = new RoleRightsBL();
                DataTable         dtRoleRight          = new DataTable();
                ApplicationResult objApplicationResult = new ApplicationResult();
                DataTable         dt = new DataTable();
                dt.Rows.Clear();
                gvSelectRights.DataSource = dt;
                gvSelectRights.DataBind();
                BindScreen();

                objApplicationResult = objRoleRightsBL.RoleRights_T_Select(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()), 0);
                dtRoleRight          = objApplicationResult.resultDT;
                if (dtRoleRight.Rows.Count > 0)
                {
                    int j = 0;
                    foreach (GridViewRow rowItem in gvSelectRights.Rows)
                    {
                        for (int i = 0; i < dtRoleRight.Rows.Count; i++)
                        {
                            if (gvSelectRights.Rows[j].Cells[0].Text.ToString() == dtRoleRight.Rows[i]["ScreenID"].ToString())
                            {
                                CheckBox chk = (CheckBox)gvSelectRights.Rows[j].FindControl("chkRights");
                                chk.Checked = true;
                                if (ddlRole.SelectedValue == "1")
                                {
                                    chk.Enabled = false;
                                }
                                else
                                {
                                    chk.Enabled = true;
                                }
                            }
                        }
                        j++;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>");
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            if (Session["UserName"] != null)
            {
                lblUserName.Text = Session["UserName"].ToString();

                string sPath = Page.Page.AppRelativeVirtualPath;
                // string str= Request.Url.GetLeftPart(UriPartial.Authority);
                string sRet = sPath.Substring(sPath.LastIndexOf('/') + 1);



                RoleRightsBL      objRoleRightsBL = new RoleRightsBL();
                ApplicationResult objResults      = new ApplicationResult();

                DataTable dtRights       = new DataTable();
                int       flagMaster     = 0;
                int       flagSchool     = 0;
                int       flagInventory  = 0;
                int       flagPayroll    = 0;
                int       flagAccounting = 0;
                int       flagReport     = 0;
                int       flagImport     = 0;
                int       flagRoleRight  = 0;
                int       flagAttendance = 0;
                int       flag           = 0;
                int       flagVersion    = 0;
                int       flagResult     = 0;



                objResults = objRoleRightsBL.RoleRights_T_For_Authorisation(Convert.ToInt32(Session[ApplicationSession.ROLEID].ToString()), Convert.ToInt32(Session[ApplicationSession.TRUSTID].ToString()), Convert.ToInt32(Session[ApplicationSession.SCHOOLID].ToString()));
                if (objResults != null)
                {
                    dtRights = objResults.resultDT;
                    for (int i = 0; i < dtRights.Rows.Count; i++)
                    {
                        #region Menu Hide
                        Control MyList = FindControl("cssmenu");
                        foreach (Control MyControl in MyList.Controls)
                        {
                            if (MyControl is HtmlGenericControl)
                            {
                                HtmlGenericControl li = MyControl as HtmlGenericControl;

                                if (li.ID == dtRights.Rows[i]["DisplayName"].ToString())
                                {
                                    li.Visible = true;
                                    break;
                                }
                            }
                        }
                        //For Masterli
                        if (dtRights.Rows[i]["DisplayName"].ToString() == "Trust")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Department")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Designation")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Employee")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Document")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Status")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "BackUp")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Role")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Leave")
                        {
                            flagMaster = 1;
                        }
                        // For attendance
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Attendance")
                        {
                            flagAttendance = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ApproveLeave")
                        {
                            flagAttendance = 1;
                        }

                        //For School
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "School")
                        {
                            flagSchool = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ManageSchool")
                        {
                            flagSchool = 1;
                        }
                        // For Data Import
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StudentsImport")
                        {
                            flagImport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "EmployeeImport")
                        {
                            flagImport = 1;
                        }

                        //For Inventory
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "MaterialGroup")
                        {
                            flagInventory = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Vendor")
                        {
                            flagInventory = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Material")
                        {
                            flagInventory = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "UOM")
                        {
                            flagInventory = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Purchase")
                        {
                            flagInventory = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StockUpdate")
                        {
                            flagInventory = 1;
                        }
                        //For PayRoll
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "LeaveMaser")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "PayItem")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "TrustTemplate")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "TrustPayItem")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "EmployeePayItem")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "GeneratePayslip")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ProcessPayroll")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "PayRollReport")
                        {
                            flagPayroll = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "LeaveTemplate")
                        {
                            flagPayroll = 1;
                        }

                        //For Accounting
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "AccountLogin")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "AccountGroup")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SerialNo")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "GeneralLedger")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "JournalEntry")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ContraEntry")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Receipts")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Payments")
                        {
                            flagAccounting = 1;
                        }

                        //For Reports
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "GeneralReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "InventoryReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "PayRollReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "AccountingReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StatutoryReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ExamResultReport")
                        {
                            flagReport = 1;
                        }
                        // For Result
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ExamConfiguration")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StudentExamMarks")
                        {
                            flagResult = 1;
                        }
                        // For RoleRight
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "RoleRight")
                        {
                            flagRoleRight = 1;
                        }
                        // For Version Control
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Versioncontrol")
                        {
                            flagVersion = 1;
                        }
                        #endregion
                    }
                    if (sRet != "NotAuthorized.aspx")
                    {
                        for (int j = 0; j < dtRights.Rows.Count; j++)
                        {
                            #region Not Authorized

                            if (sRet == "Home.aspx")
                            {
                                flag = 0;
                                break;
                            }
                            if (dtRights.Rows[j]["ScreenName"].ToString() == sRet)
                            {
                                flag = 0;
                                break;
                            }
                            //else
                            //{
                            //    flag = 1;
                            //}

                            #endregion
                        }
                    }
                    if (flagMaster == 1)
                    {
                        Master.Visible = true;
                    }
                    else
                    {
                        Master.Visible = false;
                    }
                    if (flagAttendance == 1)
                    {
                        AttendanceA.Visible = true;
                    }
                    else
                    {
                        AttendanceA.Visible = false;
                    }
                    if (flagRoleRight == 1)
                    {
                        RoleRight.Visible = true;
                    }
                    else
                    {
                        RoleRight.Visible = false;
                    }
                    if (flagVersion == 1)
                    {
                        Versioncontrol.Visible = true;
                    }
                    else
                    {
                        Versioncontrol.Visible = false;
                    }
                    if (flagImport == 1)
                    {
                        Import.Visible = true;
                    }
                    else
                    {
                        Import.Visible = false;
                    }
                    if (flagSchool == 1)
                    {
                        Schoola.Visible = true;
                    }
                    else
                    {
                        Schoola.Visible = false;
                    }
                    if (flagInventory == 1)
                    {
                        Inventory.Visible = true;
                    }
                    else
                    {
                        Inventory.Visible = false;
                    }
                    if (flagPayroll == 1)
                    {
                        Payroll.Visible = true;
                    }
                    else
                    {
                        Payroll.Visible = false;
                    }
                    //if (flagAccounting == 1)
                    //{
                    //    Accounting.Visible = true;
                    //}
                    //else
                    //{
                    //    Accounting.Visible = false;
                    //}
                    if (flagReport == 1)
                    {
                        Report.Visible = true;
                    }
                    else
                    {
                        Report.Visible = false;
                    }
                    //if (flagResult == 1)
                    //{
                    //    Result.Visible = true;
                    //}
                    //else
                    //{
                    //    Result.Visible = false;
                    //}
                    //if (flag == 1)
                    //{
                    //    Response.Redirect("../ClientUI/NotAuthorized.aspx", false);
                    //}
                }
                if (!Page.IsPostBack)
                {
                    //  FetchImage();
                }
            }
            else
            {
                Response.Redirect("../Default.aspx", false);
            }
            // }
        }
コード例 #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                RoleRightsBO      objRoleRightsBO  = new RoleRightsBO();
                RoleRightsBL      objRoleRightsBL  = new RoleRightsBL();
                ApplicationResult objResultsInsert = new ApplicationResult();
                ApplicationResult objResultsSelect = new ApplicationResult();
                ApplicationResult objResultsDelete = new ApplicationResult();
                DataTable         dtRoleRights     = new DataTable();
                int      j = 0;
                CheckBox chk;
                for (int i = 0; i < gvSelectRights.Rows.Count; i++)
                {
                    objResultsSelect = objRoleRightsBL.RoleRights_T_Select(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), 0, Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                    chk = (CheckBox)gvSelectRights.Rows[i].Cells[2].FindControl("chkRights");
                    if (chk.Checked == true)
                    {
                        if (rblSelect.SelectedValue == "0")
                        {
                            if (objResultsSelect != null)
                            {
                                if (objResultsSelect.resultDT.Rows.Count > 0)
                                {
                                }
                                else
                                {
                                    objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                                    objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                                    objRoleRightsBO.SchoolMID = 0;
                                    objRoleRightsBO.ScreenID  = Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text);
                                    objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                                    if (Convert.ToInt32(gvSelectRights.Rows[i].Cells[1].Text) == 1)
                                    {
                                        ApplicationResult objResults = new ApplicationResult();
                                        SchoolBL          objSchool  = new SchoolBL();
                                        objResults = objSchool.School_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
                                        if (objResults != null)
                                        {
                                            if (objResults.resultDT.Rows.Count > 0)
                                            {
                                                foreach (DataRow dt in objResults.resultDT.Rows)
                                                {
                                                    objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                                                    objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                                                    objRoleRightsBO.SchoolMID = Convert.ToInt32(dt[0].ToString());
                                                    objRoleRightsBO.ScreenID  = Convert.ToInt32(Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                                                    objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                            objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                            objRoleRightsBO.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                            objRoleRightsBO.ScreenID  = Convert.ToInt32(Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                            objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                        }
                    }
                    else
                    {
                        if (rblSelect.SelectedValue == "0")
                        {
                            dtRoleRights = objResultsSelect.resultDT;
                            if (objResultsSelect.resultDT.Rows.Count > 0)
                            {
                                objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), 0, Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                            }
                        }
                        else
                        {
                            objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()), Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                        }
                    }
                }

                if (objResultsInsert.status == ApplicationResult.CommonStatusType.SUCCESS)
                {
                    ClearAll();
                    BindScreen();
                    lblMsg.Visible = true;
                    lblMsg.Text    = "Roles Applied Successfully";
                }

                //objResultsSelect = objRoleRightsBL.RoleRights_Select(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                //if (objResultsSelect != null)
                //{
                //    dtRoleRights = objResultsSelect.resultDT;
                //    if (dtRoleRights.Rows.Count > 0)
                //    {
                //        // objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                //    }
                //}

                //for (int i = 0; i < gvSelectRights.Rows.Count; i++)
                //{
                //    chk = (CheckBox)gvSelectRights.Rows[i].Cells[2].FindControl("chkRights");
                //    if (chk.Checked == true)
                //    {
                //        objRoleRightsBO.RoleID = Convert.ToInt32(ddlRole.SelectedValue);
                //        objRoleRightsBO.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                //        objRoleRightsBO.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                //        objRoleRightsBO.ScreenID = Convert.ToInt32(gvSelectRights.Rows[i].Cells[1].Text);
                //        objResultsInsert = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                //    }
                //}

                //
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>");
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            if (Session["UserName"] != null)
            {
                lblUserName.Text   = Session["UserName"].ToString();
                lblSchoolName.Text = Session[ApplicationSession.SCHOOLNAME].ToString();

                string sPath = Page.Page.AppRelativeVirtualPath;
                // string str= Request.Url.GetLeftPart(UriPartial.Authority);
                string sRet = sPath.Substring(sPath.LastIndexOf('/') + 1);

                if (Convert.ToInt32(Session[ApplicationSession.ISPANEL].ToString()) != 0)
                {
                    divTransfer.Visible = false;
                }
                else
                {
                    divTransfer.Visible = true;
                }


                RoleRightsBL      objRoleRightsBL = new RoleRightsBL();
                ApplicationResult objResults      = new ApplicationResult();

                DataTable dtRights       = new DataTable();
                int       flagMaster     = 0;
                int       flagTimeTable  = 0;
                int       flagInventory  = 0;
                int       flagFees       = 0;
                int       flagAccounting = 0;
                int       flagReport     = 0;
                int       flagStudent    = 0;
                int       flagAttendance = 0;
                int       flagResult     = 0;
                int       flag           = 0;
                int       flagVersion    = 0;


                objResults = objRoleRightsBL.RoleRights_T_For_Authorisation(Convert.ToInt32(Session[ApplicationSession.ROLEID].ToString()), Convert.ToInt32(Session[ApplicationSession.TRUSTID].ToString()), Convert.ToInt32(Session[ApplicationSession.SCHOOLID].ToString()));
                if (objResults != null)
                {
                    dtRights = objResults.resultDT;
                    for (int i = 0; i < dtRights.Rows.Count; i++)
                    {
                        #region Menu Hide
                        Control MyList = FindControl("cssmenu");
                        foreach (Control MyControl in MyList.Controls)
                        {
                            if (MyControl is HtmlGenericControl)
                            {
                                HtmlGenericControl li = MyControl as HtmlGenericControl;

                                if (li.ID == dtRights.Rows[i]["DisplayName"].ToString())
                                {
                                    li.Visible = true;
                                    break;
                                }
                            }
                        }
                        //For Masterli
                        if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolDepartment")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolDesignation")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Section")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Class")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolEmployee")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "DisplayPriority")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Holiday")
                        {
                            flagMaster = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ApplyLeave")
                        {
                            flagMaster = 1;
                        }
                        //Attendance
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StudentAttendence")
                        {
                            flagAttendance = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "EmployeeAttendence")
                        {
                            flagAttendance = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolApproveLeave")
                        {
                            flagAttendance = 1;
                        }
                        //For TimeTable
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Subject")
                        {
                            flagTimeTable = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Period")
                        {
                            flagTimeTable = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SubjectAssociation")
                        {
                            flagTimeTable = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "TimeTable")
                        {
                            flagTimeTable = 1;
                        }
                        // For Student
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Registration")
                        {
                            flagStudent = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Upgradation")
                        {
                            flagStudent = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "DivisionTransfer")
                        {
                            flagStudent = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "PastEducationDetail")
                        {
                            flagStudent = 1;
                        }
                        //For Fees
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "FeesCategory")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "FeesGroup")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ClassFeesTemplate")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StudentFeesTemplate")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "FeesCollection")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "FeesCancellation")
                        {
                            flagFees = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ClassWiseStudentTemplate")
                        {
                            flagFees = 1;
                        }
                        //For Inventory
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Inventory")
                        {
                            flagInventory = 1;
                        }

                        //For Accounting
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolAccountLogin")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolAccountGroup")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolSerialNo")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolGeneralLedger")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolJournalEntry")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolContraEntry")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolReceipts")
                        {
                            flagAccounting = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolPayments")
                        {
                            flagAccounting = 1;
                        }

                        //For Reports
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "GeneralReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolStudentReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolStudentReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolFeesReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolInventoryReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolPayRollReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolAccountingReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolStatutoryReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "SchoolTimeTableReports")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "DEOReport")
                        {
                            flagReport = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ExamResultReport")
                        {
                            flagReport = 1;
                        }
                        //For Result

                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ResultCreation")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Exam")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ClassExamAssociation")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ClassSubjectAssociation")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "StudentSubjectAssociation")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Grade")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "ExamConfiguration")
                        {
                            flagResult = 1;
                        }
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "FinalResult")
                        {
                            flagResult = 1;
                        }



                        // For Version Control
                        else if (dtRights.Rows[i]["DisplayName"].ToString() == "Versioncontrol")
                        {
                            flagVersion = 1;
                        }
                        #endregion
                    }
                    if (sRet != "NotAuthorized.aspx")
                    {
                        for (int j = 0; j < dtRights.Rows.Count; j++)
                        {
                            #region Not Authorized

                            if (sRet == "Home.aspx")
                            {
                                flag = 0;
                                break;
                            }
                            if (dtRights.Rows[j]["ScreenName"].ToString() == sRet)
                            {
                                flag = 0;
                                break;
                            }
                            //else
                            //{
                            //    flag = 1;
                            //}

                            #endregion
                        }
                    }
                    if (flagMaster == 1)
                    {
                        Master.Visible = true;
                    }
                    else
                    {
                        Master.Visible = false;
                    }

                    if (flagAttendance == 1)
                    {
                        SchoolAttendanceA.Visible = true;
                    }
                    else
                    {
                        SchoolAttendanceA.Visible = false;
                    }

                    if (flagTimeTable == 1)
                    {
                        TimeTablea.Visible = true;
                    }
                    else
                    {
                        TimeTablea.Visible = false;
                    }
                    if (flagStudent == 1)
                    {
                        Student.Visible = true;
                    }
                    else
                    {
                        Student.Visible = false;
                    }
                    if (flagInventory == 1)
                    {
                        Inventorya.Visible = true;
                    }
                    else
                    {
                        Inventorya.Visible = false;
                    }
                    //if (flagVersion == 1)
                    //{
                    //    Versioncontrol.Visible = true;
                    //}
                    //else
                    //{
                    //    Versioncontrol.Visible = false;
                    //}
                    if (flagFees == 1)
                    {
                        Fees.Visible = true;
                    }
                    else
                    {
                        Fees.Visible = false;
                    }
                    //if (flagAccounting == 1)
                    //{
                    //    Accounting.Visible = true;
                    //}
                    //else
                    //{
                    //    Accounting.Visible = false;
                    //}
                    if (flagReport == 1)
                    {
                        Report.Visible = true;
                    }
                    else
                    {
                        Report.Visible = false;
                    }
                    if (flagResult == 1)
                    {
                        Result.Visible = true;
                    }
                    else
                    {
                        Result.Visible = false;
                    }
                }


                if (!Page.IsPostBack)
                {
                    FetchImage();
                }
            }
            else
            {
                Response.Redirect("../UserLogin.aspx");
            }
        }