ApproveStatusExtensions.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using Autofac;
  7. using Bowin.Web.Controls.Mvc;
  8. using EMIS.Utility;
  9. using EMIS.CommonLogic.SystemServices;
  10. using EMIS.ViewModel.SystemView;
  11. namespace EMIS.Web.Controls
  12. {
  13. public static class ApproveStatusExtensions
  14. {
  15. /// <summary>
  16. /// 审核状态控件,下拉列出该类表单的各个审核环节
  17. /// </summary>
  18. /// <param name="htmlHelper"></param>
  19. /// <param name="tableName">数据表名,用于决定具体的流程配置</param>
  20. /// <param name="dropdownListOptions">下拉菜单配置项,除数据源外,其他的下拉菜单配置项皆可用</param>
  21. /// <param name="htmlAttributes">自定义Html属性扩展,用Dictionary的方式定义,例如:new Dictionary<string, string> {
  22. /// { "style", "width: 100%;" }, { "name", "ddlUsers" }
  23. /// }
  24. /// </param>
  25. /// <returns></returns>
  26. public static MvcHtmlString ApproveStatusDropDownList(this HtmlHelper htmlHelper,
  27. string tableName,
  28. DropdownListOptions dropdownListOptions = null,
  29. System.Collections.Generic.IDictionary<string, string> htmlAttributes = null)
  30. {
  31. if (dropdownListOptions == null)
  32. dropdownListOptions = new DropdownListOptions();
  33. dropdownListOptions.ItemSourceUrl = UrlHelper.GenerateContentUrl("~/Common/ApproveStatusDropDown?tableName="
  34. + tableName, htmlHelper.ViewContext.HttpContext);
  35. if (dropdownListOptions.SelectedValue == null)
  36. {
  37. dropdownListOptions.SelectedValue = DropdownList.PLEASE_SELECT.ToString();
  38. }
  39. return htmlHelper.DropdownList(dropdownListOptions, htmlAttributes);
  40. }
  41. /// <summary>
  42. /// 审核状态控件,下拉列出该类表单的各个审核环节
  43. /// </summary>
  44. /// <param name="htmlHelper"></param>
  45. /// <param name="tableName">数据表名,用于决定具体的流程配置</param>
  46. /// <param name="dropdownListOptions">下拉菜单配置项,除数据源外,其他的下拉菜单配置项皆可用</param>
  47. /// <param name="htmlAttributes">自定义Html属性扩展,用Dictionary的方式定义,例如:new Dictionary<string, string> {
  48. /// { "style", "width: 100%;" }, { "name", "ddlUsers" }
  49. /// }
  50. /// </param>
  51. /// <returns></returns>
  52. public static MvcHtmlString ApproveStatusNotStartEndDropDownList(this HtmlHelper htmlHelper,
  53. string tableName,
  54. DropdownListOptions dropdownListOptions = null,
  55. System.Collections.Generic.IDictionary<string, string> htmlAttributes = null)
  56. {
  57. if (dropdownListOptions == null)
  58. dropdownListOptions = new DropdownListOptions();
  59. dropdownListOptions.ItemSourceUrl = UrlHelper.GenerateContentUrl("~/Common/ApproveStatusNotStartEndDropDown?tableName="
  60. + tableName, htmlHelper.ViewContext.HttpContext);
  61. if (dropdownListOptions.SelectedValue == null)
  62. {
  63. dropdownListOptions.SelectedValue = DropdownList.PLEASE_SELECT.ToString();
  64. }
  65. return htmlHelper.DropdownList(dropdownListOptions, htmlAttributes);
  66. }
  67. /// <summary>
  68. /// 审核状态控件,下拉列出该类表单的各个审核环节
  69. /// </summary>
  70. /// <param name="htmlHelper"></param>
  71. /// <param name="tableName">数据表名,用于决定具体的流程配置</param>
  72. /// <param name="dropdownListOptions">下拉菜单配置项,除数据源外,其他的下拉菜单配置项皆可用</param>
  73. /// <param name="htmlAttributes">自定义Html属性扩展,用Dictionary的方式定义,例如:new Dictionary<string, string> {
  74. /// { "style", "width: 100%;" }, { "name", "ddlUsers" }
  75. /// }
  76. /// </param>
  77. /// <returns></returns>
  78. public static MvcHtmlString ApproveStatusNotStartDropDownList(this HtmlHelper htmlHelper,
  79. string tableName,
  80. DropdownListOptions dropdownListOptions = null,
  81. System.Collections.Generic.IDictionary<string, string> htmlAttributes = null)
  82. {
  83. if (dropdownListOptions == null)
  84. dropdownListOptions = new DropdownListOptions();
  85. dropdownListOptions.ItemSourceUrl = UrlHelper.GenerateContentUrl("~/Common/ApproveStatusNotStartDropDown?tableName="
  86. + tableName, htmlHelper.ViewContext.HttpContext);
  87. if (dropdownListOptions.SelectedValue == null)
  88. {
  89. dropdownListOptions.SelectedValue = DropdownList.PLEASE_SELECT.ToString();
  90. }
  91. return htmlHelper.DropdownList(dropdownListOptions, htmlAttributes);
  92. }
  93. }
  94. }