コード例 #1
0
 public void GetDoctorAndDepartment(string code)
 {
     try
     {
         listoffice = new List <TreeList>();
         //查询科室下拉框数据
         List <DeptEntity> deptList = AppContext.Session.deptList;
         List <Xr.Common.Controls.Item> itemList = new List <Xr.Common.Controls.Item>();
         foreach (DeptEntity dept in deptList)
         {
             Xr.Common.Controls.Item item = new Xr.Common.Controls.Item();
             item.name     = dept.name;
             item.value    = dept.id;
             item.tag      = dept.hospitalId;
             item.parentId = dept.parentId;
             itemList.Add(item);
         }
         //itemList.Insert(0, Xr.Common.Controls.Item { value = "", parentId = "", name = "全部" });
         treeKeshi.Properties.DataSource               = itemList;
         treeKeshi.Properties.TreeList.KeyFieldName    = "value";
         treeKeshi.Properties.TreeList.ParentFieldName = "parentId";
         treeKeshi.Properties.DisplayMember            = "name";
         treeKeshi.Properties.ValueMember              = "value";
         treeWKe.Properties.DataSource               = itemList;
         treeWKe.Properties.TreeList.KeyFieldName    = "value";
         treeWKe.Properties.TreeList.ParentFieldName = "parentId";
         treeWKe.Properties.DisplayMember            = "name";
         treeWKe.Properties.ValueMember              = "value";
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("文章中获取科室下拉框错误信息:" + ex.Message);
     }
 }
コード例 #2
0
 public void GetDoctorAndDepartment(string code)
 {
     try
     {
         listoffice = new List <TreeList>();
         String  url  = AppContext.AppConfig.serverUrl + "cms/dept/qureyOperateDept";
         String  data = HttpClass.httpPost(url);
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             //查询科室下拉框数据
             List <DeptEntity> deptList = objT["result"]["deptList"].ToObject <List <DeptEntity> >();
             List <Xr.Common.Controls.Item> itemList = new List <Xr.Common.Controls.Item>();
             foreach (DeptEntity dept in deptList)
             {
                 Xr.Common.Controls.Item item = new Xr.Common.Controls.Item();
                 item.name     = dept.name;
                 item.value    = dept.id;
                 item.tag      = dept.hospitalId;
                 item.parentId = dept.parentId;
                 itemList.Add(item);
             }
             //itemList.Insert(0, Xr.Common.Controls.Item { value = "", parentId = "", name = "全部" });
             treeKeshi.Properties.DataSource               = itemList;
             treeKeshi.Properties.TreeList.KeyFieldName    = "value";
             treeKeshi.Properties.TreeList.ParentFieldName = "parentId";
             treeKeshi.Properties.DisplayMember            = "name";
             treeKeshi.Properties.ValueMember              = "value";
             treeWKe.Properties.DataSource               = itemList;
             treeWKe.Properties.TreeList.KeyFieldName    = "value";
             treeWKe.Properties.TreeList.ParentFieldName = "parentId";
             treeWKe.Properties.DisplayMember            = "name";
             treeWKe.Properties.ValueMember              = "value";
         }
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("文章中获取科室下拉框错误信息:" + ex.Message);
     }
 }