private void RenderRoleMatrixEntry(HtmlTextWriter writer)
        {
            if (this.RoleID.IsNotEmpty())
            {
                HtmlGenericControl container = new HtmlGenericControl("div");

                container.Controls.Add(CreateLinkButton(GetEditPropertiesUrl(), "_ppt",
                                                        EditPropertiesImgUrl,
                                                        Translator.Translate(Define.DefaultCulture, this.Enabled ? "编辑矩阵属性" : string.Empty),
                                                        GetEditPropertiesLinkScript()));

                bool exsits = false;

                HaveExtendedPropertiesRoleIDs.TryGetValue(this.RoleID, out exsits);

                if (exsits)
                {
                    container.Controls.Add(CreateLinkButton(GetEditMatrixUrl(), "_mtx",
                                                            EditMatrixImgUrl,
                                                            Translator.Translate(Define.DefaultCulture, this.Enabled ? "编辑矩阵属性" : "存在矩阵属性定义"),
                                                            GetEditMatrixLinkScript()));
                }

                writer.Write(WebControlUtility.GetControlHtml(container));
            }
        }
        private void RenderEditorContainer(HtmlTextWriter writer)
        {
            HtmlGenericControl script = new HtmlGenericControl("script");

            script.ID = EditorContainerClientID;
            script.Attributes["type"] = "text/plain";

            if (Width != Unit.Empty)
            {
                script.Style["width"] = Width.ToString();
            }
            else
            {
                script.Style["width"] = "800px";
            }

            if (Height != Unit.Empty)
            {
                script.Style["height"] = Height.ToString();
            }

            script.InnerHtml = this._InitialData;

            writer.Write(WebControlUtility.GetControlHtml(script));
        }
        /// <summary>
        /// UEditor在Submit的时候,会自动创建一个TextArea,将导致ASP.net的页面检查不过(含有Html Tag)。
        /// 因此先渲染一个同ID的SPAN。SPAN和TextArea不同,不会Post的。
        /// </summary>
        /// <param name="writer"></param>
        private void RenderFakeElement(HtmlTextWriter writer)
        {
            HtmlGenericControl span = new HtmlGenericControl("span");

            span.ID = "ueditor_textarea_" + this.PostedDataFormName;
            span.Attributes["name"] = this.PostedDataFormName;
            span.Style["display"]   = "none";

            writer.Write(WebControlUtility.GetControlHtml(span));
        }
Пример #4
0
        private static string GetAllAssigneesStatusHtmlWithoutPresence(WfProcessCurrentInfo atp)
        {
            HtmlGenericControl span = new HtmlGenericControl("span");

            foreach (var assignee in atp.Assignees)
            {
                span.InnerHtml = string.Format("{0}({1})",
                                               HttpUtility.HtmlEncode(assignee.User.DisplayName),
                                               HttpUtility.HtmlEncode(assignee.User.TopOU.DisplayName));
            }

            return(WebControlUtility.GetControlHtml(span));
        }
Пример #5
0
        private void RenderIframe(HtmlTextWriter writer)
        {
            StringBuilder sbIframeHtml = new StringBuilder();

            sbIframeHtml.Append("<iframe style=\"display:block;position:absolute;z-index:1000\"></iframe>");

            LiteralControl iframe = new LiteralControl(sbIframeHtml.ToString());

            //iframe.Style["display"] = "none";
            //iframe.Style["position"] = "absolute";
            //iframe.Style["z-index"] = "1000";

            writer.Write(WebControlUtility.GetControlHtml(iframe));
        }
Пример #6
0
        private void RenderStatus(WfProcessCurrentInfoCollection atpc, UserIMAddressCollection extendInfo, HtmlTextWriter writer)
        {
            WfProcessCurrentInfo atp = null;

            if (this.ProcessID.IsNotEmpty())
            {
                atp = atpc.Find(a => string.Compare(a.InstanceID, this.ProcessID, true) == 0);
            }
            else
            {
                if (this.ResourceID.IsNotEmpty())
                {
                    atp = atpc.Find(a => string.Compare(a.ResourceID, this.ResourceID, true) == 0);
                }
            }

            if (atp != null)
            {
                writer.Write(WebControlUtility.GetControlHtml(CreateStatusDisplayControl(atp, extendInfo)));
            }
        }
Пример #7
0
        private void PrepareTargetActivityDescriptors()
        {
            HtmlSelect select = new HtmlSelect();

            select.Attributes["name"] = "ToActivityKey";
            select.ID             = "ToActivityKey";
            select.Style["width"] = "100%";

            if (this.descriptorEditor.CurrentProcessDescriptor != null && this.FromActivityKey.IsNotEmpty())
            {
                foreach (IWfActivityDescriptor actDesp in this.descriptorEditor.CurrentProcessDescriptor.Activities)
                {
                    if (actDesp.Key != this.FromActivityKey)
                    {
                        ListItem opinion = new ListItem(GenerateActivityDescription(this.FromActivity, actDesp), actDesp.Key);

                        select.Items.Add(opinion);
                    }
                }
            }

            this.targetLiteral.Text = WebControlUtility.GetControlHtml(select);
        }
Пример #8
0
        private static string GetAllAssigneesStatusHtmlWithPresence(WfProcessCurrentInfo atp, bool showStatusImage, UserIMAddressCollection extendInfo, string idPrefix)
        {
            HtmlGenericControl span = new HtmlGenericControl("span");

            int i = 0;

            foreach (var assignee in atp.Assignees)
            {
                span.InnerHtml +=
                    UserPresence.GetUsersPresenceHtml(assignee.User.ID, assignee.User.DisplayName.IsNullOrEmpty() ? assignee.User.Name : assignee.User.DisplayName,
                                                      idPrefix + "_img_" + i, showStatusImage, false, true, StatusImageType.Ball, "", extendInfo);

                string topOUName = GetUserTopOUName(assignee.User);

                if (topOUName.IsNotEmpty())
                {
                    span.InnerHtml += string.Format("({0})", HttpUtility.HtmlEncode(topOUName));
                }

                i++;
            }

            return(WebControlUtility.GetControlHtml(span));
        }
Пример #9
0
        private void RenderDropdownImage(HtmlTextWriter writer)
        {
            HtmlImage image = new HtmlImage();

            image.Src             = Page.ClientScript.GetWebResourceUrl(this.GetType(), "MCS.Web.WebControls.TextBoxDropdrownExtender.dropdown.gif");
            image.Style["cursor"] = "pointer";

            image.Attributes["listBoxID"] = this.ClientID;
            image.Attributes["iframeID"]  = INNERFRAMEID;

            image.Attributes["onclick"] = "onTextBoxDropdownExtenderDropdown();";

            if (this.TargetControl != null)
            {
                image.Attributes["textBoxID"] = this.TargetControl.ClientID;

                if (this.TargetControl.ReadOnly || this.TargetControl.Enabled == false)
                {
                    image.Style["display"] = "none";
                }
            }

            writer.Write(WebControlUtility.GetControlHtml(image));
        }
Пример #10
0
        /// <summary>
        /// 得到当前显示用户状态的Html
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="userName">用户的显示名称</param>
        /// <param name="uniqueID"></param>
        /// <param name="showStatusImage">是否显示状态图标</param>
        /// <param name="showUserIcon">是否显示用户图标</param>
        /// <param name="showUserName">是否显示用户名称</param>
        /// <param name="statusImageType">状态图片类型</param>
        /// <param name="userIconUrl">用户图片路径</param>
        /// <param name="uiec">用户扩展信息的结构</param>
        /// <returns></returns>
        public static string GetUsersPresenceHtml(string userID, string userName, string uniqueID, bool showStatusImage,
                                                  bool showUserIcon, bool showUserName, StatusImageType statusImageType, string userIconUrl, UserIMAddressCollection uiec, bool accountDisabled = false)
        {
            StringBuilder strB = new StringBuilder();

            if (string.IsNullOrEmpty(userID) == false)
            {
                if (showStatusImage)
                {
                    HtmlGenericControl imageDiv = new HtmlGenericControl("div");
                    //imageDiv.Style["position"] = "relative";

                    var userIconContainerCss = "";
                    var userIconCss          = "";
                    if (statusImageType == StatusImageType.Ball)
                    {
                        imageDiv.Attributes["class"] = "uc-ball";
                    }
                    else if (statusImageType == StatusImageType.ShortBar)
                    {
                        imageDiv.Attributes["class"] = "uc-bar36";
                        userIconContainerCss         = "uc-user-container-short";
                        userIconCss = "icon";
                    }
                    else if (statusImageType == StatusImageType.LongBar)
                    {
                        imageDiv.Attributes["class"] = "uc-bar52";
                        userIconContainerCss         = "uc-user-container-long";
                        userIconCss = "icon";
                    }

                    HtmlImage image = new HtmlImage();
                    image.Src = ControlResources.UCStatusUrl;

                    if (accountDisabled)
                    {
                        image.Alt = Translator.Translate(Define.DefaultCulture, "用户账号禁用");
                        image.Attributes["class"] = "uc-blocked"; //禁用
                    }
                    else
                    {
                        image.Alt = Translator.Translate(Define.DefaultCulture, "无联机状态信息");
                        image.Attributes["class"]           = "uc-hdr"; //默认
                        image.Attributes["ShowOfflinePawn"] = "true";
                        UserIMAddress extendInfo = uiec.Find(uie => uie.UserID == userID);

                        if (extendInfo != null)
                        {
                            image.Attributes["sip"] = NormalizeIMAddress(extendInfo.IMAddress);
                        }

                        image.ID = string.Format("{0},type=sip", uniqueID);
                        image.Attributes["name"] = "imnmark";
                    }

                    imageDiv.Controls.Add(image);

                    strB.Append(WebControlUtility.GetControlHtml(imageDiv));

                    if (showUserIcon)
                    {
                        HtmlGenericControl userIconDiv = new HtmlGenericControl("div");
                        //userIconDiv.Style["position"] = "relative";
                        userIconDiv.Attributes["class"] = userIconContainerCss;

                        var subDiv = new HtmlGenericControl("div");
                        subDiv.Attributes["class"] = userIconCss;

                        var img = new HtmlImage();
                        img.Src    = userIconUrl;
                        img.Border = 0;

                        subDiv.Controls.Add(img);
                        userIconDiv.Controls.Add(subDiv);
                        if (showUserName)
                        {
                            HtmlGenericControl nameSpan = new HtmlGenericControl("span");
                            nameSpan.InnerText = userName;
                            userIconDiv.Controls.Add(nameSpan);
                        }
                        //nameSpan.Attributes["class"] = "imnStatusText";

                        strB.Append(WebControlUtility.GetControlHtml(userIconDiv));
                    }
                }

                if (statusImageType == StatusImageType.Ball && showUserName)
                {
                    HtmlGenericControl span = new HtmlGenericControl("span");
                    //span.Style["padding-left"] = "16px";
                    span.InnerText           = userName;
                    span.Attributes["class"] = "imnStatusText";

                    strB.Append(WebControlUtility.GetControlHtml(span));
                }
            }

            return(strB.ToString());
        }
Пример #11
0
 private void RenderHiddenFields(HtmlTextWriter writer)
 {
     writer.Write(WebControlUtility.GetControlHtml(this.selectedTextHidden));
     writer.Write(WebControlUtility.GetControlHtml(this.selectedValueHidden));
 }
Пример #12
0
 protected override void RenderContents(HtmlTextWriter writer)
 {
     //base.RenderContents(writer);
     writer.Write(WebControlUtility.GetControlHtml(BuildControls()));
 }