Exemple #1
0
        protected override void SetAlerts()
        {
            System.Exception raisedException = Core.WebServer.Server.GetLastError().GetBaseException();
            string           alertsFolder    = "/Alerts/Specific/Exception/";

            foreach (Helpers.Elements.Tabs.Tab tab in this.Tabs)
            {
                switch (tab.Id)
                {
                case "Unhandled":
                    Helpers.Constructor location = new Helpers.Constructor(alertsFolder + "/Unhandled/location.html");
                    location.SetVariable("Location", WebServer.Request.Url.ToString());

                    Helpers.Constructor message = new Helpers.Constructor(alertsFolder + "/Unhandled/message.html");
                    message.SetVariable("Message", raisedException.Message);

                    Helpers.Constructor exceptionType = new Helpers.Constructor(alertsFolder + "/Unhandled/exceptiontype.html");
                    exceptionType.SetVariable("ExceptionType", raisedException.GetType().ToString());

                    tab.Alerts.Add("Location", location.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    tab.Alerts.Add("Message", message.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    tab.Alerts.Add("ExceptionType", exceptionType.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    break;

                case "StackTrace":
                    Helpers.Constructor stackTrace = new Helpers.Constructor(alertsFolder + "stacktrace.html");
                    stackTrace.SetVariable("StackTrace", Utils.FormatStackTrace(raisedException.StackTrace));

                    tab.Alerts.Add("StackTrace", stackTrace.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    break;
                }

                tab.Content.SetVariable("Alerts", tab.Alerts.ToString());
            }
        }
        protected override void SetAlerts()
        {
            System.Exception raisedException = Core.WebServer.Server.GetLastError().GetBaseException();
            string           alertsFolder    = "/Alerts/Specific/Exception/";

            foreach (Helpers.Elements.Tabs.Tab tab in this.Tabs)
            {
                switch (tab.Id)
                {
                case "NotFound":
                    Helpers.Constructor requestedResource = new Helpers.Constructor(alertsFolder + "/Resource/requested.html");
                    requestedResource.SetVariable("RequestedResource", raisedException.Message);

                    Helpers.Constructor raisedType = new Helpers.Constructor(alertsFolder + "/Resource/raised.html");
                    raisedType.SetVariable("RaisedType", raisedException.GetType().ToString());

                    tab.Alerts.Add("RequestedResource", requestedResource.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    tab.Alerts.Add("RaisedType", raisedType.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    break;

                case "StackTrace":
                    Helpers.Constructor stackTrace = new Helpers.Constructor(alertsFolder + "stacktrace.html");
                    stackTrace.SetVariable("StackTrace", Utils.FormatStackTrace(raisedException.StackTrace));

                    tab.Alerts.Add("StackTrace", stackTrace.ToString(), Helpers.Elements.Alerts.Colours.Red, false, false);
                    break;
                }

                tab.Content.SetVariable("Alerts", tab.Alerts.ToString());
            }
        }
Exemple #3
0
        private void SetAssemblyVersions()
        {
            Helpers.Constructor versionsConstructor = new Helpers.Constructor("/Templates/Specific/Login/assemblyversions.html");
            versionsConstructor.SetVariable("Core", AssemblyDetails.Combined);
            versionsConstructor.SetVariable("Cover", Cover.AssemblyDetails.Combined);
            versionsConstructor.SetVariable("UserManagement", UserManagement.AssemblyDetails.Combined);
            versionsConstructor.SetVariable("Resources", Resources.AssemblyDetails.Combined);

            this.Page.SetVariable("AssemblyVersions", versionsConstructor.ToString());
        }
Exemple #4
0
        protected override void SetTabSpecific()
        {
            this.SetAlert();

            foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs)
            {
                switch (tab.Id)
                {
                case "Password":
                    Core.Helpers.Elements.Forms.BasicForm passwordForm = new Core.Helpers.Elements.Forms.BasicForm();
                    passwordForm.Id          = "Password";
                    passwordForm.HasTopSpace = true;
                    passwordForm.PostUrl     = "/account/update/password/";

                    switch (this._alert)
                    {
                    case "passwordmissing":
                        Helpers.Elements.Alerts.Alert missingAlert = new Helpers.Elements.Alerts.Alert("PasswordMissing");
                        missingAlert.Colour  = Helpers.Elements.Alerts.Colours.Red;
                        missingAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/missing.html").ToString();

                        passwordForm.RightPane.Contents = missingAlert.ToString();
                        break;

                    case "passwordold":
                        Helpers.Elements.Alerts.Alert oldAlert = new Helpers.Elements.Alerts.Alert("PasswordOld");
                        oldAlert.Colour  = Helpers.Elements.Alerts.Colours.Red;
                        oldAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/old.html").ToString();

                        passwordForm.RightPane.Contents = oldAlert.ToString();
                        break;

                    case "passwordmatch":
                        Helpers.Elements.Alerts.Alert matchAlert = new Helpers.Elements.Alerts.Alert("PasswordMatch");
                        matchAlert.Colour  = Helpers.Elements.Alerts.Colours.Red;
                        matchAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/match.html").ToString();

                        passwordForm.RightPane.Contents = matchAlert.ToString();
                        break;

                    case "passwordlength":
                        Helpers.Elements.Alerts.Alert lengthAlert       = new Helpers.Elements.Alerts.Alert("PasswordLength");
                        Helpers.Constructor           lengthConstructor = new Helpers.Constructor("/Alerts/Specific/Account/Password/length.html");
                        lengthConstructor.SetVariable("NumChars", Consts.MinimumPasswordLength.ToString());

                        lengthAlert.Colour  = Helpers.Elements.Alerts.Colours.Red;
                        lengthAlert.Message = lengthConstructor.ToString();

                        passwordForm.RightPane.Contents = lengthAlert.ToString();
                        break;

                    case "passwordsuccess":
                        Helpers.Elements.Alerts.Alert successAlert = new Helpers.Elements.Alerts.Alert("PasswordSuccess");
                        successAlert.Colour  = Helpers.Elements.Alerts.Colours.Green;
                        successAlert.Message = new Helpers.Constructor("/Alerts/Specific/Account/Password/success.html").ToString();

                        passwordForm.RightPane.Contents = successAlert.ToString();
                        break;

                    default:
                        passwordForm.RightPane.Contents = " ";
                        break;
                    }

                    passwordForm.AddButton(null, "Clear", null, 5, Core.Helpers.Elements.Forms.ButtonTypes.Reset);
                    passwordForm.AddButton(null, "Change", null, 4, Core.Helpers.Elements.Forms.ButtonTypes.Submit);

                    Core.Helpers.Elements.Forms.Row oldRow = passwordForm.AddRow();
                    oldRow.Description = "<strong>Old Password</strong>";
                    oldRow.SetToTextField("Old", null, null, 1, 0, true, false);

                    Core.Helpers.Elements.Forms.Row newRow = passwordForm.AddRow();
                    newRow.Description = "<strong>New Password</strong>";
                    newRow.SetToTextField("New", null, null, 2, 0, true, false);

                    Core.Helpers.Elements.Forms.Row confirmRow = passwordForm.AddRow();
                    confirmRow.Description = "<strong>Confirm Password</strong>";
                    confirmRow.SetToTextField("Confirm", null, null, 3, 0, true, false);

                    tab.Content.SetVariable("NumChars", Consts.MinimumPasswordLength.ToString());
                    tab.Content.SetVariable("PasswordForm", passwordForm.ToString());
                    break;
                }
            }
        }