Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             var           advuserinfo = new AdvUserInfo("cookie");
             var           workflow    = new VERI_WORKFLOW().Static_GetWORKFLOWByid(this.WORKFLOW_ID);
             var           keyColl     = this.ENTITY_KEY_ID.Split(',');
             IVerifyEntity entity      = new AdvWorkFlow(workflow).GetWorkFLowEntityByKey(keyColl);
             var           newVeri     = new LGWBVerifyHelper(workflow, entity, advuserinfo);
             var           operDic     = newVeri.VerifyOperAndAction();
             foreach (var in_operDic in operDic)
             {
                 if (BanList.Contains(in_operDic.Key))
                 {
                     continue;
                 }
                 FineUI.Button newbtn = new FineUI.Button();
                 newbtn.ID     = in_operDic.Value;
                 newbtn.Text   = in_operDic.Key;
                 newbtn.Click += new EventHandler(btn_Click);
                 this.Btn_ToolBar.Items.Add(newbtn);
             }
         }
         catch { }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            string action;

            context.Response.ContentType = "text/plain";
            if (context.Request.RequestType.ToLower() == "get")
            {
                action = context.Request.QueryString["action"];
            }
            else
            {
                action = context.Request.Form["action"];
            }
            if (action == "flowchart")
            {
                string work_flow_id;
                work_flow_id = context.Request.QueryString["flow_id"];

                var db  = new SAFEDB();
                var res = (from x in db.VERI_WORKFLOW
                           where x.WORKFLOW_ID == work_flow_id
                           select x).First().FLOW_PIC;
                context.Response.Write(res);
                context.Response.End();
            }

            if (action == "Verify")
            {
                var    oper_str = context.Request.Form["oper_str"].ToString();
                var    entity_key = context.Request.Form["entity_key"].ToString();
                var    workflow_id = context.Request.Form["workflow_id"].ToString();
                var    conclusion = context.Request.Form["conclusion"].ToString();
                string formula, condition;
                if (oper_str.IndexOf('_') < 0)//没有条件
                {
                    formula   = oper_str;
                    condition = null;
                }
                else
                {
                    formula   = oper_str.Split('_')[1];
                    condition = oper_str.Split('_')[0];
                }
                string[]         conditionstr  = { condition };
                var              workflow      = new VERI_WORKFLOW().Static_GetWORKFLOWByid(workflow_id);
                string[]         keycoll       = entity_key.Split(',');
                var              iverifyentity = new AdvWorkFlow(workflow).GetWorkFLowEntityByKey(keycoll);
                var              user          = new AdvUserInfo("cookie");
                LGWBVerifyHelper newVeri       = new LGWBVerifyHelper(workflow, iverifyentity, user);
                var              k             = newVeri.DoVerify(formula, conditionstr, conclusion);
                context.Response.Write(k.Msg);
                context.Response.End();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    var advuserinfo = new AdvUserInfo("cookie");
                    var workflow    = new VERI_WORKFLOW().Static_GetWORKFLOWByid(this.WORKFLOW_ID);
                    var keyColl     = this.ENTITY_KEY_ID.Split(',');
                    var haza02      = new SAFEDB().TH_THAZA02.Find(keyColl);


                    var newVeri  = new LGWBVerifyHelper(workflow, haza02, advuserinfo);
                    var operDic  = newVeri.VerifyOperAndAction();
                    var operDic1 = new Dictionary <string, string>(operDic);
                    foreach (var in_operDic in operDic1)
                    {
                        //如果是与A级无关的,删除总调相关
                        if (haza02.CLASS_A == "N" && in_operDic.Key.Contains("总调"))
                        {
                            operDic.Remove(in_operDic.Key);
                        }
                        //如果与A级有关,该项又包含通过,则删除
                        else if (haza02.CLASS_A == "Y" && !in_operDic.Key.Contains("总调") && in_operDic.Key.Contains("通过"))
                        {
                            operDic.Remove(in_operDic.Key);
                        }
                    }
                    this.Veri_Status.Text = newVeri.StartNode.NODE_NAME;
                    if (operDic.Count() != 0)
                    {
                        foreach (var in_operDic in operDic)
                        {
                            FineUI.Button newbtn = new FineUI.Button();
                            newbtn.ID   = in_operDic.Value;
                            newbtn.Text = in_operDic.Key;
                            //newbtn.CssClass = "btn_verify";

                            newbtn.OnClientClick = "VeriClick('" + in_operDic.Key + "','" + this.ENTITY_KEY_ID + "','01')";
                            this.Btn_ToolBar.Items.Add(newbtn);
                        }
                    }
                    else
                    {
                        this.Veri_Status.Text = newVeri.StartNode.NODE_NAME;
                        FineUI.Label newLabel = new FineUI.Label();
                        newLabel.Text = "没有可用的审核";
                        this.Btn_ToolBar.Items.Add(newLabel);
                    }
                }
                catch { }
            }
        }