예제 #1
0
        private void BindToolbar()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Projects.Resources.strLatestComments", typeof(LatestComments).Assembly);
            //tbComments.Title = LocRM.GetString("tbLatestComments");
            tbComments.AddText(LocRM.GetString("tbLatestComments"));

            string viewAllLink = "";
            ITopTabs tt = null;
            if (this.Parent.Parent.Parent is ITopTabs)
                tt = this.Parent.Parent.Parent as ITopTabs;
            else if (this.Parent.Parent is ITopTabs)
                tt = this.Parent.Parent as ITopTabs;
            if (tt != null)
            {
                oTopTabs = (TopTabs)tt.GetTopTabs();
                viewAllLink = oTopTabs.GetItemLink("Discussions");
            }

            string commentAddLink = "../Common/CommentAdd.aspx?";
            string sSize = "520,270";
            if (Security.CurrentUser.IsExternal)
            {
                commentAddLink = "../External/ExternalCommentAdd.aspx?";
                sSize = "800,600";
            }

            string AddLink = "#";
            switch (sType)
            {
                case "Project":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "ProjectID=" + ProjID + "'," + sSize + ",false);";
                        break;
                    }
                case "Task":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "TaskID=" + TaskID + "'," + sSize + ",false);";
                        break;
                    }
                case "ToDo":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "ToDoID=" + ToDoID + "'," + sSize + ",false);";
                        break;
                    }
                case "Event":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "EventID=" + EventID + "'," + sSize + ",false);";
                        break;
                    }
                case "Incident":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "IncidentID=" + IncidentID + "'," + sSize + ",false);";
                        break;
                    }
                case "Document":
                    {
                        AddLink = "javascript:OpenWindow('" + commentAddLink + "DocumentID=" + DocumentID + "'," + sSize + ",false);";
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            if (SharedID > 0)
                AddLink += "&SharedId=" + SharedID;

            if (dgComments.Items.Count == 0)
            {
                this.Visible = false;
                if (tbCommentsExternal != null)
                {
                    if (sType != "Incident")
                    {
                        tbCommentsExternal.AddLink("<img alt='' src='../Layouts/Images/icons/comments.gif' border='0' width='16' height='16' align='absmiddle' title='" + LocRM.GetString("tbAddL") + "'>", AddLink);
                        tbCommentsExternal.AddSeparator();
                    }
                }
            }
            else
            {
                this.Visible = true;
                tbComments.AddRightLink("<img alt='' src='../Layouts/Images/icon-search.gif'/> " + LocRM.GetString("tbView"), HttpUtility.HtmlAttributeEncode(viewAllLink));
                tbComments.AddRightLink("<img alt='' src='../Layouts/Images/icons/comments.gif'/> " + LocRM.GetString("tbAdd"), HttpUtility.HtmlAttributeEncode(AddLink));
            }
        }
예제 #2
0
        private void BindToolbar()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Projects.Resources.strLatestComments", typeof(LatestComments).Assembly);

            //tbComments.Title = LocRM.GetString("tbLatestComments");
            tbComments.AddText(LocRM.GetString("tbLatestComments"));

            string   viewAllLink = "";
            ITopTabs tt          = null;

            if (this.Parent.Parent.Parent is ITopTabs)
            {
                tt = this.Parent.Parent.Parent as ITopTabs;
            }
            else if (this.Parent.Parent is ITopTabs)
            {
                tt = this.Parent.Parent as ITopTabs;
            }
            if (tt != null)
            {
                oTopTabs    = (TopTabs)tt.GetTopTabs();
                viewAllLink = oTopTabs.GetItemLink("Discussions");
            }

            string commentAddLink = "../Common/CommentAdd.aspx?";
            string sSize          = "520,270";

            if (Security.CurrentUser.IsExternal)
            {
                commentAddLink = "../External/ExternalCommentAdd.aspx?";
                sSize          = "800,600";
            }


            string AddLink = "#";

            switch (sType)
            {
            case "Project":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "ProjectID=" + ProjID + "'," + sSize + ",false);";
                break;
            }

            case "Task":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "TaskID=" + TaskID + "'," + sSize + ",false);";
                break;
            }

            case "ToDo":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "ToDoID=" + ToDoID + "'," + sSize + ",false);";
                break;
            }

            case "Event":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "EventID=" + EventID + "'," + sSize + ",false);";
                break;
            }

            case "Incident":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "IncidentID=" + IncidentID + "'," + sSize + ",false);";
                break;
            }

            case "Document":
            {
                AddLink = "javascript:OpenWindow('" + commentAddLink + "DocumentID=" + DocumentID + "'," + sSize + ",false);";
                break;
            }

            default:
            {
                break;
            }
            }

            if (SharedID > 0)
            {
                AddLink += "&SharedId=" + SharedID;
            }

            if (dgComments.Items.Count == 0)
            {
                this.Visible = false;
                if (tbCommentsExternal != null)
                {
                    if (sType != "Incident")
                    {
                        tbCommentsExternal.AddLink("<img alt='' src='../Layouts/Images/icons/comments.gif' border='0' width='16' height='16' align='absmiddle' title='" + LocRM.GetString("tbAddL") + "'>", AddLink);
                        tbCommentsExternal.AddSeparator();
                    }
                }
            }
            else
            {
                this.Visible = true;
                tbComments.AddRightLink("<img alt='' src='../Layouts/Images/icon-search.gif'/> " + LocRM.GetString("tbView"), HttpUtility.HtmlAttributeEncode(viewAllLink));
                tbComments.AddRightLink("<img alt='' src='../Layouts/Images/icons/comments.gif'/> " + LocRM.GetString("tbAdd"), HttpUtility.HtmlAttributeEncode(AddLink));
            }
        }