private IList <aers_tbl_hospital> GetHospital() { aers_tbl_events_ycSqlMapDao atdao = new aers_tbl_events_ycSqlMapDao(); //这命名。。。 IList <aers_tbl_hospital> codelist = atdao.hospitalFindAll(); return(codelist); }
public void SetPageData() { IList <aers_tbl_hospital> listhosp = new aers_tbl_events_ycSqlMapDao().hospitalFindAll(); IList <aers_tbl_hospdep> listdep = new aers_tbl_hospdepSqlMapDao().hospdepFindAll(); IList <aers_tbl_eventsresume> list = new aers_tbl_eventsresumeSqlMapDao().GetEventsresumeList().OrderByDescending(o => o.EveresId).ToList(); IList <aers_sys_statecode> listcode = new aers_sys_statecodeSqlMapDao().FindAll(); foreach (aers_tbl_eventsresume item in list) { aers_sys_statecode code = listcode.FirstOrDefault(o => o.ECodeValue == item.EveresName); if (code != null) { item.EveresName = code.ECodeTag; } aers_tbl_hospital hosp = listhosp.FirstOrDefault(o => o.HospId == item.HospId); if (hosp != null) { item.HospId = hosp.HospName; } aers_tbl_hospdep dep = listdep.FirstOrDefault(o => o.HospdepId == item.HospDepId); if (dep != null) { item.HospDepId = dep.HospdepName; } switch (item.ExamineState.ToString()) { case "0": item.ExamineState = "审核中"; break; case "1": item.ExamineState = "已审核"; break; case "2": item.ExamineState = "未通过"; break; case "3": item.ExamineState = "未上报"; break; default: item.ExamineState = "--"; break; } } GridView1.DataSource = list; GridView1.DataBind(); }
protected void btn2_Click(object sender, EventArgs e) { aers_tbl_events_ycSqlMapDao dal = new aers_tbl_events_ycSqlMapDao(); IList <aers_tbl_hospital> listhosp = dal.hospitalFindAll(); aers_tbl_eventsresumeSqlMapDao dao = new aers_tbl_eventsresumeSqlMapDao(); IList <aers_tbl_eventsresume> list = dao.GetEventsresumeList().OrderByDescending(o => o.EveresId).ToList(); foreach (aers_tbl_eventsresume item in list) { aers_tbl_hospital hosp = listhosp.FirstOrDefault(o => o.HospId == item.HospId); if (hosp != null) { item.HospId = hosp.HospName; } } GridView1.DataSource = list; GridView1.DataBind(); }
private void AddHospitalUserInfo() { UserService userservice = new UserService(); var listUser = GetUser(); foreach (var item in listUser) { //------------------------------------------------------------------------------------------------------------------------------------------------------ //以前的注册表信息导入到授权表里面 var registerdata = userservice.GetUserregiserId(); UserauthsSqlMapDao urd = new UserauthsSqlMapDao(); //授权表导入数据 登陆名,密码,以前的注册Id Userauths ur = new Userauths(); ur.AuthsId = new aers_sys_seedSqlMapDao().GetMaxID("Userauths"); ur.LoginLastTime = Common.StrToDateTime(); ur.LoginNumber = item.LoginName; ur.LoginType = 0; //院内账号类型是0; ur.Password = item.Password; ur.RegisterId = registerdata; ur.Verified = 0; ur.ReguserId = item.ReguserId; urd.Adduserauths(ur); //------------------------------------------------------------------------------------------------------------------------------------------------------ aers_tbl_staffSqlMapDao sdao = new aers_tbl_staffSqlMapDao(); aers_tbl_staff s = new aers_tbl_staff(); var sdata = sdao.FindByRUid(item.ReguserId); //根据注册ID取出以前用户表里面的数据 科室id,姓名,性别,角色 userregisterSqlMapDao urdao = new userregisterSqlMapDao(); //注册表导入姓名 userregister urr = new userregister(); urr.RegisterId = registerdata; //注册Id urr.Name = sdata.Name; //添加姓名 urdao.Updateuserregister(urr); userbasicinfoSqlMapDao ubdao = new userbasicinfoSqlMapDao(); //基本信息表导入性别 UserBasicInfo ub = new UserBasicInfo(); ub.RegisterId = registerdata; if (sdata.Sex == "107") { ub.Sex = "女"; } else if (sdata.Sex == "108") { ub.Sex = "男"; } else { ub.Sex = ""; } ub.Birthday = Common.StrToDateTime(); ubdao.Updateuserbasicinfo(ub); UserrelrecordSqlMapDao urrrdao = new UserrelrecordSqlMapDao(); //组织关系表导入科室Id Userrelrecord urrr = new Userrelrecord(); urrr.RegisterId = registerdata; urrr.DepartmentId = sdata.DepId; //科室Id urrr.Role = sdata.RoleState; //还用以前的标记 角色 aers_tbl_hospdepSqlMapDao ad = new aers_tbl_hospdepSqlMapDao(); urrr.DepartmentName = ad.FindhospdepByDepId(sdata.DepId).HospdepName; //科室姓名 var hospId = ad.FindhospdepByDepId(sdata.DepId).HospId; //医院ID // aers_tbl_hospitalSqlMapDao DDD = new aers_tbl_hospitalSqlMapDao(); //shit aers_tbl_events_ycSqlMapDao hdao = new aers_tbl_events_ycSqlMapDao(); var hdat = hdao.hospitalFindByHospId(hospId); urrr.HospitalName = hdat.HospName; //医院姓名 urrr.HospitalId = hospId; //医院Id //h.HospitalId = item.HospId; //h.Name = item.HospName; urrrdao.Updateuserrelrecord(urrr); } }