SheetHyperlink.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Web;
  3. using System.Web.UI;
  4. using System.ComponentModel;
  5. using System.Drawing;
  6. using System.Drawing.Design;
  7. [assembly:TagPrefix("OThinker.H3.WorkSheet","SheetControls")]
  8. namespace OThinker.H3.WorkSheet
  9. {
  10. /// <summary>
  11. /// SheetHyperlink 的摘要说明。
  12. /// </summary>
  13. /// 
  14. [ToolboxBitmap(typeof(SheetHyperlink),"OThinker.H3.WorkSheet.SheetHyperlink.bmp")]
  15. [ToolboxData("<{0}:SheetHyperlink runat=server></{0}:SheetHyperlink>")]
  16. public class SheetHyperlink :
  17. System.Web.UI.WebControls.HyperLink,
  18. ISheetControl
  19. {
  20. public SheetHyperlink()
  21. {
  22. }
  23. #region 类SheetHyperLink成员
  24. private string _TextDataField = null;
  25. [Browsable(true),Category("WorkSheet"),DefaultValue("")]
  26. [Editor(typeof(DataSelector), typeof(UITypeEditor))]
  27. public string TextDataField
  28. {
  29. get
  30. {
  31. return this._TextDataField;
  32. }
  33. set
  34. {
  35. this._TextDataField = value;
  36. }
  37. }
  38. private string _NavigateUrlDataField = null;
  39. [Browsable(true),Category("WorkSheet")]
  40. [Editor(typeof(DataSelector), typeof(UITypeEditor))]
  41.         public string NavigateUrlDataField
  42. {
  43. get
  44. {
  45.                 return this._NavigateUrlDataField;
  46. }
  47. set
  48. {
  49. this._NavigateUrlDataField = value;
  50. }
  51. }
  52. #endregion
  53. #region ISheetControl 成员
  54.         public virtual void LoadDataField(OThinker.H3.WorkSheet.SheetPage SheetPage)
  55. {
  56. if(this.NavigateUrlDataField == null || this.NavigateUrlDataField == "")
  57. {
  58. }
  59. else if(SheetPage.Enviroment.InstanceData[this.NavigateUrlDataField] == null)
  60. {
  61. }
  62. else if(SheetPage.Enviroment.InstanceData[this.NavigateUrlDataField].Visible == false)
  63. {
  64. this.Visible = false;
  65. }
  66. else
  67. {
  68. this.Enabled = SheetPage.Enviroment.InstanceData[this.NavigateUrlDataField].Editable;
  69. if(SheetPage.Enviroment.InstanceData[this.NavigateUrlDataField].Value != null)
  70. {
  71. this.NavigateUrl = SheetPage.Enviroment.InstanceData[this.NavigateUrlDataField].Value.ToString();
  72. }
  73. }
  74. if( this.TextDataField == null || this.TextDataField == "" )
  75. {
  76. }
  77. else if(SheetPage.Enviroment.InstanceData[this.TextDataField] == null)
  78. {
  79. }
  80. else if(SheetPage.Enviroment.InstanceData[this.TextDataField].Visible == false)
  81. {
  82. this.Visible = false;
  83. }
  84. else
  85. {
  86. if(SheetPage.Enviroment.InstanceData[this.TextDataField].Value != null)
  87. {
  88. this.Text = SheetPage.Enviroment.InstanceData[this.TextDataField].Value.ToString();
  89. }
  90. }
  91. }
  92.         public virtual bool ValidateDataField(
  93.             OThinker.H3.WorkSheet.SheetPage SheetPage,
  94.             System.Collections.Generic.List<string> Errors)
  95.         {
  96.             return true;
  97.         }
  98.         public virtual void SaveDataField(OThinker.H3.WorkSheet.SheetPage ParentPage)
  99. {
  100.             
  101. }
  102. #endregion
  103. }
  104. }