예제 #1
0
        /// <summary>
        /// Depending on the user's role we can/will use different menus
        /// Also we will load the users own personalised Launch pad.
        /// </summary>
        private void LoadMenu()
        {
            //Get the theme name if it isn't Orchestrator so that it can be used to select the menu
            string themeName = Page.Theme;

            if (themeName.Equals("Orchestrator", StringComparison.CurrentCultureIgnoreCase))
            {
                themeName = string.Empty;
            }

            if (user.IsInRole(((int)eUserRole.ClientUser).ToString()))
            {
                if (!Page.IsPostBack)
                {
                    RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Client.xml", themeName));
                }

                WhiteLabelHeader();
            }
            else
            if (!Page.IsPostBack)
            {
                RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Default.xml", themeName));
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //bool performAction = !(this.Request.QueryString["action"] == null);
            //if (performAction)
            //{
            //    string action = this.Request.QueryString["action"].ToString();
            //    switch (action)
            //    {
            //        case "dn": // delivery note
            //            Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');", true);
            //            break;

            //        case "bf": // booking form
            //            Page.ClientScript.RegisterStartupScript(this.GetType(), "bookingform", "NewBookingForm();", true);
            //            break;

            //        case "pil": // pallet identification label
            //            Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "window.open('" + Page.ResolveClientUrl("../reports/reportviewer.aspx?wiz=true") + "');", true);
            //            break;

            //        default:
            //            break;
            //    }
            //}

            Entities.CustomPrincipal cp = Page.User as Entities.CustomPrincipal;
            if (cp.IsInRole(((int)eUserRole.ClientUser).ToString()))
            {
                // Hide scan booking form button for client users, only allow upload.
                lblClientConfirmationMessage.Visible = true;
            }

            ShowOptions();
        }
예제 #3
0
        private void GetClientId()
        {
            Entities.CustomPrincipal cp = Page.User as Entities.CustomPrincipal;

            if (cp.IsInRole(((int)eUserRole.ClientUser).ToString()))
            {
                Facade.IUser  facUser = new Facade.User();
                SqlDataReader reader  = facUser.GetRelatedIdentity(((Entities.CustomPrincipal)Page.User).UserName);
                reader.Read();

                if ((eRelationshipType)reader["RelationshipTypeId"] == eRelationshipType.IsClient)
                {
                    int RelatedIdentityID = int.Parse(reader["RelatedIdentityId"].ToString());
                    _clientIdentityId = RelatedIdentityID;
                }
                else
                {
                    throw new ApplicationException("User is not a client user.");
                }
            }
        }