public static MvcHtmlString Page(this HtmlHelper helper, Pages name)
 {
     var builder = new TagBuilder("meta");
     builder.Attributes.Add("content", name.ToString());
     builder.Attributes.Add("name", "x-page-name");
     return new MvcHtmlString(builder.ToString());
 }
Example #2
0
        public override void Navigate(Pages page)
        {
            LinksHL.CssClass = TheTeamHL.CssClass = ProductsHL.CssClass = "sidepanelLink";

            switch (page)
            {
                case Pages.links:
                    LinksHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.theTeam:
                    TheTeamHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.products:
                case Pages.popStarParties:
                case Pages.cabaretArtists:
                case Pages.karaoke:
                case Pages.popstarExperience:
                    ProductsHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.press:
                    PressHL.CssClass = "sidepanelLinkInactive";
                    break;
                default:
                    break;
            }
        }
 internal void ConfigurePage(Pages key, Type type)
 {
     if (!PageDictionary.ContainsKey(key))
         PageDictionary.Add(key, type);
     else
         PageDictionary[key] = type;
 }
Example #4
0
        public RazorView(Modules.IModuleFactory moduleFactory, Modules.IModuleCatalogService moduleCatalog,
					Pages.Providers.IPageProviderService pageProviderService)
        {
            _moduleCatalog = moduleCatalog;
            _moduleFactory = moduleFactory;
            _pageProviderService = pageProviderService;
        }
Example #5
0
        internal void ConfigurePage(
            SiteSection section,
            Pages page,
            PageTitle title,
            PageSubTitle subTitle,
            PageDescription description,
            NavControlPath controlPath,
            Banner banner,
            bool showMap,
            PageKeyWords keyWords)
        {
            SetBanner(banner);
            Page.Title = title.Value;
            subTitleText.Text = subTitle.Value;
            SetMetaData(description, keyWords);
            ShowMap(showMap);

            if (controlPath.Value != string.Empty)
            {
                Control navControl = LoadControl(controlPath.Value);
                navControl.ID = "navBar";
                SidePanel1.AddControl(navControl);
            }

            SetNavBars(section, page);
        }
        /// <summary>
        /// Resolves the layout virtual path and ensures that file exist on the specified location.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <returns>
        /// If the provided template is not in pure MVC mode returns null.
        /// If the provided template is in pure MVC mode returns virtual path like "~/SfLayouts/some_title.master" and ensures that this path is pointing to existing resource.
        /// Otherwise returns null. 
        /// </returns>
        public virtual string GetVirtualPath(Pages.Model.IPageTemplate template)
        {
            if (template.GetTemplateFramework() != PageTemplateFramework.Mvc)
                return null;

            string templateName;
            var strictTemplate = template as PageTemplate;
            if (strictTemplate != null && strictTemplate.Name != null)
            {
                templateName = strictTemplate.Name;
            }
            else
            {
                var hasTitle = template as IHasTitle;
                if (hasTitle != null)
                    templateName = hasTitle.GetTitle();
                else
                    templateName = null;
            }

            if (templateName == null)
                return null;

            var virtualBuilder = this.CreateLayoutVirtualPathBuilder();
            var layoutVirtualPath = virtualBuilder.BuildPathFromName(templateName);
            var doesLayoutExist = VirtualPathManager.FileExists(layoutVirtualPath);

            if (!doesLayoutExist)
                layoutVirtualPath = null;

            return layoutVirtualPath;
        }
Example #7
0
        public override void Navigate(Pages page)
        {
            RehearsalsHL.Enabled = RecordingHL.Enabled = BookingsHL.Enabled = TheTeamHL.Enabled = true;
            RehearsalsHL.CssClass = RecordingHL.CssClass = BookingsHL.CssClass = TheTeamHL.CssClass = "sidepanelLink";

            switch (page)
            {
                case Pages.rehearsals:
                    RehearsalsHL.Enabled = false;
                    RehearsalsHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.recording:
                    RecordingHL.Enabled = false;
                    RecordingHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.bookings:
                    BookingsHL.Enabled = false;
                    BookingsHL.CssClass = "sidepanelLinkInactive";
                    break;
                case Pages.theTeam:
                    TheTeamHL.Enabled = false;
                    TheTeamHL.CssClass = "sidepanelLinkInactive";
                    break;
            }
        }
Example #8
0
        public frmOptions(Pages selectedPage)
        {
            InitializeComponent();
            EnableDoubleBuffering();
            Controller.ShadeMainForm();
            Populate();
            ucHeading3.Text = "";

            switch (selectedPage)
            {
                case Pages.Programs:
                    tabStrip1.SelectedPage = tabStripPagePrograms;
                    break;
                case Pages.DebugSettings:
                    tabStrip1.SelectedPage = tabStripPageDebugSettings;
                    break;
                case Pages.General:
                    tabStrip1.SelectedPage = tabStripPageGeneral;
                    break;
                case Pages.Files:
                    tabStrip1.SelectedPage = tabStripPageFiles;
                    break;
                default:
                    throw new NotImplementedException("Tab page not handled yet: " + selectedPage.ToString());
            }
        }
        public void To(Pages page)
        {
            string pageName;
            pageUrls.TryGetValue(page,out pageName);

            Driver.Current.Navigate().GoToUrl(string.Format("{0}/{1}", "http://localhost:1392", pageName));
        }
Example #10
0
 public void Navigate(Pages page)
 {
     if (CustomNavPlaceHolder.Controls.Count == 1)
     {
         SidebarNavBase control = CustomNavPlaceHolder.Controls[0] as SidebarNavBase;
         control.Navigate(page);
     }
 }
Example #11
0
 public Page GetPage(Pages page)
 {
     switch (page)
     {
         case Pages.Login: return new LoginPage();
         case Pages.Welcome: return new WelcomePage();
         case Pages.Categories: return new CategoriesListPage();
         case Pages.About: return new AboutPage();
         default: throw new ArgumentException(string.Format("Unknown page type {0}", page));
     }
 }
Example #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HtmlGenericControl _nc = (HtmlGenericControl)Master.FindControl("navHistory");
            _nc.Attributes.Add("class", "active");

            Pages _page = new Pages(this.ConnectionString);
            _page.LitePopulate(ConfigurationManager.AppSettings["Share"], true);
            Bind(_page);
        }
    }
Example #13
0
 internal void ConfigurePage(
     SiteSection section,
     Pages page,
     PageTitle title,
     PageSubTitle subTitle,
     PageDescription description,
     NavControlPath controlPath,
     Banner banner,
     bool showMap)
 {
     Default master = this.Master as Default;
     master.ConfigurePage(section, page, title, subTitle, description, controlPath, banner, showMap);
 }
Example #14
0
 internal void ConfigurePage(
     SiteSection section,
     Pages page,
     PageTitle title,
     PageSubTitle subTitle,
     PageDescription description,
     NavControlPath controlPath,
     Banner banner,
     bool showMap)
 {
     ConfigurePage(section, page, title, subTitle, description, controlPath, banner, showMap,
         new PageKeyWords("Recording Rehearsal Blackpool Lancashire Fylde Studio Rooms Drum School Academy Music"));
 }
Example #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Pages _page = new Pages(this.ConnectionString);
            _page.LitePopulate(ConfigurationManager.AppSettings["Share"], true);

            lit_ViewPhotoTitle.Text = ((SiteContents)_page.PageContents[0]).Description;

            lit_ShareStoryTitle.Text = ((SiteContents)_page.PageContents[1]).Description;

            lit_StoryFromTitle.Text = ((SiteContents)_page.PageContents[2]).Description;
        }
    }
Example #16
0
        /// <summary> Exports page with given index from the specified Visio pages collection. </summary>
        private static void ExportPage(Pages pages, int pageIndex, string outputFolder, string format)
        {
            Page page = null;
            try {
                page = pages[pageIndex];
                string imageName = page.Name;
                if (ShouldIgnorePage(page)) {
                    Console.WriteLine("{0,-2}", $"Ignoring '{imageName}'.");
                    return;
                }

                string imageFileName = Path.Combine(outputFolder, imageName);
                page.Export(imageFileName + "." + format);
                Console.WriteLine("{0,-2}", $"'{imageName}' done.");
            } finally {
                if (page != null) Marshal.ReleaseComObject(page);
            }
        }
Example #17
0
        /// <summary>
        /// Resolves the layout virtual path and ensures that file exist on the specified location.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <returns>
        /// If the provided template is not in pure MVC mode returns null.
        /// If the provided template is in pure MVC mode returns virtual path like "~/SfLayouts/some_title.master" and ensures that this path is pointing to existing resource.
        /// Otherwise returns null. 
        /// </returns>
        public virtual string GetVirtualPath(Pages.Model.IPageTemplate template)
        {
            if (template.GetTemplateFramework() != PageTemplateFramework.Mvc)
                return null;

            var iHasTitle = template as IHasTitle;

            if (iHasTitle == null)
                return null;

            string templateTitle = iHasTitle.GetTitle();
            var vpBuilder = new LayoutVirtualPathBuilder();
            var layoutVirtualPath = vpBuilder.BuildPathFromTitle(templateTitle);
            var doesLayoutExist = VirtualPathManager.FileExists(layoutVirtualPath);

            if (!doesLayoutExist)
                layoutVirtualPath = null;

            return layoutVirtualPath;
        }
Example #18
0
        protected void CheckPageIsCorrect(Pages expectedPage)
        {
            IWebElement actualPage = null;
            try
            {
                // Let page settle
                if (Driver.GetType() == typeof (InternetExplorerDriver))
                {
                    Thread.Sleep(1000);
                }
                actualPage = Driver.FindElement(By.CssSelector("meta[name='x-page-name']"));
            }
            catch (Exception)
            {
                Assert.Fail("Could not determine which page we are on.");
            }

            var actualPageName = actualPage.GetAttribute("content");
            var expectedPageName = expectedPage.ToString();

            var msg = string.Format("Expected expectedPage '{0}' but found expectedPage '{1}'", expectedPageName, actualPageName);
            Assert.AreEqual(expectedPageName, actualPageName, msg);
        }
Example #19
0
        public static void GoToPage(this PhoneApplicationPage currentPage, Pages page, String id)
        {
            switch (page)
            {
                case (Pages.Main):
                currentPage.NavigationService.Navigate(new Uri("/MainPage.xaml",UriKind.Relative));
                break;

                case (Pages.Action):
                String uri = "/TaskPage.xaml?Text="+id;
                currentPage.NavigationService.Navigate(new Uri(uri, UriKind.Relative));
                break;

                case (Pages.CreateTask):
                currentPage.NavigationService.Navigate(new Uri("/CreateTask.xaml", UriKind.Relative));
                break;

                case(Pages.Stats):
                currentPage.NavigationService.Navigate(new Uri("/StatsPage.xaml", UriKind.Relative));
                break;

            }
        }
        internal override bool SaveObject(FileInfo file, Pages data)
        {
            if (file.Extension == ".poml")
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Pages));
                using (StreamWriter writer = new StreamWriter(file.FullName))
                {
                    using (XmlWriter xwriter = XmlWriter.Create(writer, new XmlWriterSettings() { Indent = true, OmitXmlDeclaration = true }))
                    {
                        // Remove namespaces
                        XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
                        namespaces.Add("", "");

                        // Convert poml object to .poml file
                        serializer.Serialize(xwriter, data, namespaces);

                        return true;
                    }
                }
            }

            return false;
        }
Example #21
0
    protected void Save_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            Boolean _status = true;

            foreach (RepeaterItem I in rpt_Share.Items)
            {
                Label _lbl = (Label)I.FindControl("lbl_ContentId");
                if (_lbl != null)
                {
                    SiteContents _cont = new SiteContents(this.ConnectionString);
                    _cont.LitePopulate(_lbl.Text, true);
                    _cont.Description = ((TextBox)I.FindControl("txt_Desc")).Text;
                    _cont.Title = ((TextBox)I.FindControl("txt_Title")).Text;
                    _cont.Sort = Convert.ToInt32(((TextBox)I.FindControl("txt_Sort")).Text);
                    _cont.PageId = Convert.ToInt32(ConfigurationManager.AppSettings["Share"]);

                    if (!_cont.Save(true, null))
                    {
                        lbl_Error.Text = "An unexpected error has occurred. Please try again.";
                        lbl_Error.Visible = true;
                        _status = false;
                        break;
                    }
                }
            }
            if (_status)
            {
                Pages _page = new Pages(this.ConnectionString);
                _page.LitePopulate(ConfigurationManager.AppSettings["Share"], true);
                Bind(_page);
                this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('Record has been updated successfully.');", true);
            }
        }
    }
Example #22
0
        /// <summary>
        /// Rebuilds the index
        /// </summary>
        /// <returns><c>true</c> if the file has been unindexed succesfully, <c>false</c> otherwise.</returns>
        public static bool RebuildIndex()
        {
            if ((DateTime.Now - Settings.LastPageIndexing).TotalDays > 7 || Collectors.IndexDirectoryProvider.GetDirectory().ListAll().Length == 0)
            {
                Settings.LastPageIndexing = DateTime.Now;
                System.Threading.Thread.Sleep(10000);
                foreach (var provider in Collectors.PagesProviderCollector.AllProviders)
                {
                    if (!provider.ReadOnly)
                    {
                        Log.LogEntry("Starting automatic rebuilding index for provider: " + provider.Information.Name, EntryType.General, Log.SystemUsername);
                        foreach (var nspace in provider.GetNamespaces())
                        {
                            PageInfo[] pages = provider.GetPages(nspace);
                            foreach (var item in pages)
                            {
                                var pageContent = Content.GetPageContent(item, false);
                                UnindexPage(pageContent);
                                IndexPage(pageContent);

                                foreach (var message in item.Provider.GetMessages(item))
                                {
                                    UnindexMessage(message.ID, pageContent);
                                    IndexMessage(message, pageContent);
                                }
                            }
                        }

                        PageInfo[] nonspages = provider.GetPages(null);
                        foreach (var item in nonspages)
                        {
                            var pageContent = Content.GetPageContent(item, false);
                            UnindexPage(pageContent);
                            IndexPage(pageContent);

                            foreach (var message in item.Provider.GetMessages(item))
                            {
                                UnindexMessage(message.ID, pageContent);
                                IndexMessage(message, pageContent);
                            }
                        }
                        Log.LogEntry("Finished automatic rebuilding index for provider: " + provider.Information.Name, EntryType.General, Log.SystemUsername);
                    }
                }
                foreach (var prov in Collectors.FilesProviderCollector.AllProviders)
                {
                    Log.LogEntry("Starting automatic rebuilding index for provider: " + prov.Information.Name, EntryType.General, Log.SystemUsername);
                    var allDirs = prov.ListDirectories(null).ToList();
                    allDirs.Insert(0, "/");
                    foreach (var dir in allDirs)
                    {
                        var allFiles = prov.ListFiles(dir);
                        foreach (var file in allFiles)
                        {
                            FileDetails fileDetails = prov.GetFileDetails(file);
                            FileInfo    fileInfo    = new FileInfo(file);

                            // Index the attached file
                            string tempDir = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), Guid.NewGuid().ToString());
                            if (!System.IO.Directory.Exists(tempDir))
                            {
                                System.IO.Directory.CreateDirectory(tempDir);
                            }
                            string tempFile = Path.Combine(tempDir, fileInfo.Name);
                            using (MemoryStream ms = new MemoryStream(1048576))
                            {
                                prov.RetrieveFile(file, ms, false);
                                ms.Seek(0, SeekOrigin.Begin);
                                using (FileStream temp = File.Create(tempFile))
                                {
                                    ms.CopyTo(temp);
                                }
                                IndexFile(prov.GetType().FullName + "|" + fileInfo.Name, tempFile);
                            }
                            System.IO.Directory.Delete(tempDir, true);
                        }
                    }
                    string[] pagesWithAttachments = prov.GetPagesWithAttachments();
                    foreach (string pageWithAttachments in pagesWithAttachments)
                    {
                        var      pageInfo    = Pages.FindPage(pageWithAttachments);
                        var      pageContent = Content.GetPageContent(pageInfo, false);
                        string[] attachments = prov.ListPageAttachments(pageInfo);
                        foreach (var attachment in attachments)
                        {
                            var fileDetails = prov.GetPageAttachmentDetails(Pages.FindPage(pageWithAttachments), attachment);

                            string name = attachment;
                            // Index the attached file
                            string tempDir = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), Guid.NewGuid().ToString());
                            if (!System.IO.Directory.Exists(tempDir))
                            {
                                System.IO.Directory.CreateDirectory(tempDir);
                            }

                            string tempFile = Path.Combine(tempDir, name);
                            using (MemoryStream ms = new MemoryStream(1048576))
                            {
                                prov.RetrievePageAttachment(pageInfo, attachment, ms, false);
                                ms.Seek(0, SeekOrigin.Begin);
                                using (FileStream temp = File.Create(tempFile))
                                {
                                    ms.CopyTo(temp);
                                }
                                IndexPageAttachment(name, tempFile, pageContent);
                            }
                            System.IO.Directory.Delete(tempDir, true);
                        }
                    }
                    Log.LogEntry("Finished automatic rebuilding files and attachments index for provider: " + prov.Information.Name, EntryType.General, Log.SystemUsername);
                }
            }
            return(true);
        }
 public NavigationFilterAttribute(Pages currentPage)
 {
     CurrentPage = currentPage;
 }
Example #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);

            oPage         = new Pages(intProfile, dsn);
            oUser         = new Users(intProfile, dsn);
            oTPM          = new TPM(intProfile, dsn, intEnvironment);
            oVariable     = new Variables(intEnvironment);
            oProject      = new Projects(intProfile, dsn);
            oOrganization = new Organizations(intProfile, dsn);
            oCustomized   = new Customized(intProfile, dsn);

            if (Request.QueryString["pid"] != "" && Request.QueryString["pid"] != null)
            {
                intProject = Int32.Parse(Request.QueryString["pid"]);
            }

            if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
            {
                intId = Int32.Parse(Request.QueryString["id"]);
            }

            if (Request.QueryString["work"] != "" && Request.QueryString["work"] != null)
            {
                intWorking = Int32.Parse(Request.QueryString["work"]);
            }

            if (Request.QueryString["exec"] != "" && Request.QueryString["exec"] != null)
            {
                intExecutive = Int32.Parse(Request.QueryString["exec"]);
            }

            if (!IsPostBack)
            {
                ds = oTPM.GetCSRC(intId);

                chkDiscovery.Checked          = ds.Tables[0].Rows[0]["d"].ToString() == "1" ? true : false;
                divDiscovery.Style["display"] = chkDiscovery.Checked ? "inline" : "none";
                chkPlanning.Checked           = ds.Tables[0].Rows[0]["p"].ToString() == "1" ? true : false;
                divPlanning.Style["display"]  = chkPlanning.Checked ? "inline" : "none";
                chkExecution.Checked          = ds.Tables[0].Rows[0]["e"].ToString() == "1" ? true : false;
                divExecution.Style["display"] = chkExecution.Checked ? "inline" : "none";
                chkClosing.Checked            = ds.Tables[0].Rows[0]["c"].ToString() == "1" ? true : false;
                divClosing.Style["display"]   = chkClosing.Checked ? "inline" : "none";

                //Discovery
                txtCSRCSD.Text  = ds.Tables[0].Rows[0]["ds"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["ds"].ToString()).ToShortDateString() : "";
                txtCSRCED.Text  = ds.Tables[0].Rows[0]["de"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["de"].ToString()).ToShortDateString() : "";
                txtCSRCID.Text  = ds.Tables[0].Rows[0]["di"].ToString();
                txtCSRCExD.Text = ds.Tables[0].Rows[0]["dex"].ToString();
                txtCSRCHD.Text  = ds.Tables[0].Rows[0]["dh"].ToString();

                //Planning
                txtCSRCSP.Text  = ds.Tables[0].Rows[0]["ps"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["ps"].ToString()).ToShortDateString() : "";
                txtCSRCEP.Text  = ds.Tables[0].Rows[0]["pe"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["pe"].ToString()).ToShortDateString() : "";
                txtCSRCIP.Text  = ds.Tables[0].Rows[0]["pi"].ToString();
                txtCSRCExP.Text = ds.Tables[0].Rows[0]["pex"].ToString();
                txtCSRCHP.Text  = ds.Tables[0].Rows[0]["ph"].ToString();

                // Execution
                txtCSRCSE.Text  = ds.Tables[0].Rows[0]["es"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["es"].ToString()).ToShortDateString() : "";
                txtCSRCEE.Text  = ds.Tables[0].Rows[0]["ee"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["ee"].ToString()).ToShortDateString() : "";
                txtCSRCIE.Text  = ds.Tables[0].Rows[0]["ei"].ToString();
                txtCSRCExE.Text = ds.Tables[0].Rows[0]["eex"].ToString();
                txtCSRCHE.Text  = ds.Tables[0].Rows[0]["eh"].ToString();

                //Closing
                txtCSRCSC.Text  = ds.Tables[0].Rows[0]["cs"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["cs"].ToString()).ToShortDateString() : "";
                txtCSRCEC.Text  = ds.Tables[0].Rows[0]["ce"].ToString() != "" ? DateTime.Parse(ds.Tables[0].Rows[0]["ce"].ToString()).ToShortDateString() : "";
                txtCSRCIC.Text  = ds.Tables[0].Rows[0]["ci"].ToString();
                txtCSRCExC.Text = ds.Tables[0].Rows[0]["cex"].ToString();
                txtCSRCHC.Text  = ds.Tables[0].Rows[0]["ch"].ToString();


                if (ds.Tables[0].Rows[0]["status"].ToString() == "1")
                {
                    strStatus = "Approved";
                }
                if (ds.Tables[0].Rows[0]["status"].ToString() == "-1")
                {
                    strStatus = "Denied";
                }

                hdnStatus.Value = strStatus;
            }

            chkDiscovery.Attributes.Add("onclick", "CheckCSRC('" + chkDiscovery.ClientID + "','" + chkPlanning.ClientID + "','" + chkExecution.ClientID + "','" + chkClosing.ClientID + "','" + divCSRC.ClientID + "');ShowHideDivCheck('" + divDiscovery.ClientID + "',this);");
            chkPlanning.Attributes.Add("onclick", "CheckCSRC('" + chkDiscovery.ClientID + "','" + chkPlanning.ClientID + "','" + chkExecution.ClientID + "','" + chkClosing.ClientID + "','" + divCSRC.ClientID + "');ShowHideDivCheck('" + divPlanning.ClientID + "',this);");
            chkExecution.Attributes.Add("onclick", "CheckCSRC('" + chkDiscovery.ClientID + "','" + chkPlanning.ClientID + "','" + chkExecution.ClientID + "','" + chkClosing.ClientID + "','" + divCSRC.ClientID + "');ShowHideDivCheck('" + divExecution.ClientID + "',this);");
            chkClosing.Attributes.Add("onclick", "CheckCSRC('" + chkDiscovery.ClientID + "','" + chkPlanning.ClientID + "','" + chkExecution.ClientID + "','" + chkClosing.ClientID + "','" + divCSRC.ClientID + "');ShowHideDivCheck('" + divClosing.ClientID + "',this);");

            if (strStatus != "Pending")
            {
                btnUpdate.Attributes.Add("onclick", "return confirm('This CSRC has already been " + strStatus.ToUpper() + "!! By updating this CSRC will initiate the re-routal process.\\nAre you sure ?');");
            }
        }
Example #25
0
 public IEnumerable <string> AllTags()
 {
     return(new List <string>(Pages.Select(p => p.Tags)));
 }
Example #26
0
 public void Duplicate()
 {
     Pages.Duplicate(0, Pages[0]);
     Assert.That(Pages[0].Abstract, Is.EqualTo(Pages[1].Abstract));
     Assert.That(Pages[0].Tags.Count, Is.EqualTo(Pages[1].Tags.Count));
 }
Example #27
0
 public IEnumerable <Page> AllPages()
 {
     return(Pages.ToList());
 }
Example #28
0
        public override void AddGumpLayout()
        {
            base.AddGumpLayout();

            var list = TownCryerSystem.GreetingsEntries;

            Entry = TownCryerSystem.GreetingsEntries[0];

            if (Page >= 0 && Page < list.Count)
            {
                Entry = list[Page];
            }

            int y = 150;

            if (Entry.Title != null)
            {
                if (Entry.Title.Number > 0)
                {
                    AddHtmlLocalized(78, y, 700, 400, Entry.Title.Number, false, false);
                }
                else
                {
                    AddHtml(78, y, 700, 400, Entry.Title.ToString(), false, false);
                }

                y += 40;
            }

            // For now, we're only supporting a cliloc (hard coded greetings per EA) or string (Custom) entries. Not both.
            // Html tags will needed to be added when creating the entry, this will not auto format it for you.
            if (Entry.Body1.Number > 0)
            {
                AddHtmlLocalized(78, y, 700, 400, Entry.Body1.Number, false, false);
            }
            else if (!String.IsNullOrEmpty(Entry.Body1.String))
            {
                var str = Entry.Body1.String;

                if (!String.IsNullOrEmpty(Entry.Body2))
                {
                    if (!str.EndsWith("<br>"))
                    {
                        str += " ";
                    }

                    str += Entry.Body2;
                }

                if (!String.IsNullOrEmpty(Entry.Body3))
                {
                    if (!str.EndsWith("<br>"))
                    {
                        str += " ";
                    }

                    str += Entry.Body3;
                }

                AddHtml(78, y, 700, 400, str, false, false);
            }

            if (Entry.Expires != DateTime.MinValue)
            {
                AddHtmlLocalized(50, 550, 200, 20, 1060658, String.Format("{0}\t{1}", "Created", Entry.Created.ToShortDateString()), 0, false, false);
                AddHtmlLocalized(50, 570, 200, 20, 1060659, String.Format("{0}\t{1}", "Expires", Entry.Expires.ToShortDateString()), 0, false, false);
            }

            AddButton(350, 570, 0x605, 0x606, 1, GumpButtonType.Reply, 0);
            AddButton(380, 570, 0x609, 0x60A, 2, GumpButtonType.Reply, 0);
            AddButton(430, 570, 0x607, 0x608, 3, GumpButtonType.Reply, 0);
            AddButton(455, 570, 0x603, 0x604, 4, GumpButtonType.Reply, 0);

            AddHtml(395, 570, 35, 20, Center(String.Format("{0}/{1}", (Page + 1).ToString(), Pages.ToString())), false, false);

            AddButton(525, 625, 0x5FF, 0x600, 5, GumpButtonType.Reply, 0);
            AddHtmlLocalized(550, 625, 300, 20, 1158386, false, false); // Close and do not show this version again

            if (Entry.Link != null)
            {
                if (!string.IsNullOrEmpty(Entry.LinkText))
                {
                    AddHtml(50, 490, 745, 40, String.Format("<a href=\"{0}\">{1}</a>", Entry.Link, Entry.LinkText), false, false);
                }
                else
                {
                    AddHtml(50, 490, 745, 40, String.Format("<a href=\"{0}\">{1}</a>", Entry.Link, Entry.Link), false, false);
                }
            }

            /*if (TownCryerSystem.HasCustomEntries())
             * {
             *  AddButton(40, 615, 0x603, 0x604, 6, GumpButtonType.Reply, 0);
             *  AddHtmlLocalized(68, 615, 300, 20, 1060660, String.Format("{0}\t{1}", "Sort By", Sort.ToString()), 0, false, false);
             * }*/

            if (User.AccessLevel >= AccessLevel.Administrator)
            {
                if (Entry.CanEdit)
                {
                    AddButton(40, 601, 0x603, 0x604, 7, GumpButtonType.Reply, 0);
                    AddHtml(68, 601, 300, 20, "Edit Greeting", false, false);
                }

                AddButton(40, 623, 0x603, 0x604, 8, GumpButtonType.Reply, 0);
                AddHtml(68, 623, 300, 20, "New Greeting", false, false);

                AddButton(40, 645, 0x603, 0x604, 9, GumpButtonType.Reply, 0);
                AddHtml(68, 645, 300, 20, "Entry Props", false, false);
            }
        }
Example #29
0
 public IEnumerable <Page> FindPagesContainingTag(string tag)
 {
     return(Pages.Where(p => p.Tags.ToLower().Contains(tag.ToLower())));
 }
Example #30
0
 public RepeatSubcomponentsSteps(Pages pages)
 {
     this.pages = pages;
 }
Example #31
0
 /// <summary>
 /// Determines whether a user can approve/reject a draft of a page.
 /// </summary>
 /// <param name="page">The page.</param>
 /// <param name="username">The username.</param>
 /// <param name="groups">The groups.</param>
 /// <returns><c>true</c> if the user can approve/reject a draft of the page, <c>false</c> otherwise.</returns>
 public static bool CanApproveDraft(PageInfo page, string username, string[] groups)
 {
     return(Pages.CanApproveDraft(page, username, groups));
 }
 public static void DeletePages(int PortalID)
 {
     Pages.Delete("Where PortalID=@0", PortalID);
 }
Example #33
0
 public TemplatePage OneTimePage(string contents, string ext = null)
 => Pages.OneTimePage(contents, ext ?? PageFormats.First().Extension);
Example #34
0
        public void TryGetPage(string fromVirtualPath, string virtualPath, out TemplatePage page, out TemplateCodePage codePage)
        {
            var pathMapKey = nameof(TryGetPage) + ">" + fromVirtualPath;
            var mappedPath = GetPathMapping(pathMapKey, virtualPath);

            if (mappedPath != null)
            {
                var mappedPage = Pages.GetPage(mappedPath);
                if (mappedPage != null)
                {
                    page     = mappedPage;
                    codePage = null;
                    return;
                }
                RemovePathMapping(pathMapKey, mappedPath);
            }

            var tryExactMatch = virtualPath.IndexOf('/') >= 0; //if nested path specified, look for an exact match first

            if (tryExactMatch)
            {
                var cp = GetCodePage(virtualPath);
                if (cp != null)
                {
                    codePage = cp;
                    page     = null;
                    return;
                }

                var p = Pages.GetPage(virtualPath);
                if (p != null)
                {
                    page     = p;
                    codePage = null;
                    return;
                }
            }

            //otherwise find closest match from page.VirtualPath
            var parentPath = fromVirtualPath.IndexOf('/') >= 0
                ? fromVirtualPath.LastLeftPart('/')
                : "";

            do
            {
                var seekPath = parentPath.CombineWith(virtualPath);
                var cp       = GetCodePage(seekPath);
                if (cp != null)
                {
                    codePage = cp;
                    page     = null;
                    return;
                }

                var p = Pages.GetPage(seekPath);
                if (p != null)
                {
                    page     = p;
                    codePage = null;
                    SetPathMapping(pathMapKey, virtualPath, seekPath);
                    return;
                }

                if (parentPath == "")
                {
                    break;
                }

                parentPath = parentPath.IndexOf('/') >= 0
                    ? parentPath.LastLeftPart('/')
                    : "";
            } while (true);

            throw new FileNotFoundException($"Page at path was not found: '{virtualPath}'");
        }
Example #35
0
 public static string GetLink(Pages page,string format,params object[] args)
 {
     return Config.UrlBuilder.BuildUrl(string.Format("g={0}&{1}",page,string.Format(format,args)));
 }
Example #36
0
 public IEnumerable <Field> AllFields()
 {
     return(Pages.SelectMany(p => p.AllFields()));
 }
Example #37
0
 public static void Redirect(Pages page,string format,params object[] args)
 {
     System.Web.HttpContext.Current.Response.Redirect(GetLink(page,format,args));
 }
Example #38
0
 public IEnumerable <Page> FindPagesCreatedBy(string username)
 {
     return(Pages.Where(p => p.CreatedBy == username));
 }
Example #39
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder(strDetails);

            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oTPM             = new TPM(intProfile, dsn, intEnvironment);
            oProject         = new Projects(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intId      = Int32.Parse(Request.QueryString["id"]);
                lblId.Text = Request.QueryString["id"];
            }
            if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
            {
                panFinish.Visible = true;
            }
            else
            {
                if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
                {
                    intApplication = Int32.Parse(Request.QueryString["applicationid"]);
                }
                if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
                {
                    intPage = Int32.Parse(Request.QueryString["pageid"]);
                }
                if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                {
                    intApplication = Int32.Parse(Request.Cookies["application"].Value);
                }
                if (!IsPostBack)
                {
                    bool boolDeny = true;
                    if (intId > 0)
                    {
                        ds = oTPM.GetCSRC(intId, intProfile);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            boolDeny = false;
                            bool boolButtons = false;
                            foreach (DataRow dr in ds.Tables[0].Rows)
                            {
                                if (dr["status"].ToString() == "0")
                                {
                                    boolButtons  = true;
                                    lblStep.Text = dr["step"].ToString();
                                }
                            }
                            btnApprove.Enabled = boolButtons;
                            btnDeny.Enabled    = boolButtons;
                        }
                    }
                    if (boolDeny == false)
                    {
                        panWorkflow.Visible = true;
                        int     intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                        int     intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                        int     intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                        DataSet dsResource = oResourceRequest.Get(intRequest, intItem, intNumber);
                        string  strUsers   = "";
                        foreach (DataRow drResource in dsResource.Tables[0].Rows)
                        {
                            int intUser = Int32.Parse(drResource["userid"].ToString());
                            if (strUsers != "")
                            {
                                strUsers += ", ";
                            }
                            strUsers += oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")";
                        }
                        sb.Append("<tr><td nowrap><b>Submitter:</b></td><td width=\"100%\">");
                        sb.Append(strUsers);
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td nowrap><b>Submitted On:</b></td><td width=\"100%\">");
                        sb.Append(ds.Tables[0].Rows[0]["modified"].ToString());
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td nowrap><b>CSRC Document:</b></td><td width=\"100%\"><a href=\"");
                        sb.Append(oVariable.URL());
                        sb.Append("/");
                        sb.Append(ds.Tables[0].Rows[0]["path"].ToString().Replace("\\", "/"));
                        sb.Append("\" target=\"_blank\">Click Here to View</a></td></tr>");
                        sb.Append("<tr><td nowrap><b>Project Information:</b></td><td width=\"100%\"><a href=\"");
                        sb.Append(oPage.GetFullLink(intViewRequest));
                        sb.Append("?rid=");
                        sb.Append(intRequest.ToString());
                        sb.Append("\" target=\"_blank\">Click Here to View</a></td></tr>");

                        lblDetailId.Text = ds.Tables[0].Rows[0]["detailid"].ToString();

                        if (ds.Tables[0].Rows[0]["ds"].ToString() != "")
                        {
                            sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade/></td></tr>");
                            sb.Append("<tr><td nowrap><b>Discovery Phase Start Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["ds"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Discovery Phase End Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["de"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Discovery Internal Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["di"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Discovery External Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["dex"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Discovery HW/SW/One Time Cost:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["dh"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                        }
                        if (ds.Tables[0].Rows[0]["ps"].ToString() != "")
                        {
                            sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade/></td></tr>");
                            sb.Append("<tr><td nowrap><b>Planning Phase Start Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["ps"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Planning Phase End Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["pe"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Planning Internal Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["pi"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Planning External Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["pex"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Planning HW/SW/One Time Cost:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["ph"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                        }
                        if (ds.Tables[0].Rows[0]["es"].ToString() != "")
                        {
                            sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade/></td></tr>");
                            sb.Append("<tr><td nowrap><b>Execution Phase Start Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["es"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Execution Phase End Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["ee"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Execution Internal Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["ei"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Execution External Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["eex"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Execution HW/SW/One Time Cost:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["eh"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                        }
                        if (ds.Tables[0].Rows[0]["cs"].ToString() != "")
                        {
                            sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade/></td></tr>");
                            sb.Append("<tr><td nowrap><b>Closing Phase Start Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["cs"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Closing Phase End Date:</b></td><td width=\"100%\">");
                            sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["ce"].ToString()).ToLongDateString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Closing Internal Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["ci"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Closing External Labor:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["cex"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap><b>Closing HW/SW/One Time Cost:</b></td><td width=\"100%\">$");
                            sb.Append(double.Parse(ds.Tables[0].Rows[0]["ch"].ToString()).ToString("F"));
                            sb.Append("</td></tr>");
                        }
                        sb.Insert(0, "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\">");
                        sb.Append("</table>");
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            strDetails = sb.ToString();
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            btnFinish.Attributes.Add("onclick", "return CloseWindow();");
            btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?');");
            btnDeny.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter some comments') && confirm('Are you sure you want to DENY this request?');");
        }
        private void NextPage()
        {
            switch (CurrentPage)
            {
            case Pages.spectra_page:
            {
                HasPeakBoundaries = BuildPepSearchLibControl.SearchFilenames.All(f => f.EndsWith(BiblioSpecLiteBuilder.EXT_TSV));
                if (BuildPepSearchLibControl.SearchFilenames.Any(f => f.EndsWith(BiblioSpecLiteBuilder.EXT_TSV)) && !HasPeakBoundaries)
                {
                    MessageDlg.Show(this, Resources.ImportPeptideSearchDlg_NextPage_Cannot_build_library_from_OpenSWATH_results_mixed_with_results_from_other_tools_);
                    return;
                }

                var eCancel = new CancelEventArgs();
                if (!BuildPeptideSearchLibrary(eCancel))
                {
                    // Page shows error
                    if (eCancel.Cancel)
                    {
                        return;
                    }
                    CloseWizard(DialogResult.Cancel);
                }

                // The user had the option to finish right after
                // building the peptide search library, but they
                // did not, so hide the "early finish" button for
                // the rest of the wizard pages.
                ShowEarlyFinish(false);

                if (FastaOptional)
                {
                    lblFasta.Text = Resources.ImportPeptideSearchDlg_NextPage_Import_FASTA__optional_;
                }

                // The next page is going to be the chromatograms page.
                var oldImportResultsControl = (ImportResultsControl)ImportResultsControl;

                if (WorkflowType != Workflow.dia || HasPeakBoundaries)
                {
                    oldImportResultsControl.InitializeChromatogramsPage(Document);

                    if (WorkflowType == Workflow.dda)
                    {
                        _pagesToSkip.Add(Pages.transition_settings_page);
                    }
                }
                else
                {
                    // DIA workflow, replace old ImportResultsControl
                    ImportResultsControl = new ImportResultsDIAControl(this)
                    {
                        Anchor   = oldImportResultsControl.Anchor,
                        Location = oldImportResultsControl.Location
                    };
                    getChromatogramsPage.Controls.Remove(oldImportResultsControl);
                    getChromatogramsPage.Controls.Add((Control)ImportResultsControl);
                }
                ImportResultsControl.ResultsFilesChanged += ImportResultsControl_OnResultsFilesChanged;

                // Set up full scan settings page
                TransitionSettingsControl.Initialize(WorkflowType);
                FullScanSettingsControl.ModifyOptionsForImportPeptideSearchWizard(WorkflowType);

                if (!MatchModificationsControl.Initialize(Document))
                {
                    _pagesToSkip.Add(Pages.match_modifications_page);
                }
                if (BuildPepSearchLibControl.FilterForDocumentPeptides)
                {
                    _pagesToSkip.Add(Pages.import_fasta_page);
                }

                // Decoy options enabled only for DIA
                ImportFastaControl.RequirePrecursorTransition = WorkflowType != Workflow.dia;
                ImportFastaControl.DecoyGenerationEnabled     = WorkflowType == Workflow.dia && !HasPeakBoundaries;
            }
            break;

            case Pages.chromatograms_page:
            {
                if (!ImportPeptideSearch.VerifyRetentionTimes(ImportResultsControl.FoundResultsFiles.Select(f => f.Path)))
                {
                    MessageDlg.Show(this, TextUtil.LineSeparate(Resources.ImportPeptideSearchDlg_NextPage_The_document_specific_spectral_library_does_not_have_valid_retention_times_,
                                                                Resources.ImportPeptideSearchDlg_NextPage_Please_check_your_peptide_search_pipeline_or_contact_Skyline_support_to_ensure_retention_times_appear_in_your_spectral_libraries_));
                    CloseWizard(DialogResult.Cancel);
                }

                if (ImportResultsControl.ResultsFilesMissing)
                {
                    if (MessageBox.Show(this, Resources.ImportPeptideSearchDlg_NextPage_Some_results_files_are_still_missing__Are_you_sure_you_want_to_continue_,
                                        Program.Name, MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        return;
                    }
                }

                var foundResults = ImportResultsControl.FoundResultsFiles;
                if (foundResults.Count > 1)
                {
                    // Older Resharper code inspection implementations insist on warning here
                    // Resharper disable PossibleMultipleEnumeration
                    string[] resultNames = foundResults.Select(f => f.Name).ToArray();
                    string   prefix      = ImportResultsDlg.GetCommonPrefix(resultNames);
                    string   suffix      = ImportResultsDlg.GetCommonSuffix(resultNames);
                    // Resharper restore PossibleMultipleEnumeration
                    if (!string.IsNullOrEmpty(prefix) || !string.IsNullOrEmpty(suffix))
                    {
                        using (var dlgName = new ImportResultsNameDlg(prefix, suffix, resultNames))
                        {
                            var result = dlgName.ShowDialog(this);
                            if (result == DialogResult.Cancel)
                            {
                                return;
                            }
                            else if (dlgName.IsRemove)
                            {
                                ImportResultsControl.FoundResultsFiles = ImportResultsControl.FoundResultsFiles.Select(f =>
                                                                                                                       new ImportPeptideSearch.FoundResultsFile(dlgName.ApplyNameChange(f.Name), f.Path)).ToList();

                                ImportResultsControl.Prefix =
                                    string.IsNullOrEmpty(prefix) ? null : prefix;
                                ImportResultsControl.Suffix =
                                    string.IsNullOrEmpty(suffix) ? null : suffix;
                            }
                        }
                    }
                }
            }
            break;

            case Pages.match_modifications_page:
                if (!UpdateModificationSettings())
                {
                    return;
                }
                break;

            case Pages.transition_settings_page:
                // Try to accept changes to transition settings
                if (!UpdateTransitionSettings())
                {
                    return;
                }
                break;

            case Pages.full_scan_settings_page:
                // Try to accept changes to MS1 full-scan settings
                if (!UpdateFullScanSettings())
                {
                    // We can't allow the user to progress any further until
                    // we can verify that the MS1 full scan settings are valid.
                    return;
                }
                break;

            case Pages.import_fasta_page:     // This is the last page
                if (FastaOptional && !ImportFastaControl.ContainsFastaContent || ImportFastaControl.ImportFasta())
                {
                    WizardFinish();
                }
                return;
            }

            var newPage = CurrentPage + 1;

            while (_pagesToSkip.Contains(newPage))
            {
                ++newPage;
            }

            // Skip import FASTA if user filters for document peptides
            if (newPage > Pages.import_fasta_page)
            {
                WizardFinish();
                return;
            }

            CurrentPage = newPage;
            UpdateButtons();
        }
 public void SearchForAuthor(string authorName)
 {
     Pages.Get <HomePage>().Search(authorName);
 }
 public void ValidateFirstResultHeading(string expectedHeading)
 {
     Pages.Get <ResultsPage>().ValidateFirstResultHeading(expectedHeading);
 }
Example #43
0
 public DnnPage Page(string locale)
 {
     return(Pages.Single(pa => pa.CultureCode == locale));
 }
Example #44
0
		void InitScreens()
		{
			Screen_Main = new ScreenMain( Pages.MAIN_MENU );
			Screen_SlotSelection = new ScreenSlotSelect( Pages.SELECT_UNIVERSE );
			Screen_Loading = new ScreenLoading( Pages.LOADING_SCREEN );
			Screen_Play_Select = new ScreenPlaySelect( Pages.SELECT_PLAY_TYPE );
			Screen_Connecting = new ScreenConnecting( Pages.CONNECTING_TO_MASTER_SERVER );
			//Screen_ChooseOption = new ;
			//Screen_SlotSelection Screen_SlotSelection;
			//Screen_Loading Screen_Loading;
			//Screen_Saving Screen_Saving;
			//Screen_Options_Display Screen_Options_Display;

			//			Screen_Options_Sound Screen_Options_Sound;
			//
			//		Screen_Options_Game Screen_Options_Mouse;
			//
			//	Screen_Options_Keymap Screen_Options_Keymap;
			page_up = Pages.NONE;
			active_screen = Screen_Main;
			Basic_Renderer = new Render_Basic();
			Basic_Renderer.GameEnv = this;
		}
Example #45
0
        void Initialize(Pages page)
        {
            var initPage = GetInitializedPage(page.ToString());

            RootPush(initPage);
        }
 public static Pages CreatePages(global::System.Guid pageId, int visitPageIndex, global::System.DateTime dateTime, global::System.Guid itemId, string itemLanguage, int itemVersion, global::System.Guid deviceId, string url, string urlText)
 {
     Pages pages = new Pages();
     pages.PageId = pageId;
     pages.VisitPageIndex = visitPageIndex;
     pages.DateTime = dateTime;
     pages.ItemId = itemId;
     pages.ItemLanguage = itemLanguage;
     pages.ItemVersion = itemVersion;
     pages.DeviceId = deviceId;
     pages.Url = url;
     pages.UrlText = urlText;
     return pages;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            Users oUser = new Users(intProfile, dsn);

            oPlatform        = new Platforms(intProfile, dsn);
            oOrganization    = new Organizations(intProfile, dsn);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oProject         = new Projects(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oVariable        = new Variables(intEnvironment);
            oApplication     = new Applications(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oAppPage         = new AppPages(intProfile, dsn);
            oApprove         = new ProjectRequest_Approval(intProfile, dsn, intEnvironment);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oService         = new Services(intProfile, dsn);


            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            lblDate.Text = DateTime.Now.ToLongDateString();
            lblName.Text = oUser.Get(intProfile, "fname") + " " + oUser.Get(intProfile, "lname");
            //ddlOrganization.Attributes.Add("onchange", "PopulateSegments('" + ddlOrganization.ClientID + "','" + ddlSegment.ClientID + "');");
            //ddlSegment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlSegment.ClientID + "','" + hdnSegment.ClientID + "');");
            //imgRequirement.Attributes.Add("onclick", "return ShowCalendar('" + txtRequirement.ClientID + "');");
            //imgEndLife.Attributes.Add("onclick", "return ShowCalendar('" + txtEndLife.ClientID + "');");
            imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
            imgCompletion.Attributes.Add("onclick", "return ShowCalendar('" + txtCompletion.ClientID + "');");
            txtExecutive.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divExecutive.ClientID + "','" + lstExecutive.ClientID + "','" + hdnExecutive.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstExecutive.Attributes.Add("ondblclick", "AJAXClickRow();");
            txtWorking.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divWorking.ClientID + "','" + lstWorking.ClientID + "','" + hdnWorking.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstWorking.Attributes.Add("ondblclick", "AJAXClickRow();");
            //txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            //lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
            btnPlatformAdd.Attributes.Add("onclick", "return MoveList('" + lstPlatformsAvailable.ClientID + "','" + lstPlatformsCurrent.ClientID + "','" + hdnPlatforms.ClientID + "','" + lstPlatformsCurrent.ClientID + "');");
            lstPlatformsAvailable.Attributes.Add("ondblclick", "return MoveList('" + lstPlatformsAvailable.ClientID + "','" + lstPlatformsCurrent.ClientID + "','" + hdnPlatforms.ClientID + "','" + lstPlatformsCurrent.ClientID + "');");
            btnPlatformRemove.Attributes.Add("onclick", "return MoveList('" + lstPlatformsCurrent.ClientID + "','" + lstPlatformsAvailable.ClientID + "','" + hdnPlatforms.ClientID + "','" + lstPlatformsCurrent.ClientID + "');");
            lstPlatformsCurrent.Attributes.Add("ondblclick", "return MoveList('" + lstPlatformsCurrent.ClientID + "','" + lstPlatformsAvailable.ClientID + "','" + hdnPlatforms.ClientID + "','" + lstPlatformsCurrent.ClientID + "');");
            // chkRequirement.Attributes.Add("onclick", "ShowHideDivCheck('" + divRequirement.ClientID + "',this);");
            //chkEndLife.Attributes.Add("onclick", "ShowHideDivCheck('" + divEndLife.ClientID + "',this);");
            //radTPMYes.Attributes.Add("onclick", "ShowHideDiv('" + divTPMYes.ClientID + "','inline');ShowHideDiv('" + divTPMNo.ClientID + "','none');");
            //radTPMNo.Attributes.Add("onclick", "ShowHideDiv('" + divTPMNo.ClientID + "','inline');ShowHideDiv('" + divTPMYes.ClientID + "','none');");
            //ddlInterdependency.Attributes.Add("onclick", "ShowHideDivDropDown('" + divInterdependency.ClientID + "',this,2,3);");
            //btnPName.Attributes.Add("onclick", "return ShowProjectInfo('" + txtProjectTask.ClientID + "','" + ddlBaseDisc.ClientID + "','" + ddlOrganization.ClientID + "','" + txtClarityNumber.ClientID + "','" + txtProjectTask.ClientID + "','PNAME_SEARCH_NOCV');");
            //txtProjectTask.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnPName.ClientID + "').click();return false;}} else {return true}; ");
            //btnPNumber.Attributes.Add("onclick", "return ShowProjectInfo('" + txtProjectTask.ClientID + "','" + ddlBaseDisc.ClientID + "','" + ddlOrganization.ClientID + "','" + txtClarityNumber.ClientID + "','" + txtClarityNumber.ClientID + "','PNUMBER_SEARCH_NOCV');");
            //txtClarityNumber.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnPNumber.ClientID + "').click();return false;}} else {return true}; ");
            //txtInitiative.Attributes.Add("onfocusin", "InitiativeIn(this);");
            //txtInitiative.Attributes.Add("onfocusout", "InitiativeOut(this);");
            //txtInitiative.Attributes.Add("onkeypress", "return CancelEnter();");
            //txtCapability.Attributes.Add("onkeypress", "return CancelEnter();");
            //lblInvalid.Visible = false;
            lblTitle.Text = "New Project Request";
            if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
            {
                panFinish.Visible = true;
                lblRequest.Text   = Request.QueryString["rid"];
            }
            else if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                lblProject.Text    = Request.QueryString["pid"];
                intProject         = Int32.Parse(lblProject.Text);
                txtInitiative.Text = "(Number of Devices) (Description of Project/Problem)";
                LoadLists();
                panForm.Visible = true;
                btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?pid=" + intProject.ToString() + "&PR=true');");
            }
            else
            {
                if (!IsPostBack)
                {
                    LoadLists();
                    panIntro.Visible = true;
                    txtProjectTask.Focus();
                }
            }
            //btnSubmit.Attributes.Add("onclick", "return ValidateText('" + txtProjectTask.ClientID + "','Please enter a project or task name') && ValidateDropDown('" + ddlBaseDisc.ClientID + "','Please choose if this is a base or Discretionary project') && ValidateDropDown('" + ddlOrganization.ClientID + "','Please choose the organization sponsoring this initiative') && (document.getElementById('" + ddlBaseDisc.ClientID + "').selectedIndex == 1 || ValidateText('" + txtClarityNumber.ClientID + "','Please enter a clarity number'));");
            btnSave.Attributes.Add("onclick", "return ValidateHidden('" + hdnExecutive.ClientID + "','" + txtExecutive.ClientID + "','Please enter the LAN ID of your executive sponsor')" +
                                   " && ValidateHidden('" + hdnWorking.ClientID + "','" + txtWorking.ClientID + "','Please enter the LAN ID of your working sponsor')" +
                                   " && ValidateText('" + txtInitiative.ClientID + "','Please enter the initiative opportunity')" +
                                   " && EnsureInitiative('" + txtInitiative.ClientID + "')" +
                                   " && ValidateList('" + lstPlatformsCurrent.ClientID + "','Please select at least one platform')" +
                                   " && ValidateDate('" + txtCompletion.ClientID + "','Please enter a valid project completion date')" +
                                   ";");
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            btnDiscretionary.Attributes.Add("onclick", "return CloseWindow();");


            // Vijay Code - Start
            ds = oProjectRequest.GetQAs();
            DataSet dsProj = oProject.Get(intProject);

            string strText = "";

            foreach (DataRow drprj in dsProj.Tables[0].Rows)
            {
                foreach (DataRow drqa in ds.Tables[0].Rows)
                {
                    if ((drprj["bd"].ToString() == drqa["bd"].ToString()) && (drprj["organization"].ToString() == drqa["organizationid"].ToString()))
                    {
                        // Response.Write(drqa["questionid"].ToString() + " " + drqa["deleted"].ToString()+"<br>");
                        int intQuestion = Int32.Parse(drqa["questionid"].ToString());
                        int intRequired = oProjectRequest.GetQuestion(intQuestion, "required") == "" ? 0 : Int32.Parse(oProjectRequest.GetQuestion(intQuestion, "required"));

                        oHTMLcontrol = new HtmlGenericControl();
                        TableRow  tr = new TableRow();
                        TableCell td = new TableCell();

                        Label lbl = new Label();
                        lbl.Text    = oProjectRequest.GetQuestion(intQuestion, "question");
                        strText     = lbl.Text;
                        lbl.Width   = Unit.Pixel(150);
                        td.Wrap     = false;
                        td.CssClass = "default";
                        if (intRequired == 1)
                        {
                            lbl.Text += " <font class=\"required\">*</font>";
                        }
                        td.Controls.Add(lbl);


                        tr.Controls.Add(td);
                        dsResp = oProjectRequest.GetResponses(intQuestion, 1);

                        DropDownList ddl = new DropDownList();
                        ddl.CssClass       = "default";
                        ddl.Width          = Unit.Pixel(400);
                        ddl.DataSource     = dsResp;
                        ddl.DataTextField  = "response";
                        ddl.DataValueField = "id";
                        ddl.DataBind();
                        ddl.Items.Insert(0, "--SELECT--");

                        td = new TableCell();
                        td.Controls.Add(ddl);
                        tr.Controls.Add(td);
                        oHTMLcontrol.Controls.Add(tr);
                        phTest.Controls.Add(oHTMLcontrol);

                        string attributes = btnSave.Attributes["onclick"].Replace(";", "");
                        if (intRequired == 1)
                        {
                            attributes += " && ValidateDropDown('" + ddl.UniqueID + "','Please make a selection for " + strText + "');";
                            btnSave.Attributes["onclick"] = attributes;
                        }

                        ddl.Attributes.Add("onchange", "UpdateHidden2('" + intQuestion + "','" + hdnResponseID.ClientID + "'," + ddl.ClientID + ");");
                        //hdnSubmissionID.Value += intQuestion.ToString() + ":" + ddl.SelectedValue + "<br>";
                    }
                }
            }

            // Vijay Code - End
        }
 public void NavigatedToAmazonHomePage()
 {
     Pages.Get <HomePage>().Navigate();
 }
        public void SetOrientation(Pages.PrintPageOrientation orientation)
        {
            this.Client.Application.AssertApplicationAvailable();
            this.Client.Document.AssertDocumentAvailable();

            var app = this.Client.Application.Get();
            var application = app;

            var active_page = application.ActivePage;

            if (orientation != Pages.PrintPageOrientation.Landscape && orientation != Pages.PrintPageOrientation.Portrait)
            {
                throw new System.ArgumentOutOfRangeException(nameof(orientation), "must be either Portrait or Landscape");
            }

            var old_orientation = PageCommands.GetOrientation(active_page);

            if (old_orientation == orientation)
            {
                // don't need to do anything
                return;
            }

            var old_size = this.GetSize();

            double new_height = old_size.Width;
            double new_width = old_size.Height;

            var update = new ShapeSheet.Update(3);
            update.SetFormula(ShapeSheet.SRCConstants.PageWidth, new_width);
            update.SetFormula(ShapeSheet.SRCConstants.PageHeight, new_height);
            update.SetFormula(ShapeSheet.SRCConstants.PrintPageOrientation, (int)orientation);

            using (var undoscope = this.Client.Application.NewUndoScope("Set Page Orientation"))
            {
                update.Execute(active_page.PageSheet);
            }
        }
Example #50
0
 public Pagination(Pages pages)
 {
     PageNumber = pages.PageNumber;
     RowsCount  = pages.RowsCount;
     PagesCount = pages.PagesCount;
 }
Example #51
0
 public override void CreatePages()
 {
     Pages.Add(new HomeBlogPage());
     Pages.Add(new MainBlogPage());
 }
Example #52
0
 public Page GetPageById(int id)
 {
     return(Pages.FirstOrDefault(p => p.Id == id));
 }
 public void AddToPages(Pages pages)
 {
     base.AddObject("Pages", pages);
 }
 // Factory Method implementation
 public override void CreatePages()
 {
     Pages.Add(new SkillsPage());
     Pages.Add(new EducationPage());
     Pages.Add(new ExperiencePage());
 }
Example #55
0
 public static string GetLink(Pages page)
 {
     return Config.UrlBuilder.BuildUrl(string.Format("g={0}",page));
 }
Example #56
0
 private void Abrir(Page p, Pages current)
 {
     sb.Find(setup => setup.Clicked).Default(cores[0]);
     sb[(int)current].Click(cores[1]);
     painel.Content = p;
 }
Example #57
0
 public static void Redirect(Pages page)
 {
     System.Web.HttpContext.Current.Response.Redirect(GetLink(page));
 }
        private void BuildLinks(
            Document document
            )
        {
            Pages pages = document.Pages;
            Page  page  = new Page(document);

            pages.Add(page);

            StandardType1Font font = new StandardType1Font(
                document,
                StandardType1Font.FamilyEnum.Courier,
                true,
                false
                );

            PrimitiveComposer composer      = new PrimitiveComposer(page);
            BlockComposer     blockComposer = new BlockComposer(composer);

            /*
             * 2.1. Goto-URI link.
             */
            {
                blockComposer.Begin(new RectangleF(30, 100, 200, 50), XAlignmentEnum.Left, YAlignmentEnum.Middle);
                composer.SetFont(font, 12);
                blockComposer.ShowText("Go-to-URI link");
                composer.SetFont(font, 8);
                blockComposer.ShowText("\nIt allows you to navigate to a network resource.");
                composer.SetFont(font, 5);
                blockComposer.ShowText("\n\nClick on the box to go to the project's SourceForge.net repository.");
                blockComposer.End();

                try
                {
                    /*
                     * NOTE: This statement instructs the PDF viewer to navigate to the given URI when the link is clicked.
                     */
                    annotations::Link link = new annotations::Link(
                        page,
                        new Rectangle(240, 100, 100, 50),
                        "Link annotation",
                        new GoToURI(
                            document,
                            new Uri("http://www.sourceforge.net/projects/clown")
                            )
                        );
                    link.Border = new annotations::Border(
                        document,
                        3,
                        annotations::Border.StyleEnum.Beveled,
                        null
                        );
                }
                catch (Exception exception)
                { throw new Exception("", exception); }
            }

            /*
             * 2.2. Embedded-goto link.
             */
            {
                string filePath = PromptFileChoice("Please select a PDF file to attach");

                /*
                 * NOTE: These statements instruct PDF Clown to attach a PDF file to the current document.
                 * This is necessary in order to test the embedded-goto functionality,
                 * as you can see in the following link creation (see below).
                 */
                int    fileAttachmentPageIndex = page.Index;
                string fileAttachmentName      = "attachedSamplePDF";
                string fileName = System.IO.Path.GetFileName(filePath);
                annotations::FileAttachment attachment = new annotations::FileAttachment(
                    page,
                    new Rectangle(0, -20, 10, 10),
                    "File attachment annotation",
                    FileSpecification.Get(
                        EmbeddedFile.Get(
                            document,
                            filePath
                            ),
                        fileName
                        )
                    );
                attachment.Name     = fileAttachmentName;
                attachment.IconType = annotations::FileAttachment.IconTypeEnum.PaperClip;

                blockComposer.Begin(new RectangleF(30, 170, 200, 50), XAlignmentEnum.Left, YAlignmentEnum.Middle);
                composer.SetFont(font, 12);
                blockComposer.ShowText("Go-to-embedded link");
                composer.SetFont(font, 8);
                blockComposer.ShowText("\nIt allows you to navigate to a destination within an embedded PDF file.");
                composer.SetFont(font, 5);
                blockComposer.ShowText("\n\nClick on the button to go to the 2nd page of the attached PDF file (" + fileName + ").");
                blockComposer.End();

                /*
                 * NOTE: This statement instructs the PDF viewer to navigate to the page 2 of a PDF file
                 * attached inside the current document as described by the FileAttachment annotation on page 1 of the current document.
                 */
                annotations::Link link = new annotations::Link(
                    page,
                    new Rectangle(240, 170, 100, 50),
                    "Link annotation",
                    new GoToEmbedded(
                        document,
                        new GoToEmbedded.PathElement(
                            document,
                            fileAttachmentPageIndex, // Page of the current document containing the file attachment annotation of the target document.
                            fileAttachmentName,      // Name of the file attachment annotation corresponding to the target document.
                            null                     // No sub-target.
                            ),                       // Target represents the document to go to.
                        new RemoteDestination(
                            document,
                            1,                        // Show the page 2 of the target document.
                            Destination.ModeEnum.Fit, // Show the target document page entirely on the screen.
                            null,
                            null
                            ) // The destination must be within the target document.
                        )
                    );
                link.Border = new annotations::Border(
                    document,
                    1,
                    annotations::Border.StyleEnum.Dashed,
                    new LineDash(new double[] { 8, 5, 2, 5 })
                    );
            }

            /*
             * 2.3. Textual link.
             */
            {
                blockComposer.Begin(new RectangleF(30, 240, 200, 50), XAlignmentEnum.Left, YAlignmentEnum.Middle);
                composer.SetFont(font, 12);
                blockComposer.ShowText("Textual link");
                composer.SetFont(font, 8);
                blockComposer.ShowText("\nIt allows you to expose any kind of link (including the above-mentioned types) as text.");
                composer.SetFont(font, 5);
                blockComposer.ShowText("\n\nClick on the text links to go either to the project's SourceForge.net repository or to the project's home page.");
                blockComposer.End();

                try
                {
                    composer.BeginLocalState();
                    composer.SetFont(font, 10);
                    composer.SetFillColor(DeviceRGBColor.Get(System.Drawing.Color.Blue));
                    composer.ShowText(
                        "PDF Clown Project's repository at SourceForge.net",
                        new PointF(240, 265),
                        XAlignmentEnum.Left,
                        YAlignmentEnum.Middle,
                        0,
                        new GoToURI(
                            document,
                            new Uri("http://www.sourceforge.net/projects/clown")
                            )
                        );
                    composer.ShowText(
                        "PDF Clown Project's home page",
                        new PointF(240, 285),
                        XAlignmentEnum.Left,
                        YAlignmentEnum.Bottom,
                        -90,
                        new GoToURI(
                            document,
                            new Uri("http://www.pdfclown.org")
                            )
                        );
                    composer.End();
                }
                catch
                {}
            }

            composer.Flush();
        }
Example #59
0
 public static void wyswietlOkno(VKurier caller)
 {
     controller = caller;
     Pages.loadPage("/Views/Menu/Kurier/LogowanieKurier.aspx");
 }
Example #60
0
 public IEnumerable <Page> FindPagesModifiedBy(string username)
 {
     return(Pages.Where(p => p.ModifiedBy == username));
 }