FormContent.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class Work_FormContent : System.Web.UI.Page
  12. {
  13.     /// <summary>
  14.     /// 模型
  15.     /// </summary>
  16.     Model.FlowBaseStep MR = new Model.FlowBaseStep();
  17.     /// <summary>
  18.     /// 业务
  19.     /// </summary>
  20.     BLL.FlowBaseStep BR = new BLL.FlowBaseStep();
  21.     /// <summary>
  22.     /// 模板
  23.     /// </summary>
  24.     Model.FlowBaseFormContent MFBFC = new Model.FlowBaseFormContent();
  25.     /// <summary>
  26.     /// 业务
  27.     /// </summary>
  28.     BLL.FlowBaseFormContent BFBFC = new BLL.FlowBaseFormContent();
  29.     public string ContentStr = "";
  30.     protected void Page_Load(object sender, EventArgs e)
  31.     {
  32.         LoginLogic.MatchLoad("../", "Work_FormContent");
  33.         object fmid = Request.QueryString["form_id"];
  34.         object stepid = Request.QueryString["step_id"];
  35.         if ((fmid != null) && (stepid!=null))
  36.         {
  37.           
  38.             MFBFC = BFBFC.GetModel(int.Parse(fmid.ToString()));
  39.           
  40.             ContentStr = MFBFC.BDNR;
  41.             FormCodeList(int.Parse(fmid.ToString()));
  42.             MR = BR.GetModel(int.Parse(stepid.ToString()));
  43.             //标记可用
  44.             string KYZDStr = MR.KYZD;
  45.             string[] LIS = KYZDStr.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
  46.             foreach (string LI in LIS)
  47.             {
  48.          
  49.                 ContentStr = ContentStr.Replace("title=" + LI + "  disabled=\"disabled\"", "title=" + LI);
  50.             }
  51.            ContentStr= ContentStr.Replace(@"""",  @"""");
  52.         }
  53.     }
  54.     /// <summary>
  55.     /// 全部变为不可用
  56.     /// </summary>
  57.     /// <param name="BDID"></param>
  58.     public void FormCodeList(int BDID)
  59.     {
  60.         MFBFC = BFBFC.GetModel(BDID);
  61.         string strFormModel = MFBFC.BDNR;
  62.         string IndexStr = "title=";
  63.         int IdexStart = 0;
  64.         do
  65.         {
  66.             IdexStart = strFormModel.IndexOf(IndexStr, IdexStart);
  67.             if (IdexStart != -1)
  68.             {
  69.                 string ItemStr = RtContrlStr(IdexStart, strFormModel);
  70.                 IdexStart = IdexStart + 1;
  71.                 ContentStr= ContentStr.Replace("title=" + ItemStr, "title=" + ItemStr + "  disabled=\"disabled\"");
  72.             }
  73.         }
  74.         while (IdexStart != -1);
  75.     }
  76.     public string RtContrlStr(int IdexStart, string Content)
  77.     {
  78.         string IndexStrEnd = " ";
  79.         int StartP = Content.IndexOf(IndexStrEnd, IdexStart);
  80.         int LengthStr = StartP - IdexStart;
  81.         string RtStr = Content.Substring(IdexStart, LengthStr).Replace("title=", "");
  82.         return RtStr;
  83.     }
  84. }