/// <summary> /// 判断是否选中当前项 /// </summary> private void IsCheckSectionsItem() { if (trvBookOprate.SelectedNode != null) { if (trvBookOprate.SelectedNode.Tag != null) { //清空所有的选项 for (int i = 0; i < chkListSection.Items.Count; i++) { chkListSection.SetSelected(i, false); } Class_Text_A temp = (Class_Text_A)trvBookOprate.SelectedNode.Tag; Class_Sub_Hospital temp_sub_hospital = (Class_Sub_Hospital)chkListFenyuan.SelectedItem; DataSet ds = App.GetDataSet("select * from t_textusearea where texttype=" + temp.Id.ToString() + " and belonghospital=" + temp_sub_hospital.Id.ToString() + ""); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { //科室或病区 for (int j = 0; j < chkListSection.Items.Count; j++) { Class_Sections temp2 = (Class_Sections)chkListSection.Items[j]; if (ds.Tables[0].Rows[i]["section"].ToString() == temp2.Sid.ToString()) { chkListSection.SetItemChecked(j, true); } } } } } }
/// <summary> /// 根据分院查找相关病区 /// </summary> /// <param name="subid">分院ID</param> private void Area_BY_SubHospital(string subid) { try { chkListSection.Items.Clear(); string Sql = "select * from t_sickareainfo where shid=" + subid + ""; DataSet ds = App.GetDataSet(Sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Class_Sections temp = new Class_Sections(); temp.Sid = Convert.ToInt16(ds.Tables[0].Rows[i]["SAID"].ToString()); temp.Section_Code = ds.Tables[0].Rows[i]["SICK_AREA_CODE"].ToString(); temp.Section_Name = ds.Tables[0].Rows[i]["SICK_AREA_NAME"].ToString(); chkListSection.Items.Add(temp); chkListSection.DisplayMember = "Section_Name"; chkListSection.ValueMember = "Sid"; } } catch { } }
/// <summary> /// 范围修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void chkListSection_MouseUp(object sender, MouseEventArgs e) { if (chkListFenyuan.SelectedItem != null) { Class_Sub_Hospital temp_hospital = (Class_Sub_Hospital)chkListFenyuan.SelectedItem; RemoveAllSectionByShid(Convert.ToInt16(temp_hospital.Id)); /* * 加载新设置的分院科室或病区 */ for (int i = 0; i < chkListSection.CheckedItems.Count; i++) { Class_Sections temp_section = (Class_Sections)chkListSection.CheckedItems[i]; Class_Doc_User_Range temp = new Class_Doc_User_Range(); temp.Belonghospital = Convert.ToInt16(temp_hospital.Id); temp.Section = temp_section.Sid; temp.Texttype = CurrentSelectDocId; temp.Workgroup = Convert.ToInt16(cboWorkGroup.SelectedValue); Doc_Ranges.Add(temp); } } }