Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["ProcessID"]) && !string.IsNullOrEmpty(Request.QueryString["GroupName"]) && !string.IsNullOrEmpty(Request.QueryString["Formula"]))
         {
             ProcessRuleBLL bll = new ProcessRuleBLL();
             IList <ApproveRuleGroupInfo> argList = bll.GetApproveRuleGroupByGroupNameAndProcessID(Request.QueryString["GroupName"], Request.QueryString["ProcessID"]);
             List <DataTable>             dtList  = new List <DataTable>();
             DataTable result;
             if (argList != null)
             {
                 //int pos = 0;
                 foreach (ApproveRuleGroupInfo info in argList)
                 {
                     DataSet ds = bll.GetApproveTableByTableName(info.RuleTableName, info.ProcessID.ToString());     //审批表
                     dtList.Add(ds.Tables[0]);
                 }
                 result = dtList[0].Copy();
                 result.Clear();
                 StringBuilder sb = new StringBuilder();
                 Descartes.TableDescarts(dtList, result, 0, sb);
                 ChangeSpaceToNbsp(result);
                 Expression expression  = new Expression();
                 DataTable  dts         = new DataTable();
                 DataTable  resultModel = new DataTable();
                 string     formula     = Request.QueryString["Formula"];
                 formula = formula.Replace(" ", "").Replace("AND", "*").Replace("OR", "+").Replace("NOT", "-");
                 expression.clac(formula, result, ref dts, ref resultModel);     //测试用
                 DataTable t = Expression.GetResultCollection(dts, resultModel);
                 gvConfiguration.DataSource = t;
                 gvConfiguration.DataBind();
             }
         }
     }
 }