NotificationGridItem.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.ComponentModel;
- namespace OThinker.H3.Portal
- {
- /// <summary>
- /// Summary description for WorkItemGridItem.
- /// </summary>
- [DefaultProperty("Text"),
- ToolboxData("<{0}:NotificationGridItem runat=server></{0}:NotificationGridItem>")]
- public class NotificationGridItem : System.Web.UI.WebControls.WebControl
- {
- // 设置优先级的图标
- private Image imageIcon = new Image();
- // 标题行的标题名称单元
- private HyperLink linkTitle = new HyperLink();
- // Receive Time
- private Label labelReceiveTime = new Label();
- // Workflow Full Name
- private Label labelFullName = new Label();
- // To
- private Label labelTo = new Label();
- // From
- private Label labelInstanceInfo = new Label();
- public NotificationGridItem(
- string Title,
- string Url,
- OThinker.H3.Notification.NotificationState State,
- System.DateTime ReceiveTime,
- string WorkflowPackage,
- string WorkflowName,
- int WorkflowVersion,
- string InstanceId,
- string To)
- {
- this.imageIcon.ImageUrl = "images/Icon_Message.gif";
- this.linkTitle.Text = Title;
- this.linkTitle.NavigateUrl = Url;
- this.linkTitle.Attributes.Add("target", "NotificationMain");
- this.labelReceiveTime.Text = ReceiveTime.ToShortDateString();
- this.labelInstanceInfo.Text = WorkflowTemplate.WorkflowTemplate.GetWorkflowFullName(
- WorkflowPackage,
- WorkflowName,
- WorkflowVersion) + "." + InstanceId;
- this.labelTo.Text = To;
- }
- protected override void Render(HtmlTextWriter writer)
- {
- writer.Write("<TABLE WIDTH="100%" cellpadding="0" cellspacing="0">");
- writer.Write("<TR WIDTH="100%">");
- writer.Write("<TD WIDTH="15" VALIGN="TOP">");
- this.imageIcon.RenderControl(writer);
- writer.Write("</TD>");
- writer.Write("<TD WIDTH="100%">");
- writer.Write("<TABLE WIDTH="100%" cellpadding="0" cellspacing="0">");
- writer.Write("<TR WIDTH="100%">");
- writer.Write("<TD>");
- writer.Write("<TABLE WIDTH="100%" cellpadding="0" cellspacing="0">");
- writer.Write("<TR WIDTH="100%">");
- writer.Write("<TD>");
- this.linkTitle.RenderControl(writer);
- writer.Write("</TD>");
- writer.Write("<TD ALIGN="RIGHT">");
- this.labelReceiveTime.RenderControl(writer);
- writer.Write("</TD>");
- writer.Write("</TR>");
- writer.Write("</TABLE>");
- writer.Write("</TD>");
- writer.Write("</TR>");
- writer.Write("<TR>");
- writer.Write("<TD>");
- this.labelInstanceInfo.RenderControl(writer);
- writer.Write("</TD>");
- writer.Write("<TR>");
- writer.Write("<TR>");
- writer.Write("<TD>");
- this.labelTo.RenderControl(writer);
- writer.Write("</TD>");
- writer.Write("<TR>");
- writer.Write("</TABLE>");
- writer.Write("</TD>");
- writer.Write("</TR>");
- writer.Write("</TABLE>");
- }
- }
- }