Example #1
0
    protected void lblList1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //绑定已经选中的Checkbox
        if (ViewState["SelectItems"] != null)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                List <Authorization> items = new List <Authorization>();
                items = (List <Authorization>)ViewState["SelectItems"];
                CheckBox cbxChoose          = (CheckBox)e.Item.FindControl("cbxChoose");
                Label    lblAuthorizationID = (Label)e.Item.FindControl("lblAuthorizationID");
                if (items.Any(p => p.AuthorizationID == lblAuthorizationID.Text))
                {
                    cbxChoose.Checked = true;
                }
            }
        }

        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            HyperLink hyperLink  = (HyperLink)e.Item.FindControl("hyperLink");
            Label     lblProcId  = (Label)e.Item.FindControl("lblProcId");
            string    instanceId = "";
            string    url        = BPMHelp.GetUrl(lblProcId.Text, out instanceId);
            //此处url存在问题,页面存在路径以及参数未知
            hyperLink.NavigateUrl = "~/Workflow/ViewPage/V_" + url + "?ID=" + instanceId;
        }
    }
Example #2
0
 protected void lblBPMList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Label     lblProId  = (Label)e.Item.FindControl("lblProId");
         HyperLink hyperLink = (HyperLink)e.Item.FindControl("hyperLink");
         string    parameter = "";
         string    url       = "~/Workflow/ViewPage/V_" + BPMHelp.GetUrl(lblProId.Text, out parameter);
         if (url.ToLower().EndsWith(".ascx"))
         {
             url = System.Configuration.ConfigurationManager.AppSettings["ViewProcInstPageUrl"].ToString();
         }
         hyperLink.NavigateUrl = url + "?ID=" + parameter;
     }
 }