Ejemplo n.º 1
0
        protected void ChangePage(string type)
        {
            string activeLang   = (Session["lang"] == null) ? Languages.Default : Utils.ConvertToTrimmedString(Session["lang"]);
            int    activePage   = (Session["page"] == null) ? 0 : int.Parse(Session["page"].ToString());
            var    activeAudit  = Audit.GetUserActiveAudit(new ActiveUser().UserName);
            var    groups       = activeAudit.AuditQuestionGroups;
            int    groups_count = groups.Rows.Count;

            if (groups != null)
            {
                switch (type)
                {
                case ToolbarButtons.NextPage:
                    activePage++;
                    if (activePage >= groups_count)
                    {
                        activePage = 0;
                    }
                    break;

                case ToolbarButtons.PrevPage:
                    activePage--;
                    if (activePage < 0)
                    {
                        activePage = groups_count - 1;
                    }
                    break;
                }
                Session["page"] = activePage;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ActiveUser.IsAuthenticated)
            {
                Response.Redirect(Pages.Login);
            }
            var activeAudit = Audit.GetUserActiveAudit(new ActiveUser().UserName);

            if (activeAudit == null)
            {
                Response.Redirect(Pages.Default);
            }
            SetupGridview(activeAudit);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ActiveUser.IsAuthenticated)
            {
                Response.Redirect(Pages.Login);
            }
            var activeUser = new ActiveUser();

            if (Audit.GetUserActiveAudit(activeUser.UserName) != null)
            {
                Response.Redirect(Pages.PerformAudit);
            }
            lblGreetings.Text  = $"Hello {activeUser.FullName}!";
            lblInfo.Text       = Utils.ConvertToTrimmedString(Session["message"]);
            Session["message"] = null;
            cbAuditTarget.DataBind();
            cbAuditShiftName.DataBind();
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title      = AppUtils.PageTitle;
            lblAppName.Text = AppUtils.AppName;
            submenu.FindItem("LOGIN").Text = ActiveUser.IsAuthenticated ? "LOG OUT" : "LOG IN";
            if (ActiveUser.IsAuthenticated)
            {
                var activeAudit = Audit.GetUserActiveAudit(new ActiveUser().UserName);
                if (activeAudit != null)
                {
                    submenu.FindItem("AUDIT").NavigateUrl = Pages.PerformAudit;
                }
            }
            var settingsButton = submenu.FindItem("SETTINGS");

            if (settingsButton != null && !(ActiveUser.IsInRole(AppRoles.AuditorAdmin) || ActiveUser.IsInRole(AppRoles.UserAdmin)))
            {
                submenu.Items.Remove(settingsButton);
            }
            MenuSelecting(submenu.Items);
        }