Beispiel #1
0
    protected void GridView6_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            String strRangoId = DataBinder.Eval(e.Row.DataItem, "rangoId").ToString();
            // cd_estatus = 3 moroso Parcial
            // unidadNegocio = 'CELAYA'
            // rango_dias

            HyperLink lnkCtoCly = (HyperLink)e.Row.FindControl("lnkCtoCly");
            lnkCtoCly.NavigateUrl = string.Format("~/Admin/ControlCartera/DetalleMorosos.aspx?estatus=2&unidadNegocio=CELAYA&rangoId={0}", strRangoId);
            lnkCtoCly.Dispose();

            HyperLink lnkCtoQro = (HyperLink)e.Row.FindControl("lnkCtoQro");
            lnkCtoQro.NavigateUrl = string.Format("~/Admin/ControlCartera/DetalleMorosos.aspx?estatus=2&unidadNegocio=QUERETARO&rangoId={0}", strRangoId);
            lnkCtoQro.Dispose();

            HyperLink lnkCtoSlp = (HyperLink)e.Row.FindControl("lnkCtoSlp");
            lnkCtoSlp.NavigateUrl = string.Format("~/Admin/ControlCartera/DetalleMorosos.aspx?estatus=2&unidadNegocio=SAN LUIS POTOSI&rangoId={0}", strRangoId);
            lnkCtoSlp.Dispose();

            HyperLink lnkCtoAuto = (HyperLink)e.Row.FindControl("lnkCtoAuto");
            lnkCtoAuto.NavigateUrl = string.Format("~/Admin/ControlCartera/DetalleMorosos.aspx?estatus=2&unidadNegocio=CALVEK&rangoId={0}", strRangoId);
            lnkCtoAuto.Dispose();

            HyperLink lnkCtoIra = (HyperLink)e.Row.FindControl("lnkCtoIra");
            lnkCtoIra.NavigateUrl = string.Format("~/Admin/ControlCartera/DetalleMorosos.aspx?estatus=2&unidadNegocio=IRAPUATO&rangoId={0}", strRangoId);
            lnkCtoIra.Dispose();
        }
    }
Beispiel #2
0
            public void Dispose()
            {
                GC.SuppressFinalize(this);

                if (PicturePanel != null)
                {
                    PicturePanel.Dispose();
                }

                if (Picture != null)
                {
                    Picture.Dispose();
                }

                if (IconLabel != null)
                {
                    IconLabel.Dispose();
                }

                if (LinksPanel != null)
                {
                    LinksPanel.Dispose();
                }

                if (PictureLink != null)
                {
                    PictureLink.Dispose();
                }

                if (DeleteLink != null)
                {
                    DeleteLink.Dispose();
                }
            }
        private void PopulateSiteListControl(List <WebListItem> webList)
        {
            HyperLink          hl = null;
            HtmlGenericControl li = null;
            HtmlGenericControl ul = new HtmlGenericControl("ul");

            try
            {
                foreach (WebListItem webListItem in webList)
                {
                    li = new HtmlGenericControl("li");
                    li.Attributes.Add("title", PageCulture.Format(PageCulture.Resources.ActionsMRUToolTip, Server.HtmlEncode(webListItem.Title)));
                    hl             = new HyperLink();
                    hl.NavigateUrl = AssignmentSiteUrl(webListItem.Url);

                    hl.Text = Server.HtmlEncode(webListItem.Title);
                    li.Controls.Add(hl);
                    hl = null;
                    if (newSite.HasValue && newSite.Value.Equals(webListItem.SPWebGuid))
                    {
                        HtmlImage img = new HtmlImage();
                        img.Src = "Images/NewIcon.gif";
                        li.Controls.Add(img);
                    }
                    ul.Controls.Add(li);
                    li = null;
                }
                siteList.Controls.Add(ul);
                ul = null;
            }
            catch
            {
                if (hl != null)
                {
                    hl.Dispose();
                }
                if (li != null)
                {
                    li.Dispose();
                }
                if (ul != null)
                {
                    ul.Dispose();
                }
                throw;
            }
        }
Beispiel #4
0
        private Control CreateApplicationLogoListItem(string cssClass)
        {
            if (string.IsNullOrEmpty(m_MasterPageSettings.Header.LogoImageUrl))
            {
                return(null);
            }

            HtmlGenericControl li   = null;
            HyperLink          link = null;

            try
            {
                li = new HtmlGenericControl("li");
                if (!string.IsNullOrEmpty(cssClass))
                {
                    li.Attributes["class"] = cssClass;
                }

                link             = new HyperLink();
                link.ImageUrl    = m_MasterPageSettings.Header.LogoImageUrl;
                link.NavigateUrl = m_MasterPage.HeaderLogoNavigateUrl;
                li.Controls.Add(link);

                return(li);
            }
            finally
            {
                if (li != null)
                {
                    li.Dispose();
                }
                if (link != null)
                {
                    link.Dispose();
                }
            }
        }
Beispiel #5
0
        private Control CreateItem(Micajah.Common.Bll.Action item, bool root)
        {
            HtmlGenericControl div   = null;
            HtmlTable          table = null;
            HtmlTableRow       tr    = null;
            HtmlTableCell      td    = null;
            HyperLink          lnk   = null;
            Label lbl = null;

            try
            {
                bool rootAndGroup = (root && item.GroupInDetailMenu);

                if ((!string.IsNullOrEmpty(item.IconUrl)) || (this.Theme == DetailMenuTheme.SideBySide))
                {
                    div = new HtmlGenericControl("div");
                    div.Attributes["class"] = "P";

                    table             = new HtmlTable();
                    table.CellPadding = table.CellSpacing = 0;

                    tr = new HtmlTableRow();
                    td = new HtmlTableCell();

                    if (!string.IsNullOrEmpty(item.IconUrl))
                    {
                        td.Attributes["class"] = "P";
                        if (rootAndGroup)
                        {
                            td.Controls.Add(CreateItemIcon(item, this.IconSize));
                        }
                        else
                        {
                            td.Controls.Add(CreateItemIconLink(item));
                        }
                        tr.Cells.Add(td);

                        td = new HtmlTableCell();
                    }

                    if (rootAndGroup)
                    {
                        lbl      = new Label();
                        lbl.Text = item.CustomName;
                        td.Controls.Add(lbl);
                    }
                    else
                    {
                        lnk = CreateItemLink(item, null, ((this.Theme != DetailMenuTheme.SideBySide) || this.ShowDescriptionAsToolTip.GetValueOrDefault(false)));
                        td.Controls.Add(lnk);
                    }

                    if (item.ShowDescriptionInDetailMenu && (this.Theme != DetailMenuTheme.SideBySide))
                    {
                        if (!item.GroupInDetailMenu)
                        {
                            string descr = item.CustomDescription;
                            if (!string.IsNullOrEmpty(descr))
                            {
                                td.Controls.Add(CreateItemDescription(descr));
                            }
                        }
                    }

                    Control ctrl = CreateChildItems(item);
                    if (ctrl != null)
                    {
                        td.Controls.Add(ctrl);
                    }

                    tr.Cells.Add(td);

                    if (this.Theme == DetailMenuTheme.SideBySide)
                    {
                        if (!this.ShowDescriptionAsToolTip.GetValueOrDefault(false))
                        {
                            if (!(root && item.GroupInDetailMenu) && item.ShowDescriptionInDetailMenu)
                            {
                                td.Width = "35%";

                                td = new HtmlTableCell();
                                td.Attributes["class"] = "D";
                                td.Width     = "65%";
                                td.InnerHtml = item.CustomDescription;
                                tr.Cells.Add(td);
                            }
                        }
                    }

                    table.Rows.Add(tr);
                    div.Controls.Add(table);
                }
                else
                {
                    div = CreateSimpleItem(item, rootAndGroup);
                }

                return(div);
            }
            finally
            {
                if (div != null)
                {
                    div.Dispose();
                }
                if (table != null)
                {
                    table.Dispose();
                }
                if (tr != null)
                {
                    tr.Dispose();
                }
                if (td != null)
                {
                    td.Dispose();
                }
                if (lnk != null)
                {
                    lnk.Dispose();
                }
                if (lbl != null)
                {
                    lbl.Dispose();
                }
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Note: This page is used to link to all samples contained in the solution

            // Generate links and descriptions for the samples
            foreach (string dir in Directory.GetDirectories(String.Format("{0}..", Server.MapPath("/"))))
            {
                string name = new DirectoryInfo(dir).Name;

                if (name == "MyLibrary" || name == "Home")
                {
                    continue;
                }

                HyperLink          link = null;
                HtmlGenericControl p    = null;

                try
                {
                    link      = new HyperLink();
                    link.Text = name;
                    XmlDocument projxml = new XmlDocument();
                    projxml.Load(String.Format(@"{0}\{1}.csproj", dir, name));
                    link.NavigateUrl = String.Format("http://localhost:{0}", projxml.GetElementsByTagName("DevelopmentServerPort")[0].InnerText);
                    PlaceholderLinks.Controls.Add(link);

                    string description = String.Empty;

                    switch (name)
                    {
                    case "AjaxControls":
                        description = "AJAX Sample: Demonstrates how to use the ReportViewer control with other AJAX controls. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "CredentialsNoSession":
                        description = "Demonstrates how to prevent the report server connection information from being stored in the ASP.NET session. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "CustomAssembly":
                        description = "Demonstrates how to use custom assemblies with your RDLC report.";
                        break;

                    case "CustomSkin":
                        description = "Demonstrates how to change the skin of the ReportViewer control. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "CustomStrings":
                        description = "Demonstrates how to use custom UI strings in the ReportViewer control. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "CustomToolBar":
                        description = "AJAX Sample: Demonstrates how to use the client-side APIs to implement a custom toolbar for the ReportViewer control. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "MapAndPrompt":
                        description = "AJAX Sample: Demonstrates how to change the collapsed state of the document map and parameter prompt area without causing a postback. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "PopupDrillthrough":
                        description = "AJAX Sample: Demonstrates how to cause a ReportViewer control to open an AJAX popup when a drillthrough report is clicked. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "RenderingAndPostBack":
                        description = "Demonstrates the rendering and postback behaviors of the ReportViewer control. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "ReportFromStream":
                        description = "Demonstrates how to load an RDLC report from a stream.";
                        break;

                    case "ResettingScrollPosition":
                        description = "AJAX Sample: Demonstrates how to programmatically set the report area scroll position without causing a postback. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "ResizingViewer":
                        description = "AJAX Sample: Demonstrates how to recalculate the ReportViewer layout when its container changes size. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    case "SupplyingData":
                        description = "Demonstrates how to supply data to an RDLC report, as well as any subreport or drillthrough report. It also demonstrates how to change the RDLC report at run time.";
                        break;

                    case "SupplyingParameters":
                        description = "Demonstrates how to supply parameters to a server report. This sample requires the AdventureWorks 2008 Sample Reports.";
                        break;

                    default:
                        break;
                    }

                    p           = new HtmlGenericControl("p");
                    p.InnerText = description;
                    PlaceholderLinks.Controls.Add(p);
                }
                finally
                {
                    link.Dispose();
                    p.Dispose();
                }
            }
        }
Beispiel #7
0
        private Control CreateHeaderLinks()
        {
            if (!(m_MasterPage.VisibleHeaderLinks || m_MasterPage.VisibleSearchControl))
            {
                return(null);
            }

            HtmlGenericControl rightContainer = null;
            Control            links          = null;
            HyperLink          link           = null;
            HtmlGenericControl div            = null;
            HtmlGenericControl li             = null;

            try
            {
                rightContainer = new HtmlGenericControl("div");

                if (m_MasterPage.VisibleHeaderLinks)
                {
                    links = CreateGlobalNavigation(this.Page.Request.IsSecureConnection);
                }

                if (m_ModernTheme)
                {
                    rightContainer.Controls.Add(links);
                }
                else
                {
                    rightContainer.Attributes["class"] = "G";

                    string paddindTop = null;

                    if (links != null)
                    {
                        div = new HtmlGenericControl("div");
                        div.Style["clear"] = "both";
                        div.Controls.Add(links);
                        rightContainer.Controls.Add(div);

                        paddindTop = "8px";
                    }

                    if (m_MasterPage.VisibleSearchControl)
                    {
                        rightContainer.Controls.Add(CreateSearchControl(paddindTop));
                    }
                }

                return(rightContainer);
            }
            finally
            {
                if (rightContainer != null)
                {
                    rightContainer.Dispose();
                }
                if (links != null)
                {
                    links.Dispose();
                }
                if (div != null)
                {
                    div.Dispose();
                }
                if (link != null)
                {
                    link.Dispose();
                }
                if (li != null)
                {
                    li.Dispose();
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// Creates the global navigation links.
        /// </summary>
        /// <param name="isSecureConnection">The flag indicating whether the HTTP connection uses secure sockets.</param>
        /// <returns>The control that represents the global navigation links.</returns>
        private Control CreateGlobalNavigation(bool isSecureConnection)
        {
            ControlList        links = null;
            HyperLink          link  = null;
            HyperLink          link2 = null;
            HtmlGenericControl ul    = null;
            HtmlGenericControl ul2   = null;
            HtmlGenericControl li    = null;
            HtmlGenericControl li2   = null;

            try
            {
                if (m_ModernTheme)
                {
                    ul = new HtmlGenericControl("ul");
                    ul.Attributes["class"] = "nav pull-right";
                }
                else
                {
                    links = new ControlList();
                }

                Micajah.Common.Bll.ActionCollection items = ActionProvider.GlobalNavigationLinks.FindByActionId(ActionProvider.GlobalNavigationLinksActionId).GetAvailableChildActions(m_ActionIdList, m_IsFrameworkAdmin, m_IsAuthenticated);

                if (m_ModernTheme)
                {
                    li = (HtmlGenericControl)CreateApplicationLogoListItem("Al");

                    ul.Controls.Add(li);
                }
                else
                {
                    Micajah.Common.Bll.Action item = items.FindByActionId(ActionProvider.MyAccountMenuGlobalNavigationLinkActionId);

                    if (item != null)
                    {
                        Micajah.Common.Bll.ActionCollection items2 = item.GetAvailableChildActions(m_ActionIdList, m_IsFrameworkAdmin, m_IsAuthenticated);

                        items.AddRange(items2);

                        items.Sort();
                    }
                }

                foreach (Micajah.Common.Bll.Action item in items)
                {
                    link             = new HyperLink();
                    link.NavigateUrl = item.CustomAbsoluteNavigateUrl;
                    link.ToolTip     = item.Description;

                    if (m_ModernTheme)
                    {
                        li = new HtmlGenericControl("li");

                        string iconUrl  = null;
                        string text     = item.CustomName;
                        string cssClass = "Icon";

                        if (item.ActionId == ActionProvider.MyAccountMenuGlobalNavigationLinkActionId)
                        {
                            iconUrl = string.Format(CultureInfo.InvariantCulture, "{0}{1}www.gravatar.com/avatar/{2}?s=24"
                                                    , (isSecureConnection ? Uri.UriSchemeHttps : Uri.UriSchemeHttp), Uri.SchemeDelimiter, Support.CalculateMD5Hash(m_UserContext.Email.ToLowerInvariant()));

                            cssClass += " Avtr";
                        }
                        else
                        {
                            if (item.ActionId == ActionProvider.PageHelpGlobalNavigationLinkActionId)
                            {
                                if (!m_MasterPage.VisibleHelpLink)
                                {
                                    continue;
                                }

                                link.Attributes["onclick"] = m_MasterPage.HelpLinkOnClick;
                            }

                            if (!string.IsNullOrEmpty(item.IconUrl))
                            {
                                iconUrl = item.IconUrl;
                                if (iconUrl.IndexOf("glyphicon", StringComparison.OrdinalIgnoreCase) == -1)
                                {
                                    iconUrl = CustomUrlProvider.CreateApplicationAbsoluteUrl(iconUrl);
                                }
                                else
                                {
                                    using (Label label = new Label())
                                    {
                                        label.CssClass = "glyphicon " + iconUrl;

                                        if (string.IsNullOrEmpty(text))
                                        {
                                            label.CssClass += " no-margin";
                                        }

                                        link.Controls.Add(label);
                                    }

                                    iconUrl = null;
                                }
                            }
                        }

                        if (!string.IsNullOrEmpty(iconUrl))
                        {
                            using (Image image = new Image())
                            {
                                image.ImageUrl = iconUrl;
                                image.CssClass = cssClass;

                                link.Controls.Add(image);
                            }
                        }

                        if (!string.IsNullOrEmpty(text))
                        {
                            using (LiteralControl literal = new LiteralControl(text))
                            {
                                link.Controls.Add(literal);
                            }
                        }

                        li.Controls.Add(link);
                        ul.Controls.Add(li);

                        ActionCollection childActions = item.GetAvailableChildActions(m_ActionIdList, m_IsFrameworkAdmin, m_IsAuthenticated);
                        if (childActions.Count > 0)
                        {
                            link.CssClass = "dropdown-toggle";
                            link.Attributes["data-toggle"] = "dropdown";

                            using (Label label = new Label())
                            {
                                label.CssClass = "caret";
                                link.Controls.Add(label);
                            }

                            ul2 = new HtmlGenericControl("ul");
                            ul2.Attributes["class"] = "dropdown-menu blue";

                            foreach (Micajah.Common.Bll.Action item2 in childActions)
                            {
                                li2 = new HtmlGenericControl("li");

                                link2             = new HyperLink();
                                link2.Text        = item2.CustomName;
                                link2.NavigateUrl = item2.CustomAbsoluteNavigateUrl;
                                link2.ToolTip     = item2.Description;

                                li2.Controls.Add(link2);
                                ul2.Controls.Add(li2);
                            }

                            li.Attributes["class"] = "dropdown";
                            li.Controls.Add(ul2);
                        }
                    }
                    else
                    {
                        if (item.ActionId == ActionProvider.MyAccountMenuGlobalNavigationLinkActionId)
                        {
                            if ((m_UserContext != null) && (m_UserContext.OrganizationId == Guid.Empty))
                            {
                                continue;
                            }
                        }

                        link.Text = item.CustomName;

                        links.Add(link);
                    }
                }

                if (m_ModernTheme)
                {
                    return(ul);
                }
                else
                {
                    return((links.Count > 0) ? links : null);
                }
            }
            finally
            {
                if (ul2 != null)
                {
                    ul2.Dispose();
                }
                if (li2 != null)
                {
                    li2.Dispose();
                }
                if (ul != null)
                {
                    ul.Dispose();
                }
                if (li != null)
                {
                    li.Dispose();
                }
                if (link != null)
                {
                    link.Dispose();
                }
                if (links != null)
                {
                    links.Dispose();
                }
            }
        }
Beispiel #9
0
        public static string GetDirectoryLinks(string currentDirectory, int functionSeqId)
        {
            string         mRetVal       = string.Empty;
            StringWriter   mStringWriter = null;
            HtmlTextWriter mWriter       = null;
            HyperLink      mFirstLink    = null;
            HyperLink      mLink         = null;

            try
            {
                string        mCurrentDirectory = HttpContext.Current.Server.UrlDecode(currentDirectory);
                StringBuilder mStringBuilder    = new StringBuilder();
                mStringWriter = new StringWriter(mStringBuilder, CultureInfo.InvariantCulture);
                mWriter       = new HtmlTextWriter(mStringWriter);
                string mPath = string.Empty;
                mFirstLink = new HyperLink();
                mFirstLink.Attributes.Add("href", "javascript:void(0);");
                mFirstLink.Attributes.Add("onclick", string.Format(CultureInfo.InvariantCulture, "javascript:GW.FileManager.changeDirectory('{0}','{1}')", "/", functionSeqId));
                mFirstLink.Text = @"Home\";
                mFirstLink.RenderControl(mWriter);
                if (mCurrentDirectory.Length > 2)
                {
                    Array mArray = mCurrentDirectory.Split('/');
                    foreach (string item in mArray)
                    {
                        if (item.Length > 0)
                        {
                            mPath += "/" + item;
                            mLink  = new HyperLink();
                            mLink.Attributes.Add("href", "javascript:void(0);");
                            mLink.Attributes.Add("onclick", string.Format(CultureInfo.InvariantCulture, "javascript:GW.FileManager.changeDirectory('{0}','{1}')", mPath, functionSeqId));
                            mLink.Text = item + @"\";
                            mLink.RenderControl(mWriter);
                        }
                    }
                }
                mRetVal = mStringBuilder.ToString();
            }
            catch (Exception ex)
            {
                Logger mLog = Logger.Instance();
                mLog.Error(ex);
                throw;
            }
            finally
            {
                if (mStringWriter != null)
                {
                    mStringWriter.Dispose();
                }
                if (mFirstLink != null)
                {
                    mFirstLink.Dispose();
                }
                if (mLink != null)
                {
                    mLink.Dispose();
                }
            }
            return(mRetVal.ToString(CultureInfo.InvariantCulture));
        }