Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserLogin"] != null)
            {
                MAS_COMPANYUSER_DTO retUser = (MAS_COMPANYUSER_DTO)Session["UserLogin"];
                if (retUser.RolesNo == 1)
                {
                    MenuItem parent1 = NavigationMenu.FindItem("2");
                    NavigationMenu.Items.Remove(parent1);

                    MenuItem parent = NavigationMenu.FindItem("8");
                    NavigationMenu.Items.Remove(parent);
                }
                else
                {
                    //(retUser.RolesNo == 2)
                    SetVendorMenu();
                }
            }
            else
            {
                FormsAuthentication.SignOut();
                SetDefaultMenu();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((!Roles.IsUserInRole(Context.User.Identity.Name, "Administrators")) && (!Roles.IsUserInRole(Context.User.Identity.Name, "hr_emploee")))
            {
                MenuItem mnuItem = NavigationMenu.FindItem("Manage Users");
                NavigationMenu.Items.Remove(mnuItem);
                mnuItem = NavigationMenu.FindItem("Manage Teams");
                NavigationMenu.Items.Remove(mnuItem);
                mnuItem = NavigationMenu.FindItem("Ustawienia HR");
                NavigationMenu.Items.Remove(mnuItem);
                mnuItem = NavigationMenu.FindItem("HR Manage Holidays");
                NavigationMenu.Items.Remove(mnuItem);
            }

            if ((!Roles.IsUserInRole(Context.User.Identity.Name, "menager")))
            {
                MenuItem mnuItem = NavigationMenu.FindItem("My Team Holidays");
                NavigationMenu.Items.Remove(mnuItem);
            }

            if ((!Roles.IsUserInRole(Context.User.Identity.Name, "emploee")))
            {
                MenuItem mnuItem = NavigationMenu.FindItem("My Holidays");
                NavigationMenu.Items.Remove(mnuItem);
            }
        }
Ejemplo n.º 3
0
        private void SetDefaultMenu()
        {
            MenuItem parent = NavigationMenu.FindItem("3");

            NavigationMenu.Items.Remove(parent);

            MenuItem parent2 = NavigationMenu.FindItem("4");

            NavigationMenu.Items.Remove(parent2);

            MenuItem parent3 = NavigationMenu.FindItem("5");

            NavigationMenu.Items.Remove(parent3);

            MenuItem parent4 = NavigationMenu.FindItem("6");

            NavigationMenu.Items.Remove(parent4);

            MenuItem parent5 = NavigationMenu.FindItem("7");

            NavigationMenu.Items.Remove(parent5);

            MenuItem parent6 = NavigationMenu.FindItem("8");

            NavigationMenu.Items.Remove(parent6);

            MenuItem parent7 = NavigationMenu.FindItem("2");

            NavigationMenu.Items.Remove(parent7);
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!AggCatService.AggCatInstitutions.InstitutionsRetrieved && HttpContext.Current.User.Identity.Name.IsNotNullOrEmpty())
     {
         AggCatService.AggCatInstitutions.GetInstitutionsAsync(Server.MapPath("~/App_Data/FinancialInsitutions.encrypted"), Cache, HttpContext.Current.User.Identity.Name);
     }
     NavigationMenu.FindItem("Your Accounts").Enabled = HttpContext.Current.User.Identity.Name.IsNotNullOrEmpty();
     ErrorMessage = String.Empty;
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
     {
         NavigationMenu.FindItem("Unos rada").Selectable        = false;
         NavigationMenu.FindItem("Uporedjivanje").Selectable    = false;
         NavigationMenu.FindItem("Test").Selectable             = false;
         NavigationMenu.FindItem("Tabela Slicnosti").Selectable = false;
     }
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Context.User.IsInRole("Sales"))
     {
         NavigationMenu.FindItem("Sales").Enabled = true;
     }
     else
     {
         NavigationMenu.FindItem("Sales").Enabled = false;
     }
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Roles.IsUserInRole("Staff"))
     {
         NavigationMenu.Items.Remove(NavigationMenu.FindItem("User"));
         NavigationMenu.Items.Remove(NavigationMenu.FindItem("ReportRedemption"));
         NavigationMenu.Items.Remove(NavigationMenu.FindItem("ReportStockSummary"));
         NavigationMenu.Items.Remove(NavigationMenu.FindItem("ReportMember"));
         NavigationMenu.Items.Remove(NavigationMenu.FindItem("Audit"));
     }
 }
Ejemplo n.º 8
0
        private void SetVendorMenu()
        {
            MenuItem parent = NavigationMenu.FindItem("3");

            NavigationMenu.Items.Remove(parent);

            MenuItem parent2 = NavigationMenu.FindItem("4");

            NavigationMenu.Items.Remove(parent2);

            MenuItem parent4 = NavigationMenu.FindItem("6");

            NavigationMenu.Items.Remove(parent4);

            MenuItem parent5 = NavigationMenu.FindItem("7");

            NavigationMenu.Items.Remove(parent5);
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Inf_UserLoginData userData = new Inf_UserLoginData();
                if (Session["UserLoginData"] == null)
                {
                    Response.BufferOutput = true;
                    Response.Redirect("~/SSO.aspx");
                }
                else
                {
                    userData = (Inf_UserLoginData)Session["UserLoginData"];
                    if (userData != null)
                    {
                        string _EmployeeID  = userData.EmployeeID.Trim();
                        string _displayName = userData.DisplayName;
                        lblLoginName.Text = _displayName;

                        HREmployee_Manage manage = new HREmployee_Manage();
                        HREmployee        hrData = new HREmployee();
                        hrData = manage.GetHREmployeeData(_EmployeeID);
                        if (hrData == null || string.IsNullOrEmpty(hrData.EmployeeID))
                        {
                            MenuItem parent2 = NavigationMenu.FindItem("2");
                            NavigationMenu.Items.Remove(parent2);

                            MenuItem parent3 = NavigationMenu.FindItem("3");
                            NavigationMenu.Items.Remove(parent3);

                            MenuItem parent5 = NavigationMenu.FindItem("5");
                            NavigationMenu.Items.Remove(parent5);
                        }
                    }
                    else
                    {
                        Response.BufferOutput = true;
                        Response.Redirect("~/Unauthorized.aspx");
                    }
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] != null)
            {
                User user = (User)Session["User"];
                lbllogin.Text = "Greetings " + user.UserName.ToString();

                lnkLogin.Visible   = false;
                lnkProfile.Visible = true;
                lnkLogout.Visible  = true;
                NavigationMenu.FindItem("Upload").Enabled = true;
                NavigationMenu.FindItem("MyBook").Enabled = true;
            }
            else
            {
                lnkLogin.Visible   = true;
                lnkProfile.Visible = false;
                lnkLogout.Visible  = false;
                NavigationMenu.FindItem("Upload").Enabled = false;
                NavigationMenu.FindItem("MyBook").Enabled = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["main_userCode"] != null)
            {
                Label1.Text = Convert.ToString(Session["FullName"]);
            }
            else
            {
                Response.Redirect("Login.aspx", false);
            }
            if (Convert.ToInt16(Session["RoleID"]) == 1)
            {
                mySidenav.Visible     = true;
                mySideNavIcon.Visible = true;
            }
            else
            {
                mySidenav.Visible     = false;
                mySideNavIcon.Visible = false;
            }
            // RUN DETAILS
            MenuItem itemRunDetails = new MenuItem();

            itemRunDetails.Text        = "Run Details";
            itemRunDetails.NavigateUrl = "#";
            MenuItem FinditemRun = NavigationMenu.FindItem("Run Details");

            if (Request.Url.AbsoluteUri.ToLower().Contains("rundetails") && FinditemRun == null)
            {
                NavigationMenu.Items.Add(itemRunDetails);
            }

            // PRODUCTION ENTRY
            MenuItem itemProdEntry = new MenuItem();

            itemProdEntry.Text        = "Hourly Production Entry";
            itemProdEntry.NavigateUrl = "#";
            MenuItem FinditemProd = NavigationMenu.FindItem("Hourly Production Entry");

            if (Request.Url.AbsoluteUri.ToLower().Contains("productiondetails") && FinditemProd == null)
            {
                NavigationMenu.Items.Add(itemProdEntry);
            }

            // STOPPAGES ENTRY
            MenuItem itemStoppageEntry = new MenuItem();

            itemStoppageEntry.Text        = "Stoppages Reason Entry";
            itemStoppageEntry.NavigateUrl = "#";
            MenuItem FinditemStoppage = NavigationMenu.FindItem("Stoppages Reason Entry");

            if (Request.Url.AbsoluteUri.ToLower().Contains("stoppagesreason") && FinditemStoppage == null)
            {
                NavigationMenu.Items.Add(itemStoppageEntry);
            }

            // PARAMETER DETAILS
            MenuItem itemParameterEntry = new MenuItem();

            itemParameterEntry.Text        = "Shift Parameters";
            itemParameterEntry.NavigateUrl = "#";
            MenuItem FinditemParameter = NavigationMenu.FindItem("Shift Parameters");

            if (Request.Url.AbsoluteUri.ToLower().Contains("parameterdetails") && FinditemParameter == null)
            {
                NavigationMenu.Items.Add(itemParameterEntry);
            }

            //Quality Check
            MenuItem itemQualityCheckEntry = new MenuItem();

            itemQualityCheckEntry.Text        = "Quality";
            itemQualityCheckEntry.NavigateUrl = "#";
            MenuItem FinditemQualityCheck = NavigationMenu.FindItem("Quality");

            if (Request.Url.AbsoluteUri.ToLower().Contains("qualitycheck") && FinditemQualityCheck == null)
            {
                NavigationMenu.Items.Add(itemQualityCheckEntry);
            }

            if (Page.TemplateControl.AppRelativeVirtualPath.Equals("~/RunDetails.aspx", StringComparison.OrdinalIgnoreCase))
            {
                if (Convert.ToInt16(Session["RoleID"]) == 1)
                {
                    MenuItem itemQualityEntry = new MenuItem();
                    itemQualityEntry.Text        = "Quality";
                    itemQualityEntry.NavigateUrl = "QualityCheck.aspx";
                    MenuItem FinditemQuality = NavigationMenu.FindItem("Quality");
                    if (Request.Url.AbsoluteUri.ToLower().Contains("rundetails") && FinditemQuality == null)
                    {
                        NavigationMenu.Items.Add(itemQualityEntry);
                    }
                }
            }
            if (Page.TemplateControl.AppRelativeVirtualPath.Equals("~/QualityCheck.aspx", StringComparison.OrdinalIgnoreCase))
            {
                if (Convert.ToInt16(Session["RoleID"]) == 1)
                {
                    MenuItem itemProductionEntry = new MenuItem();
                    itemProductionEntry.Text        = "Production";
                    itemProductionEntry.NavigateUrl = "RunDetails.aspx";
                    MenuItem FinditemProduction = NavigationMenu.FindItem("Production");
                    if (Request.Url.AbsoluteUri.ToLower().Contains("qualitycheck") && FinditemProduction == null)
                    {
                        NavigationMenu.Items.Add(itemProductionEntry);
                    }
                }
            }

            foreach (MenuItem item in ((Menu)this.FindControl("NavigationMenu")).Items)
            {
                if (Request.Url.AbsoluteUri.ToLower().Contains("shiftdetails") && item.NavigateUrl.ToLower().Contains("shiftdetails"))
                {
                    item.Selected = true;
                }
                else if (Request.Url.AbsoluteUri.ToLower().Contains("rundetails") && item.NavigateUrl.ToLower().Contains("#"))
                {
                    item.Selected = true;
                }
                else if (Request.Url.AbsoluteUri.ToLower().Contains("productiondetails") && item.NavigateUrl.ToLower().Contains("#"))
                {
                    item.Selected = true;
                }
                else if (Request.Url.AbsoluteUri.ToLower().Contains("stoppagesreason") && item.NavigateUrl.ToLower().Contains("#"))
                {
                    item.Selected = true;
                }
                else if (Request.Url.AbsoluteUri.ToLower().Contains("parameterdetails") && item.NavigateUrl.ToLower().Contains("#"))
                {
                    item.Selected = true;
                }
                else if (Request.Url.AbsoluteUri.ToLower().Contains("qualitycheck") && item.NavigateUrl.ToLower().Contains("#"))
                {
                    item.Selected = true;
                }
            }
        }
Ejemplo n.º 12
0
    private void showCurrentlySelectedView()
    {
        if (Session["SelectedStatView"] == null)
        {
            return;
        }

        if (Session["SelectedStatView"] == "AvgAll")
        {
            NavigationMenu.FindItem("AvgAll").Selected = true;
            Table_AverageScores.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "LowNet")
        {
            //Table_LowestNetSingleRoundScores.Style.Remove("display");
            NavigationMenu.FindItem("LowNet").Selected = true;
            Table_LowestNetSingleRoundScores.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "LowGross")
        {
            NavigationMenu.FindItem("LowGross").Selected = true;
            Table_LowestGrossSingleRoundScores.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "AvgByCourse")
        {
            NavigationMenu.FindItem("AvgByCourse").Selected = true;
            Panel_AverageScoresByCourse.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "IndvPts")
        {
            //Table_.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Skins")
        {
            //Table_Skins.Style.Clear();
            NavigationMenu.FindItem("Skins").Selected = true;
            Table_Skins.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Birdies")
        {
            NavigationMenu.FindItem("Birdies").Selected = true;
            Table_Birdies.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Pars")
        {
            NavigationMenu.FindItem("Pars").Selected = true;
            Table_Pars.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Bogeys")
        {
            NavigationMenu.FindItem("Bogeys").Selected = true;
            Table_Bogeys.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "DoubleBogeys")
        {
            NavigationMenu.FindItem("DoubleBogeys").Selected = true;
            Table_DoubleBogeys.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Eagles")
        {
            NavigationMenu.FindItem("Eagles").Selected = true;
            Table_Eagles.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Par3")
        {
            NavigationMenu.FindItem("Par3").Selected = true;
            Table_Par3Scoring.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Par4")
        {
            NavigationMenu.FindItem("Par4").Selected = true;
            Table_Par4Scoring.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Par5")
        {
            NavigationMenu.FindItem("Par5").Selected = true;
            Table_Par5Scoring.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Handicaps")
        {
            NavigationMenu.FindItem("Handicaps").Selected = true;
            Table_Handicaps.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "CourseStats")
        {
            IndividualStatsMenu.FindItem("CourseStats").Selected = true;
            CourseStats.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "Graph")
        {
            IndividualStatsMenu.FindItem("Graph").Selected = true;
            Graph.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "EventScores")
        {
            IndividualStatsMenu.FindItem("EventScores").Selected = true;
            Panel_IndividualScores.Style.Add("display", "block");
        }
        else if (Session["SelectedStatView"] == "IndividualHoles")
        {
            NavigationMenu.FindItem("IndividualHoles").Selected = true;
            Panel_HoleScores.Style.Add("display", "block");
        }
    }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool PC   = false;
            bool HOME = true;
            bool FOOD = false;
            bool BOOK = true;

            //MenuItem homeMenu = NavigationMenu.FindItem(@"ホーム&キッチン・ペット");

            //if (homeMenu != null)
            //{
            //    homeMenu.ChildItems.RemoveAt(1);
            //}



            if (!PC)
            {
                MenuItem pc = NavigationMenu.FindItem(@"パソコン・オフィス用品");
                if (pc != null)
                {
                    NavigationMenu.Items.Remove(pc);
                }
            }
            MenuItem home = NavigationMenu.FindItem(@"ホーム&キッチン・ペット");

            if (!HOME)
            {
                NavigationMenu.Items.Remove(home);
                if (home != null)
                {
                    NavigationMenu.Items.Remove(home);
                }
            }

            MenuItem homeSubMenu = NavigationMenu.FindItem(@"ホーム&キッチン・ペット/インテリア・家具・寝具");

            if (homeSubMenu != null)
            {
                home.ChildItems.Remove(homeSubMenu);
            }



            if (!FOOD)
            {
                MenuItem food = NavigationMenu.FindItem(@"食品&飲料");
                NavigationMenu.Items.Remove(food);
                if (food != null)
                {
                    NavigationMenu.Items.Remove(food);
                }
            }
            if (!BOOK)
            {
                MenuItem book = NavigationMenu.FindItem(@"本・コミック・雑誌");
                NavigationMenu.Items.Remove(book);
                if (book != null)
                {
                    NavigationMenu.Items.Remove(book);
                }
            }
        }