usingSystem;usingSystem.Collections.Generic;usingSystem.Web;usin"> usingSystem;usingSystem.Collections.Generic;usingSystem.Web;usin" />
c#加载树代码例子

c#加载树代码例子

ID:40740229

大小:44.50 KB

页数:6页

时间:2019-08-07

c#加载树代码例子_第1页
c#加载树代码例子_第2页
c#加载树代码例子_第3页
c#加载树代码例子_第4页
c#加载树代码例子_第5页
资源描述:

《c#加载树代码例子》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、c#加载树代码例子<%@WebHandlerLanguage="C#"Class="GetTreeHtml"%>usingSystem;usingSystem.Collections.Generic;usingSystem.Web;usingSystem.Data;usingSystem.Data.Common;usingSystem.Web.SessionState;usingSystem.Text;usingeMIS;usingeMIS.Data;publicclassGetTreeHtml:IHttpHandler,IRequi

2、resSessionState{publicvoidProcessRequest(HttpContextcontext){strings;inti;stringnid=context.Request.QueryString["nid"].ToString();s=context.Request.QueryString["fields"].ToString();string[]fields=s.Split(',');stringtable=context.Request.QueryString["table"].ToString();i

3、ntlevel=int.Parse(context.Request.QueryString["level"].ToString());stringparentValues=context.Request.QueryString["values"].ToString();string[]values=parentValues.Split(',');stringcondition=context.Request.QueryString["con"].ToString();booliscom=(context.Request.QuerySt

4、ring["count"].ToString()=="1");stringunit=context.Request.QueryString["unit"].ToString();boolIsParent;boolIsLast;intIsDisabled;stringnewnid;stringwwwroot=context.Request.ApplicationPath;if(wwwroot=="/")wwwroot="";stringimgpath=wwwroot+"/Common6/Code/Elements/Tree/Images

5、";StringBuildersb=newStringBuilder();sb.Append("");stringsqlwhere;stringsql="selectdistinct"+fields[level]+"from"+table;if(condition=="")sqlwhere="where1=1";elsesqlwhere="where"+condition+"";for(i=1;i<=level;i++){sqlwhere+=

6、"and"+fields[i-1]+"='"+values[i-1]+"'";}sql+=sqlwhere+"orderby"+fields[level];if(level==fields.Length-1)IsParent=false;elseIsParent=true;DataManagerdm=newDataManager();DataTabledt=dm.ExecuteTable(sql);intl=dt.Rows.Count;stringdesc,Img1,Img2,Img3,pvalues,count;for(i=0;i<

7、l;i++){newnid=nid+"_"+i.ToString();desc=dt.Rows[i][0].ToString();if(i==l-1)IsLast=true;elseIsLast=false;if(IsParent)IsDisabled=0;elseIsDisabled=1;if(IsParent){if(IsLast)Img1=imgpath+"/img-plus-end.gif";elseImg1=imgpath+"/img-plus-cont.gif";Img2=imgpath+"/img-folder.gif"

8、;}else{if(IsLast)Img1=imgpath+"/img-branch-end.gif";elseImg1=imgpath+"/img-branch-cont.gif";Img2=imgpath+"/img

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。