Exemplo n.º 1
0
 private void FrmDepart_Load(object sender, EventArgs e)
 {
     //读取业务单元和传递参数
     this.paramwin = BindManager.getSystemParam();
     NameObjectList pstrans = BindManager.getTransParam();
     ParamManager.MergeParam(this.paramwin, pstrans);
     unitName = pstrans["name"].ToString();//单元
     //获取当前单元名称
     Dictionary<string, string> dict = new Dictionary<string, string>();
     dict.Add("组织机构管理", "@db=组织机构");
     //数据源
     string datasource = dict[this.unitName];
     NameObjectList ps = new NameObjectList();
     ParamManager.MergeParam(ps, this.paramwin);
     ps["UnitCode"] = "10";
     unitItem = new UnitItem(DataAccRes.AppSettings("WorkConfig"), unitName);
     //绑定数据
     BindManager bg = new BindManager(this);
     dsUnit = bg.BuildDataset(this.unitItem, ps);
     bg.BindFld(this, dsUnit);
     //对树的操作
     bg.BindTrv(this.trvDept, this.dsUnit.Tables["组织机构"], "名称", "ID", "PID", "@名称={名称},@代码={代码},@序号={序号},@ParentCode={ParentCode},@独立管理={独立管理},@分类={分类},@性质={性质},@部门主管={部门主管},@部门职责={部门职责},@班次代码={班次代码},@班次名称={班次名称},@周一={周},@周二={周二},@周三={周三},@周四={周四},@周五={周五},@周六={周六},@周日={周日},@level={level}");
     this.trvDept.ExpandAll();
 }