protected void Application_Error(object sender, EventArgs e)
        {
            var lastExc = Server.GetLastError();
            var errcode = Dbl.AddLog(lastExc);
            var url     = string.Format("{0}?errcode={1}", SynNavigation.Pages.ErrorPage, errcode);

            SynNavigation.Goto(url);
        }
Beispiel #2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            Page.PreRender += new EventHandler(PagePreRender);
            if (!LoginProvider && CurrentUser == null)
            {
                SynNavigation.Goto(Pages.Login);
            }
            if (!IsPostBack)
            {
                if (RequiredPermissions.NotEmpty())
                {
                    Title = GenericFormatter.GetEnumDescription(RequiredPermissions[0]);
                }
                else
                {
                    Title = "מסך הבית";
                }


                if (!LoginProvider)
                {
                    BuildSiteMapLinks();
                    bool navSelected = false;

                    if (RequiredPermissions.NotEmpty())
                    {
                        var requiredPermis           = RequiredPermissions.FirstOrDefault();
                        PageLinkAttribute HasNavLink = GetPageLink(requiredPermis);
                        if (HasNavLink != null)
                        {
                            ((HtmlAnchor)Master.FindControl(HasNavLink.NavLink)).Attributes.Add("class", "active");
                            navSelected = true;
                        }
                    }

                    if (!navSelected)
                    {
                        ((HtmlAnchor)Master.FindControl(DefaultNavItem)).Attributes.Add("class", "active");
                    }

                    (Master as WebSimplify.WebSimplify).CurrentUserName = CurrentUser.DisplayName ?? CurrentUser.UserName;
                    (Master as WebSimplify.WebSimplify).IsAdmin         = CurrentUser.IsAdmin;
                }

                foreach (ClientPagePermissions en in RequiredPermissions)
                {
                    if (!CurrentUser.Allowed(en))
                    {
                        SynNavigation.Goto(Pages.Main);
                    }
                }
            }
        }
Beispiel #3
0
 protected void Application_Error(object sender, EventArgs e)
 {
     try
     {
         var lastExc = Server.GetLastError();
         var errcode = Dbl.AddLog(lastExc);
         StoreEx(lastExc);
     }
     catch (Exception ex)
     {
         StoreEx(ex);
     }
     SynNavigation.Goto(Pages.ErrorPage);
 }
Beispiel #4
0
        protected void btnLogin_ServerClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txPass.Value) || string.IsNullOrEmpty(txUname.Value))
            {
                AlertMessage("יש להזין שם משתמש וסיסמה");
                return;
            }
            if (!Validate(txUname.Value, txPass.Value))
            {
                AlertMessage("שם משתמש או סיסמה שגויים");
                return;
            }
            LoggedUser u = DBController.DbAuth.LoadUserSettings(txUname.Value, txPass.Value);

            DBController.SetUser(u);
            SynNavigation.Redirect(SynNavigation.Pages.UserDictionaryPage);
        }
Beispiel #5
0
        public static void Navigate(string destinationpage)
        {
            string url = string.Empty;

            SynNavigation.Goto(url);
        }
 private void Nav(string i_page)
 {
     SynNavigation.Goto(i_page);
 }