public IList <aers_tbl_hospdep> hospdepFindByHospId(string HospId) { aers_tbl_hospdepSqlMapDao dalhospdep = new aers_tbl_hospdepSqlMapDao(); IList <aers_tbl_hospdep> listhospdep = dalhospdep.hospdepFindByHospId(HospId); return(listhospdep); }
/// <summary> /// 根据注册用户编码查询注册用户信息 /// </summary> /// <param name="reguserId">注册用户编码</param> /// <returns>注册用户信息实体</returns> public IList <aers_tbl_registereduser> FindAll(string HospID) { String stmtId = "aers_tbl_registereduser_FindAll"; Hashtable ht = new Hashtable(); if (!string.IsNullOrEmpty(HospID)) { stmtId = "aers_tbl_registereduser_ByHospId"; ht.Add("HospId", HospID); } IList <aers_tbl_registereduser> list = ExecuteQueryForList <aers_tbl_registereduser>(stmtId, ht); aers_tbl_registereduserSqlMapDao dal = new aers_tbl_registereduserSqlMapDao(); aers_tbl_staffSqlMapDao dalstaff = new aers_tbl_staffSqlMapDao(); aers_tbl_events_ycSqlMapDao dalhospital = new aers_tbl_events_ycSqlMapDao(); aers_tbl_hospdepSqlMapDao dalhospdep = new aers_tbl_hospdepSqlMapDao(); IList <aers_tbl_hospital> listhospital = dalhospital.hospitalFindAll(); IList <aers_tbl_hospdep> listhospdep = dalhospdep.hospdepFindAll(); IList <aers_tbl_staff> liststaff = dalstaff.staffFindAll(); foreach (aers_tbl_registereduser item in list) { if (item.LoginName == null) { item.LoginName = ""; } aers_tbl_staff sta = liststaff.FirstOrDefault(o => o.ReguserId == item.ReguserId); if (sta != null) { item.StaffId = sta.StaffId; item.DepId = sta.DepId; item.Name = sta.Name; item.RoleState = sta.RoleState; item.Position = sta.Position; item.Phone = sta.Phone; item.Address = sta.Address; item.IDNumber = sta.IDNumber; item.StaffRemarks = sta.Remarks; if (sta.RoleState != null) { if (sta.RoleState.Contains("147")) { item.RoleState = "省厅"; } else if (sta.RoleState.Contains("148")) { item.RoleState = "区域"; } else if (sta.RoleState.Contains("145")) { item.RoleState = "护理部"; } else if (sta.RoleState.Contains("146")) { item.RoleState = "护士长"; } else if (sta.RoleState.Contains("402")) { item.RoleState = "护士"; } else { item.RoleState = "未知状态"; } } if (sta.Sex == "107") { item.Sex = "女"; } else if (sta.Sex == "108") { item.Sex = "男"; } else { item.Sex = "未知"; } } else { item.StaffId = ""; item.DepId = ""; item.Name = ""; item.Position = ""; item.Phone = ""; item.Address = ""; item.IDNumber = ""; item.StaffRemarks = ""; item.RoleState = ""; item.Sex = ""; item.RoleState = "未知状态"; } aers_tbl_hospdep of = listhospdep.FirstOrDefault(o => o.HospdepId == item.DepId); if (of != null) { item.HospdepName = of.HospdepName; aers_tbl_hospital hosp = listhospital.FirstOrDefault(o => o.HospId == of.HospId); if (hosp != null) { item.HospId = hosp.HospId; item.HospName = hosp.HospName; item.hospitalAddress = hosp.Address; item.hospitalPhone = hosp.Phone; item.Contact = hosp.Contact; item.Grade = hosp.Grade; item.Validitytime = hosp.Validitytime; } } else { item.HospdepName = ""; item.HospId = ""; item.HospName = ""; item.hospitalAddress = ""; item.hospitalPhone = ""; item.Contact = ""; item.Grade = ""; } } return(list); }