public void GetKeShi()
 {
     try
     {
         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, new Xr.Common.Controls.Item {
             value = "", tag = "", name = "请选择", parentId = ""
         });
         treeKeshi.Properties.DataSource               = itemList;
         treeKeshi.Properties.TreeList.KeyFieldName    = "value";
         treeKeshi.Properties.TreeList.ParentFieldName = "parentId";
         treeKeshi.Properties.DisplayMember            = "name";
         treeKeshi.Properties.ValueMember              = "value";
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("临时停诊获取科室错误信息:" + ex.Message);
     }
 }
        public void GetClincInfo()
        {
            Dictionary <string, string> prament = new Dictionary <string, string>();
            String url = String.Empty;

            url = AppContext.AppConfig.serverUrl + "cms/dept/qureyOperateDept";
            String  jsonStr = HttpClass.httpPost(url);
            JObject objT    = JObject.Parse(jsonStr);

            if (string.Compare(objT["state"].ToString(), "true", true) == 0)
            {
                List <DeptEntity> list = objT["result"]["deptList"].ToObject <List <DeptEntity> >();
                List <Xr.Common.Controls.Item> itemList = new List <Xr.Common.Controls.Item>();
                foreach (DeptEntity dept in list)
                {
                    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);
                }
                treeMenuControl1.KeyFieldName    = "id";
                treeMenuControl1.ParentFieldName = "parentId";
                treeMenuControl1.DisplayMember   = "name";
                treeMenuControl1.ValueMember     = "id";
                treeMenuControl1.DataSource      = list;
                treeMenuControl1.EditValue       = list[0].id;
                SelectDeptid = list[0].id;
                GetDoctorName(AppContext.Session.hospitalId, list[0].id);
            }
        }
 //dynamic listNum;
 /// <summary>
 /// 日期排班号源
 /// </summary>
 /// <param name="time">日期</param>
 public void TimeScheduling(string hospitalId, string deptId, string doctorId, string time)
 {
     try
     {
         cmd.ShowOpaqueLayer(225, false);
         list = new List <string>();
         Dictionary <string, string> prament = new Dictionary <string, string>();
         prament.Add("hospitalId", hospitalId); //医院主键
         prament.Add("deptId", deptId);         //科室主键
         prament.Add("doctorId", doctorId);     //医生主键
         prament.Add("workDate", time);         //排班日期
         prament.Add("type", "1");              //类型:0公开预约号源、1诊间预约号源
         RestSharpHelper.ReturnResult <List <string> >("itf/booking/findTimeNum", prament, Method.POST,
                                                       result =>
         {
             #region
             switch (result.ResponseStatus)
             {
             case ResponseStatus.Completed:
                 if (result.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray()));
                     JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray()));
                     if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                     {
                         List <TimeNum> timenum = objT["result"].ToObject <List <TimeNum> >();
                         List <Xr.Common.Controls.Item> listitem = new List <Xr.Common.Controls.Item>();
                         foreach (var item in timenum)
                         {
                             Xr.Common.Controls.Item it = new Xr.Common.Controls.Item();
                             it.name     = item.beginTime + "-" + item.endTime + "" + "<" + item.num + ">";
                             it.value    = item.id;
                             it.tag      = item.beginTime + "-" + item.endTime + "#" + item.mzType;
                             it.parentId = item.id;
                             if (item.mzType == "2")    //特需门诊显红色
                             {
                                 it.spcialBColor = "Red";
                             }
                             listitem.Add(it);
                         }
                         _context.Send((s) => this.mcTimeSpan.setDataSource(listitem), null);
                         _context.Send((s) => cmd.HideOpaqueLayer(), null);
                     }
                     else
                     {
                         _context.Send((s) => cmd.HideOpaqueLayer(), null);
                         _context.Send((s) => Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm), null);
                     }
                 }
                 break;
             }
             #endregion
         });
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("获取日期排班号源错误信息:" + ex.Message);
     }
 }
Example #4
0
 public void GetKeShiList()
 {
     try
     {
         //String param = "hospital.code=" + AppContext.AppConfig.hospitalCode + "&dept.id =" + AppContext.Session.deptIds;
         //String url = AppContext.AppConfig.serverUrl + "cms/dept/findAll?" + param;
         //  String data = HttpClass.httpPost(url);
         //JObject objT = JObject.Parse(data);
         //if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         //{
         //  List<DeptEntity> list=objT["result"].ToObject<List<DeptEntity>>();
         //  List<Xr.Common.Controls.Item> itemList = new List<Xr.Common.Controls.Item>();
         //  foreach (DeptEntity dept in list)
         //  {
         //      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);
         //  }
         //}
         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);
         }
         treeMenuControl1.KeyFieldName               = "id";
         treeMenuControl1.ParentFieldName            = "parentId";
         treeMenuControl1.DisplayMember              = "name";
         treeMenuControl1.ValueMember                = "id";
         this.treeMenuControl1.DataSource            = AppContext.Session.deptList;
         treeMenuControl1.EditValue                  = AppContext.Session.deptList[0].id;
         treeMenuControl1.selectText                 = AppContext.Session.deptList[0].name;
         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)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error,
                              MessageBoxDefaultButton.Button1, MainForm);
         Log4net.LogHelper.Error("诊室设置下查询科室列表信息错误:" + ex.Message);
     }
 }
Example #5
0
 /// <summary>
 /// 获取科室信息
 /// </summary>
 /// <param name="code"></param>
 public void GetDoctorAndDepartment(string code)
 {
     try
     {
         listoffice = new List <Xr.Common.Controls.Item>();
         //查询科室下拉框数据
         //String url = AppContext.AppConfig.serverUrl + "cms/dept/findAll?hospital.code=" + AppContext.AppConfig.hospitalCode + "&deptIds=" + code;
         //String data = HttpClass.httpPost(url);
         //JObject objT = JObject.Parse(data);
         //if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         //{
         //    listoffice = objT["result"].ToObject<List<TreeList>>();
         //}
         //else
         //{
         //    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         //    return;
         //}
         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);
         }
         listoffice = itemList;
         itemList.Insert(0, new Xr.Common.Controls.Item {
             value = "", tag = "", name = "请选择", parentId = ""
         });
         treeListLookUpEdit1.Properties.DataSource               = itemList;
         treeListLookUpEdit1.Properties.TreeList.KeyFieldName    = "value";
         treeListLookUpEdit1.Properties.TreeList.ParentFieldName = "parentId";
         treeListLookUpEdit1.Properties.DisplayMember            = "name";
         treeListLookUpEdit1.Properties.ValueMember              = "value";
         treeListLookUpEdit1.EditValue                           = AppContext.Session.deptList[0].id;
         treeListLookUpEdit2.Properties.DataSource               = itemList;
         treeListLookUpEdit2.Properties.TreeList.KeyFieldName    = "value";
         treeListLookUpEdit2.Properties.TreeList.ParentFieldName = "parentId";
         treeListLookUpEdit2.Properties.DisplayMember            = "name";
         treeListLookUpEdit2.Properties.ValueMember              = "value";
         treeListLookUpEdit2.EditValue                           = AppContext.Session.deptList[0].id;
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         Log4net.LogHelper.Error("获取科室错误信息:" + ex.Message);
     }
 }
        public void GetKeShi()
        {
            try
            {
                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);
                }
                treeDeptStop.Properties.DataSource               = itemList;
                treeDeptStop.Properties.TreeList.KeyFieldName    = "value";
                treeDeptStop.Properties.TreeList.ParentFieldName = "parentId";
                treeDeptStop.Properties.DisplayMember            = "name";
                treeDeptStop.Properties.ValueMember              = "value";

                List <Xr.Common.Controls.Item> topItemList = 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;
                    topItemList.Add(item);
                }
                treeDeptTop.Properties.DataSource               = topItemList;
                treeDeptTop.Properties.TreeList.KeyFieldName    = "value";
                treeDeptTop.Properties.TreeList.ParentFieldName = "parentId";
                treeDeptTop.Properties.DisplayMember            = "name";
                treeDeptTop.Properties.ValueMember              = "value";
            }
            catch (Exception ex)
            {
                Log4net.LogHelper.Error("顶班弹窗获取科室错误信息:" + ex.Message);
                MessageBox.Show(ex.Message);
            }
        }
 public void GetDoctorName(string hospitalid, string deptid)
 {
     cmd.ShowOpaqueLayer(225, false);
     try
     {
         Dictionary <string, string> prament = new Dictionary <string, string>();
         //prament.Add("pageNo", "1");
         //prament.Add("pageSize", "1000");//暂时没有分页就一页传大点
         prament.Add("hospital.id", hospitalid); //医院主键
         prament.Add("dept.id", deptid);         //科室主键
         prament.Add("isOpen", "0");
         String url   = String.Empty;
         String param = "";
         if (prament.Count != 0)
         {
             param = string.Join("&", prament.Select(x => x.Key + "=" + x.Value).ToArray());
         }
         url = AppContext.AppConfig.serverUrl + "cms/doctor/findAll?" + param;
         String  jsonStr = HttpClass.httpPost(url);
         JObject objT    = JObject.Parse(jsonStr);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             listScheduling = objT["result"].ToObject <List <DoctorScheduling> >();
             List <string> listName = new List <string>();
             List <Xr.Common.Controls.Item> listitem = new List <Xr.Common.Controls.Item>();
             foreach (var item in listScheduling)
             {
                 Xr.Common.Controls.Item it = new Xr.Common.Controls.Item();
                 it.name     = item.name;
                 it.value    = item.id;
                 it.tag      = item.id;
                 it.parentId = "";
                 listitem.Add(it);
             }
             this.mcDoctor.setDataSource(listitem);
             cmd.HideOpaqueLayer();
         }
         else
         {
             cmd.HideOpaqueLayer();
             Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         }
         #region
         //RestSharpHelper.ReturnResult<List<string>>("cms/doctor/findAll", prament, Method.POST,
         //result =>
         //{
         //    #region
         //    switch (result.ResponseStatus)
         //    {
         //        case ResponseStatus.Completed:
         //            if (result.StatusCode == System.Net.HttpStatusCode.OK)
         //            {
         //                Log4net.LogHelper.Info("请求结果:" + string.Join(",", result.Data.ToArray()));
         //                JObject objT = JObject.Parse(string.Join(",", result.Data.ToArray()));
         //                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         //                {
         //                    listScheduling = objT["result"]["list"].ToObject<List<DoctorScheduling>>();
         //                    List<string> listName = new List<string>();
         //                    List<Xr.Common.Controls.Item> listitem = new List<Xr.Common.Controls.Item>();
         //                    foreach (var item in listScheduling)
         //                    {
         //                        Xr.Common.Controls.Item it = new Xr.Common.Controls.Item();
         //                        it.name = item.name;
         //                        it.value = item.id;
         //                        it.tag = item.id;
         //                        it.parentId = "";
         //                        listitem.Add(it);
         //                    }
         //                    _context.Send((s) => this.mcDoctor.setDataSource(listitem), null);
         //                    _context.Send((s) => cmd.HideOpaqueLayer(), null);
         //                }
         //                else
         //                {
         //                    _context.Send((s) => cmd.HideOpaqueLayer(), null);
         //                    _context.Send((s) => Xr.Common.MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm), null);
         //                }
         //            }
         //            break;
         //    }
         //    #endregion
         //});
         #endregion
     }
     catch (Exception ex)
     {
         Log4net.LogHelper.Error("诊间预约获取医生错误信息:" + ex.Message);
     }
 }