private void UcMerger_DoubleClick(object sender, EventArgs e) { if (!this.IsQualityAlert) {//不是质控提醒进入 if (!Flag) { Class_Record_Monitor_View q = (Class_Record_Monitor_View)this.Tag; frmHint f; if (IsVisDoctor) { f = new frmHint(false, q, Name, true, img_yel, img_red); } else { f = new frmHint(q, Name, true, img_yel, img_red); } f.ShowDialog(); } else { if (this.Parent.Parent.Parent.GetType().Name.Contains("frmHint")) { frmHint frmhint = this.Parent.Parent.Parent as frmHint; frmhint.uc_DoubleClick(lblDocName.Text); } } } }
private void UcLight_DoubleClick(object sender, EventArgs e) { if (!IsQualityAlert) {//质控提醒界面进入 if (!Flag) { Class_Record_Monitor_View q = (Class_Record_Monitor_View)this.Tag; if (q.PV != 3) { frmHint f = new frmHint(q, Name, img_light); f.ShowDialog(); } else { frmHint f = new frmHint(q, Name, img_light, IsVisDoctor); f.ShowDialog(); } } else { if (this.Parent.Parent.Parent.GetType().Name.Contains("frmHint")) { frmHint frmhint = this.Parent.Parent.Parent as frmHint; frmhint.uc_DoubleClick(lblDocName.Text); } } } }
/// <summary> /// 补录信息详细查看 /// </summary> /// <param name="q"></param> /// <param name="names"></param> /// <param name="blimg"></param> /// <param name="IsDoctor">是否管床医生界面双击进入</param> public frmHint(Class_Record_Monitor_View q, string names, Image blimg, bool IsDoctor) { InitializeComponent(); try { this.imgbl = blimg; ucC1FlexGrid1.fg.AllowEditing = false; string selectDotor = string.Empty; #region 注释老版质控查询 //if (IsDoctor == false) //{//是否管床医生界面双击进入 // tempSQL = "select tip.id,tip.section_name,tip.pid,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.text_name||' 红灯时间:'||to_char(tqr.red_time,'yyyy-MM-dd hh24:mi')||' 操作时间:'||to_char(tqr.operate_time,'yyyy-MM-dd hh24:mi') note,'2' pv from T_QUALITY_RECORD_TEMP tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + // " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where tqr.operate_time>tqr.red_time and " + // "tqr.text_name='" + q.DocType + "'"; // selectDotor = "select count(tqr.text_name) 补录," + // " tip.sick_doctor_name,tip.sick_doctor_id from T_QUALITY_RECORD_TEMP tqr" + // " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + // " where tqr.operate_time>tqr.red_time and tqr.text_name='" + q.DocType + "'"; // if (q.SickArea_Name != null) // { // if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") // { // tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; // selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; // } // else // { // tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; // selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; // } // } // selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; // tabItem2.Visible = true; //} //else //{ // tempSQL = "select tip.id,tip.section_name,tip.pid,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.text_name||' 红灯时间:'||to_char(tqr.red_time,'yyyy-MM-dd hh24:mi')||' 操作时间:'||to_char(tqr.operate_time,'yyyy-MM-dd hh24:mi') note,'2' pv from T_QUALITY_RECORD_TEMP tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + // " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where tqr.operate_time>tqr.red_time and " + // "tip.sick_doctor_name='" + q.DocType + "'"; // selectDotor = "select count(tqr.text_name) 补录," + // " tip.sick_doctor_name,tip.sick_doctor_id from T_QUALITY_RECORD_TEMP tqr" + // " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + // " where tqr.operate_time>tqr.red_time and tip.sick_doctor_name='" + q.DocType + "'"; // if (q.SickArea_Name != null) // { // if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") // { // tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; // selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; // } // else // { // tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; // selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; // } // } // selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; // tabItem2.Visible = false; //} #endregion if (IsDoctor == false) {//是否管床医生界面双击进入 tempSQL = "select tip.id,tip.section_name,tip.pid,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.note,'3' pv from T_QUALITY_RECORD tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null and instr(tip.his_id, '_') = 0 inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where tqr.pv=3 and " + "tqr.doctype='" + q.DocType + "'"; selectDotor = "select count(tqr.doctype) 补录," + " tip.sick_doctor_name,tip.sick_doctor_id from T_QUALITY_RECORD tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null and instr(tip.his_id, '_') = 0 inner join t_sectioninfo ts on tip.section_id=ts.sid " + " where tqr.pv=3 and tqr.doctype='" + q.DocType + "'"; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; tabItem2.Visible = true; } else { tempSQL = "select tip.id,tip.section_name,tip.pid,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.note,'3' pv from T_QUALITY_RECORD tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null and instr(tip.his_id, '_') = 0 inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where tqr.pv=3 and " + "tip.sick_doctor_name='" + q.DocType + "'"; selectDotor = "select count(tqr.doctype) 补录," + " tip.sick_doctor_name,tip.sick_doctor_id from T_QUALITY_RECORD tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null and instr(tip.his_id, '_') = 0 inner join t_sectioninfo ts on tip.section_id=ts.sid " + " where tqr.pv=3 and tip.sick_doctor_name='" + q.DocType + "'"; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; tabItem2.Visible = false; } ucC1FlexGrid1.fg.DoubleClick += new EventHandler(fgDouble_Click); ucC1FlexGrid1.DataBd(tempSQL + " order by tip.sick_bed_id, tqr.noteztime asc", "note", "pid,section_name,sick_bed_no,patient_name,sick_doctor_name,name,note,pv", "住院号,科室,床号,姓名,管床医生,职称,说明内容,提醒"); refleshgrid(); InitLigth(selectDotor); } catch (Exception) { //throw; } }
/// <summary> /// 1单项不是补录 /// </summary> /// <param name="q"></param> /// <param name="names"></param> /// <param name="yel"></param> public frmHint(Class_Record_Monitor_View q, string names, Image yel) { InitializeComponent(); try { this.imgYel = yel; ucC1FlexGrid1.fg.AllowEditing = false; string selectDotor = string.Empty; if (names == "HLB" || names.Contains("护理部")) { string DocTypeID = App.ReadSqlVal("select tqv.id from t_quality_var_hlb tqv inner join t_data_code ta on tqv.document_type=ta.id where tqv.name='" + q.DocType + "'", 0, "name"); tempSQL = "select tip.id,tip.pid,tip.sick_area_name,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.note,tqr.pv from t_quality_record_hlb tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where " + " tqr.doctype in(" + q.DocTypeID + ") and tqr.pv=" + q.PV + "";//and tip.sick_area_name='" + q.SickArea_Name + "' selectDotor = "select count((case tqr.pv when '1' then tip.id end)) 红灯," + " count((case tqr.pv when '0' then tip.id end)) 黄灯," + " tip.sick_doctor_name,tip.sick_doctor_id from t_quality_record_hlb tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null " + " inner join t_sectioninfo ts on tip.section_id=ts.sid where tqr.doctype in(" + q.DocTypeID + ")"; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.sick_area_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.sick_area_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; } if (names == "YWC" || names.Contains("医务处")) { tempSQL = "select tip.id,tip.pid,tip.section_name,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name,tqr.note,tqr.pv from t_quality_record tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where " + "tqr.doctype='" + q.DocType + "' and tqr.pv=" + q.PV + ""; //if (q.SickArea_Name != null) // tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; selectDotor = "select count((case tqr.pv when '1' then tip.id end)) 红灯," + " count((case tqr.pv when '0' then tip.id end)) 黄灯," + " tip.sick_doctor_name,tip.sick_doctor_id from t_quality_record tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null " + " inner join t_sectioninfo ts on tip.section_id=ts.sid where tqr.doctype='" + q.DocType + "' and tqr.pv=" + q.PV + ""; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; } ucC1FlexGrid1.fg.DoubleClick += new EventHandler(fgDouble_Click); InitTable(tempSQL + " order by tip.sick_bed_id, tqr.noteztime asc", names); InitLigth(selectDotor, false); } catch (Exception) { //throw; } }
/// <summary> /// 4 /// </summary> /// <param name="q"></param> /// <param name="names"></param> /// <param name="isMOre"></param> /// <param name="yel"></param> /// <param name="imgred"></param> /// <param name="isvisable"></param> public frmHint(Class_Record_Monitor_View q, string names, bool isMOre, Image yel, Image imgred, bool isvisable) { InitializeComponent(); try { this.imgRed = imgred; this.imgYel = yel; ucC1FlexGrid1.fg.AllowEditing = false; string selectDotor = string.Empty; if (names == "HLB" || names.Contains("护理部")) { tempSQL = "select tip.id,tip.pid,tip.sick_area_name,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name," + "tqr.note,tqr.pv from t_quality_record_hlb tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where " + " tqr.doctype in(" + q.DocTypeID + ")";//and tip.sick_area_name='" + q.SickArea_Name + "' //if (q.SickArea_ID!=null) // tempSQL+= " and tqr.section_sickaera=" + q.SickArea_ID; selectDotor = "select count((case tqr.pv when '1' then tip.id end)) 红灯," + " count((case tqr.pv when '0' then tip.id end)) 黄灯," + " tip.sick_doctor_name,tip.sick_doctor_id from t_quality_record_hlb tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null " + " inner join t_sectioninfo ts on tip.section_id=ts.sid where tqr.doctype in(" + q.DocTypeID + ")"; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.sick_area_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.sick_area_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; } if (names == "YWC" || names.Contains("医务处")) { tempSQL = "select tip.id,tip.pid,tip.section_name,tip.sick_bed_no,tip.patient_name,tip.sick_doctor_name,u.name," + "tqr.note,tqr.pv from t_quality_record tqr inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null inner join t_sectioninfo ts on tip.section_id=ts.sid " + " left join (select c.name,u.user_id from t_userinfo u left join T_DATA_CODE c on u.u_tech_post=c.id ) u on tip.sick_doctor_id=u.user_id where " + "tqr.doctype='" + q.DocType + "'"; selectDotor = "select count((case tqr.pv when '1' then tip.id end)) 红灯," + " count((case tqr.pv when '0' then tip.id end)) 黄灯," + " tip.sick_doctor_name,tip.sick_doctor_id from t_quality_record tqr" + " inner join t_in_patient tip on tqr.patient_id=tip.id and tip.DOCUMENT_STATE is null " + " inner join t_sectioninfo ts on tip.section_id=ts.sid where tqr.doctype='" + q.DocType + "'"; if (q.SickArea_Name != null) { if (q.SickArea_Name == "北院" || q.SickArea_Name == "南院") { tempSQL += " and ts.shid='" + q.SickArea_ID + "'"; selectDotor += " and ts.shid='" + q.SickArea_ID + "'"; } else { tempSQL += " and tip.section_name='" + q.SickArea_Name + "'"; selectDotor += " and tip.section_name='" + q.SickArea_Name + "'"; } } selectDotor += " group by tip.sick_doctor_name,tip.sick_doctor_id"; } ucC1FlexGrid1.fg.DoubleClick += new EventHandler(fgDouble_Click); InitTable(tempSQL + " order by tip.sick_bed_id, tqr.noteztime asc", names); InitLigth(selectDotor, true); tabItem2.Visible = isvisable; //tabControlPanel1.Controls.Add(ucC1FlexGrid1); } catch (Exception ex) { //throw; } }
/// <summary> /// 初始化数据--HLB /// </summary> //public void InitFlexGrid(Panel GbxMontior, string sqlSel, ComboBox comboxSA, string flag, ListView lstCount, string sqlCount,bool isDoctor) //{ // GbxMontior.Controls.Clear(); // Class_Table[] table = new Class_Table[2]; // table[0] = new Class_Table(); // table[0].Sql = sqlSel; // table[0].Tablename = "sqlSel"; // table[1] = new Class_Table(); // table[1].Sql = sqlCount; // table[1].Tablename = "sqlCount"; // DS_QUALITYTABLE = App.GetDataSet(table); // DataSet dataSet = DS_QUALITYTABLE; // ListViewItem[] item = new ListViewItem[dataSet.Tables[0].Rows.Count]; // Class_Record_Monitor_View[] crmv = new Class_Record_Monitor_View[dataSet.Tables[0].Rows.Count]; // if (dataSet.Tables["sqlSel"] != null) // { // Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlSel"].Rows.Count]; // //using (Graphics gh = Graphics.FromHwnd(GbxMontior.Handle)) // //{ // string section_name = string.Empty; // for (int j = 0; j < dataSet.Tables["sqlSel"].Rows.Count; j++) // { // string doctor_name = dataSet.Tables["sqlSel"].Rows[j]["sick_doctor_name"].ToString(); // int yelNum = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["黄灯"].ToString()); // int redNum = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["红灯"].ToString()); // string names = dataSet.Tables["sqlSel"].Rows[j]["names"].ToString(); // Image red = lstCount.SmallImageList.Images[0]; // Image yellow = lstCount.SmallImageList.Images[1]; // UserControl uc = new UcMerger(true,doctor_name, yelNum, yellow, redNum, red, flag); // Class_Record_Monitor_View crmv5 = new Class_Record_Monitor_View(); // crmv5.DocType = doctor_name; // crmv5.SickArea_Name = names; // uc.Tag = crmv5; // //if (section_name != names) // //{ // // if (!string.IsNullOrEmpty(names)) // // { // // section_name = names; // // Label lbl = new Label(); // // lbl.Text = section_name; // // lbl.ForeColor = Color.Blue; // // GbxMontior.Controls.Add(lbl); // // //AddUcontrol(GbxMontior, uc, section_name); // // } // //} // GbxMontior.Controls.Add(uc); // } // //} // } // GbxMontior.Refresh(); // ListViewGroup CountGroup = new ListViewGroup(); // CountGroup.Header = "统计列表"; // CountGroup.Name = "统计列表"; // lstCount.Groups.Add(CountGroup); // if (dataSet.Tables["sqlCount"] != null) // { // Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlCount"].Rows.Count]; // for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) // { // crmv1[i] = new Class_Record_Monitor_View(); // crmv1[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); // crmv1[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); // crmv1[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv1[i]; // tempItem.Name = crmv1[i].DocType; // tempItem.Text = crmv1[i].DocType + "[" + crmv1[i].Num.ToString() + "]"; // if (crmv1[i].PV == 0) // { // tempItem.ImageIndex = 1;//黄灯 // } // else // { // tempItem.ImageIndex = 0;//红灯 // } // tempItem.Group = lstCount.Groups["统计列表"]; // lstCount.Items.Add(tempItem); // } // } //} #endregion /// <summary> /// 管床医生监控界面-初始化数据 /// </summary> /// <param name="GbxMontior"></param> /// <param name="sqlSel"></param> /// <param name="comboxSA"></param> /// <param name="flag"></param> /// <param name="pCount"></param> /// <param name="sqlCount"></param> /// <param name="isDoctor"></param> /// <param name="img"></param> /// <param name="IsQualityAlert">是否质控提醒界面查询</param> public void InitFlexGrid(Panel GbxMontior, string sqlSel, ComboBox comboxSA, string flag, Panel pCount, string sqlCount, bool isBuLu, ImageList img, bool IsQualityAlert) { GbxMontior.Controls.Clear(); pCount.Controls.Clear(); Class_Table[] table = new Class_Table[2]; table[0] = new Class_Table(); table[0].Sql = sqlSel; table[0].Tablename = "sqlSel"; table[1] = new Class_Table(); table[1].Sql = sqlCount; table[1].Tablename = "sqlCount"; DS_QUALITYTABLE = App.GetDataSet(table); DataSet dataSet = DS_QUALITYTABLE; //ListViewItem[] item = new ListViewItem[dataSet.Tables[0].Rows.Count]; //Class_Record_Monitor_View[] crmv = new Class_Record_Monitor_View[dataSet.Tables[0].Rows.Count]; if (dataSet.Tables["sqlSel"] != null) { Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlSel"].Rows.Count]; string section_name = string.Empty; int no = 0; for (int j = 0; j < dataSet.Tables["sqlSel"].Rows.Count; j++) { crmv1[j] = new Class_Record_Monitor_View(); string doctor_name = dataSet.Tables["sqlSel"].Rows[j]["sick_doctor_name"].ToString(); string sid = dataSet.Tables["sqlSel"].Rows[j]["section_id"].ToString(); string names = dataSet.Tables["sqlSel"].Rows[j]["section_name"].ToString(); Image red = img.Images[0]; Image yellow = img.Images[1]; Image bl = img.Images[3]; UserControl uc; //Class_Record_Monitor_View crmv5 = new Class_Record_Monitor_View(); if (isBuLu) { int blNum = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["补录"].ToString()); uc = new UcLight(true, IsQualityAlert, doctor_name, blNum, bl, flag); //uc = new UcLight(doctor_name, blNum, bl, "", true); crmv1[j].Num = blNum; crmv1[j].PV = 3; } else { int yelNum = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["黄灯"].ToString()); int redNum = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["红灯"].ToString()); uc = new UcMerger(true, IsQualityAlert, doctor_name, yelNum, yellow, redNum, red, flag); } crmv1[j].DocType = doctor_name; crmv1[j].SickArea_ID = sid; crmv1[j].SickArea_Name = names; uc.Tag = crmv1[j]; if (section_name != crmv1[j].SickArea_Name) { if (!string.IsNullOrEmpty(crmv1[j].SickArea_Name)) { section_name = crmv1[j].SickArea_Name; Label lbl = new Label(); //lbl.AutoSize = true;//考虑到排版会不对称,取消自动宽度,变成固定宽度 no++; lbl.Text = no.ToString() + "." + section_name; lbl.Width = 120; lbl.ForeColor = Color.Blue; GbxMontior.Controls.Add(lbl); } } GbxMontior.Controls.Add(uc); } //} } GbxMontior.Refresh(); if (dataSet.Tables["sqlCount"] != null) { Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlCount"].Rows.Count]; for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) { crmv1[i] = new Class_Record_Monitor_View(); crmv1[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); crmv1[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); crmv1[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); if (comboxSA.Text != "" && !comboxSA.Text.Contains("请选择")) { crmv1[i].SickArea_ID = comboxSA.SelectedValue == null ? "" : comboxSA.SelectedValue.ToString(); crmv1[i].SickArea_Name = comboxSA.Text; } int onePv = crmv1[i].PV; int oneNum = crmv1[i].Num; string text = crmv1[i].DocType; //取反条件 int intPv = onePv == 1 ? 0 : 1; string swithcs = " DOCTYPE='" + crmv1[i].DocType + "' and PV='" + intPv + "'"; DataRow[] rows = dataSet.Tables["sqlCount"].Select(swithcs); int otherPv = 0; int otherNum = 0; UserControl uc; if (rows.Length > 0) //相同的文书 { otherNum = Convert.ToInt32(rows[0]["NUM"].ToString()); otherPv = Convert.ToInt32(rows[0]["PV"].ToString()); dataSet.Tables["sqlCount"].Rows.Remove(rows[0]); Image red = img.Images[0]; Image yellow = img.Images[1]; if (onePv == 0)//黄灯 { uc = new UcMerger(IsQualityAlert, text, oneNum, yellow, otherNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } else { uc = new UcMerger(IsQualityAlert, text, otherNum, yellow, oneNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } } else { Image image; if (onePv == 3)//补录灯 { image = img.Images[3]; } else if (onePv == 0)//黄灯 { image = img.Images[1]; } else { image = img.Images[0]; } uc = new UcLight(IsQualityAlert, text, oneNum, image, flag); //uc = new PbLight(text, oneNum, img); } uc.Tag = crmv1[i]; pCount.Controls.Add(uc); } } pCount.Refresh(); }
/// <summary> /// 初始化数据--HLB /// </summary> //public void InitFlexGrid(ListView lstMontior,string sqlSel,ComboBox comboxSA,string flag,ListView lstCount,string sqlCount) //{ // try // { // float x = 20; // float y = 20; // ArrayList tempList = new ArrayList(); // ImageList imaList = lstMontior.SmallImageList; // ImageList imgState = lstMontior.StateImageList; // //红灯 // Image img1 = imgState.Images[0]; // //黄灯 // Image img2 = imgState.Images[1]; // imaList.Images.Clear(); // //imaList.Images.Add(img1); // //imaList.Images.Add(img2); // //Image.GetThumbnailImageAbort imgAbort = new Image.GetThumbnailImageAbort(GetImg); // //imaList.Images.Clear(); // //imaList.Images.Add(img1.GetThumbnailImage(100,20,imgAbort,IntPtr.Zero)); // //imaList.Images.Add(img2.GetThumbnailImage(100,20,imgAbort,IntPtr.Zero)); // //imaList.Images.Clear(); // Class_Table[] table = new Class_Table[2]; // table[0] = new Class_Table(); // table[0].Sql = sqlSel; // table[0].Tablename = "sqlSel"; // table[1] = new Class_Table(); // table[1].Sql = sqlCount; // table[1].Tablename = "sqlCount"; // DS_QUALITYTABLE = App.GetDataSet(table); // DataSet dataSet = DS_QUALITYTABLE; // ListViewItem[] item = new ListViewItem[dataSet.Tables[0].Rows.Count]; // Class_Record_Monitor_View[] crmv = new Class_Record_Monitor_View[dataSet.Tables[0].Rows.Count]; // if (dataSet.Tables["sqlSel"] != null) // { // if (flag == "HLB") // { // //加载病区组 // for (int i = 0; i < dataSet.Tables["sqlSel"].Rows.Count; i++) // { // if (!IsHaveGroup(dataSet.Tables["sqlSel"].Rows[i]["SICK_AREA_NAME"].ToString(), lstMontior)) // { // ListViewGroup tempGroup = new ListViewGroup(); // tempGroup.Header = dataSet.Tables["sqlSel"].Rows[i]["SICK_AREA_NAME"].ToString(); // tempGroup.Name = dataSet.Tables["sqlSel"].Rows[i]["SICK_AREA_NAME"].ToString(); // //if (comboxSA.Text != tempGroup.Name) // //{ // // ShowCommboBoxValue(comboxSA, tempGroup.Name);//病区名字 // //} // lstMontior.Groups.Add(tempGroup); // } // } // for (int i = 0; i < dataSet.Tables["sqlSel"].Rows.Count; i++) // { // crmv[i] = new Class_Record_Monitor_View(); // crmv[i].SickArea_ID = dataSet.Tables["sqlSel"].Rows[i]["SICK_AREA_ID"].ToString(); // crmv[i].SickArea_Name = dataSet.Tables["sqlSel"].Rows[i]["SICK_AREA_NAME"].ToString(); // crmv[i].DocType = dataSet.Tables["sqlSel"].Rows[i]["DOCTYPE"].ToString(); // crmv[i].Num = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[i]["NUM"].ToString()); // crmv[i].PV = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[i]["PV"].ToString()); // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv[i]; // tempItem.Name = crmv[i].DocType; // tempItem.Text = crmv[i].DocType + "[" + crmv[i].Num.ToString() + "]"; // if (crmv[i].PV == 0) // { // tempItem.ImageIndex = 1; // } // else // { // tempItem.ImageIndex = 0; // } // tempItem.Group = lstMontior.Groups[crmv[i].SickArea_Name]; // lstMontior.Items.Add(tempItem); // } // ListViewGroup CountGroup = new ListViewGroup(); // CountGroup.Header = "统计列表"; // CountGroup.Name = "统计列表"; // lstCount.Groups.Add(CountGroup); // if (dataSet.Tables["sqlCount"] != null) // { // for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) // { // crmv[i] = new Class_Record_Monitor_View(); // crmv[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); // crmv[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); // crmv[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv[i]; // tempItem.Name = crmv[i].DocType; // tempItem.Text = crmv[i].DocType + "[" + crmv[i].Num.ToString() + "]"; // if (crmv[i].PV == 0) // { // tempItem.ImageIndex = 1; // } // else // { // tempItem.ImageIndex = 0; // } // tempItem.Group = lstCount.Groups["统计列表"]; // lstCount.Items.Add(tempItem); // } // } // } // if (flag == "YWC") // { // //加载科室组 // for (int i = 0; i < dataSet.Tables["sqlSel"].Rows.Count; i++) // { // //!IsHaveGroup(dataSet.Tables["sqlSel"].Rows[i]["SECTION_NAME"].ToString(), lstMontior) // if (lstMontior.Items.Count == 0) // { // ListViewGroup tempGroup = new ListViewGroup(); // tempGroup.Header = dataSet.Tables["sqlSel"].Rows[i]["SECTION_NAME"].ToString(); // tempGroup.Name = dataSet.Tables["sqlSel"].Rows[i]["SECTION_NAME"].ToString(); // //if (comboxSA.Text != tempGroup.Name) // //{ // // ShowCommboBoxValue(comboxSA, tempGroup.Name);//病区名字 // //} // lstMontior.Groups.Add(tempGroup); // } // } // //string sql = "select doctype,count(*) as num from record_monitor_view_ywc group by doctype,section_id having count(*) > 1"; // //DataSet ds = App.GetDataSet(sql); // for (int i = 0; i < dataSet.Tables["sqlSel"].Rows.Count; i++) // { // crmv[i] = new Class_Record_Monitor_View(); // crmv[i].SickArea_ID = dataSet.Tables["sqlSel"].Rows[i]["SECTION_ID"].ToString(); // crmv[i].SickArea_Name = dataSet.Tables["sqlSel"].Rows[i]["SECTION_NAME"].ToString(); // crmv[i].DocType = dataSet.Tables["sqlSel"].Rows[i]["DOCTYPE"].ToString(); // crmv[i].Num = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[i]["NUM"].ToString()); // crmv[i].PV = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[i]["PV"].ToString()); // int onePv = crmv[i].PV; // int oneNum = crmv[i].Num; // string text = crmv[i].DocType; // //取反条件 // int intPv = onePv == 1 ? 0 : 1; // string swithcs = "SECTION_ID='" + crmv[i].SickArea_ID + "' and DOCTYPE='" + // crmv[i].DocType + "' and PV='"+intPv+"'"; // DataRow[] rows = dataSet.Tables["sqlSel"].Select(swithcs); // int otherPv = 0; // int otherNum = 0; // if (rows.Length > 0) //相同的文书 // { // //i++; // //crmv[i] = new Class_Record_Monitor_View(); // //crmv[i].SickArea_ID = rows[0]["SECTION_ID"].ToString(); // //crmv[i].SickArea_Name = rows[0]["SECTION_NAME"].ToString(); // //crmv[i].DocType = rows[0]["DOCTYPE"].ToString(); // //crmv[i].Num = // //crmv[i].PV = // otherNum = Convert.ToInt32(rows[0]["NUM"].ToString()); // otherPv = Convert.ToInt32(rows[0]["PV"].ToString()); // dataSet.Tables["sqlSel"].Rows.Remove(rows[0]); // } // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv[i]; // tempItem.Name = crmv[i].DocType; // if (rows.Length > 0) // { // int imgIndex1 = onePv == 0 ? 1 : 0; // int imgIndex2 = otherPv == 0 ? 1 : 0; // Image img; // if (imgIndex1 == 1) // { // img = CreateImage(oneNum, otherNum, img2, img1); // } // else // { // img = CreateImage(otherNum,oneNum , img1, img2); // } // imaList.Images.Add(tempItem.Name, img); // tempItem.ImageKey = tempItem.Name; // tempItem.Text = text; // } // else // { // // if (onePv == 0) // // { // // tempItem.StateImageIndex = 1;//黄灯 // // } // // else // // { // // tempItem.StateImageIndex = 0;//红灯 // // } // Image imgOne; // if (onePv == 0) // { // imgOne = CreateImage(oneNum, img2); // } // else // { // imgOne = CreateImage(oneNum, img1); // } // imaList.Images.Add(tempItem.Name, imgOne); // tempItem.ImageKey = tempItem.Name; // tempItem.Text = text; // //tempItem.Text = crmv[i].DocType + "[" + crmv[i].Num.ToString() + "]"; // } // tempItem.Group = lstMontior.Groups[crmv[i].SickArea_Name]; // lstMontior.Items.Add(tempItem); // } // ListViewGroup CountGroup = new ListViewGroup(); // CountGroup.Header = "统计列表"; // CountGroup.Name = "统计列表"; // lstCount.Groups.Add(CountGroup); // if (dataSet.Tables["sqlCount"] != null) // { // for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) // { // crmv[i] = new Class_Record_Monitor_View(); // crmv[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); // crmv[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); // crmv[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv[i]; // tempItem.Name = crmv[i].DocType; // tempItem.Text = crmv[i].DocType + "[" + crmv[i].Num.ToString() + "]"; // if (crmv[i].PV == 0) // { // tempItem.ImageIndex = 1;//黄灯 // } // else // { // tempItem.ImageIndex = 0;//红灯 // } // tempItem.Group = lstCount.Groups["统计列表"]; // lstCount.Items.Add(tempItem); // } // } // } // } // } // catch // { } //} /// <summary> /// 初始化数据--HLB /// </summary> //public void InitFlexGrid(Panel GbxMontior, string sqlSel, ComboBox comboxSA, string flag, ListView lstCount, string sqlCount) //{ // GbxMontior.Controls.Clear(); // Class_Table[] table = new Class_Table[2]; // table[0] = new Class_Table(); // table[0].Sql = sqlSel; // table[0].Tablename = "sqlSel"; // table[1] = new Class_Table(); // table[1].Sql = sqlCount; // table[1].Tablename = "sqlCount"; // DS_QUALITYTABLE = App.GetDataSet(table); // DataSet dataSet = DS_QUALITYTABLE; // Class_Record_Monitor_View[] crmv=null; // if (dataSet.Tables[0].Rows.Count > 0) // { // crmv = new Class_Record_Monitor_View[dataSet.Tables[0].Rows.Count]; // } // else // { // return; // } // if (dataSet.Tables["sqlSel"] != null) // { // Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlSel"].Rows.Count]; // //using (Graphics gh = Graphics.FromHwnd(GbxMontior.Handle)) // //{ // string section_name = string.Empty; // bool isLine = false; // for (int j = 0; j < dataSet.Tables["sqlSel"].Rows.Count; j++) // { // crmv1[j] = new Class_Record_Monitor_View(); // crmv1[j].SickArea_ID = dataSet.Tables["sqlSel"].Rows[j]["SECTION_ID"].ToString(); // crmv1[j].SickArea_Name = dataSet.Tables["sqlSel"].Rows[j]["SECTION_NAME"].ToString(); // crmv1[j].DocType = dataSet.Tables["sqlSel"].Rows[j]["DOCTYPE"].ToString(); // crmv1[j].Num = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["NUM"].ToString()); // crmv1[j].PV = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["PV"].ToString()); // int onePv = crmv1[j].PV; // int oneNum = crmv1[j].Num; // string text = crmv1[j].DocType; // //取反条件 // int intPv = onePv == 1 ? 0 : 1; // string swithcs = "SECTION_ID='" + crmv1[j].SickArea_ID + "' and DOCTYPE='" + // crmv1[j].DocType + "' and PV='" + intPv + "'"; // DataRow[] rows = dataSet.Tables["sqlSel"].Select(swithcs); // int otherPv = 0; // int otherNum = 0; // UserControl uc; // if (rows.Length > 0) //相同的文书 // { // otherNum = Convert.ToInt32(rows[0]["NUM"].ToString()); // otherPv = Convert.ToInt32(rows[0]["PV"].ToString()); // dataSet.Tables["sqlSel"].Rows.Remove(rows[0]); // Image red = lstCount.SmallImageList.Images[0]; // Image yellow = lstCount.SmallImageList.Images[1]; // if (onePv == 0)//黄灯 // { // uc = new UcMerger(text, oneNum, yellow, otherNum, red, flag); // //uc = new PbMerger(text, oneNum, yellow, otherNum, red); // } // else // { // uc = new UcMerger(text, otherNum, yellow, oneNum, red, flag); // //uc = new PbMerger(text, oneNum, yellow, otherNum, red); // } // } // else // { // Image img; // if (onePv == 0)//黄灯 // { // img = lstCount.SmallImageList.Images[1]; // } // else // { // img = lstCount.SmallImageList.Images[0]; // } // uc = new UcLight(text, oneNum, img, flag); // //uc = new PbLight(text, oneNum, img); // } // uc.Tag = crmv1[j]; // if (section_name != crmv1[j].SickArea_Name) // { // if (!string.IsNullOrEmpty(crmv1[j].SickArea_Name)) // { // section_name = crmv1[j].SickArea_Name; // Label lbl = new Label(); // lbl.Text = section_name; // lbl.ForeColor = Color.Blue; // GbxMontior.Controls.Add(lbl); // //AddUcontrol(GbxMontior, uc, section_name); // } // } // else // { // //AddUcontrol(GbxMontior, uc); // } // GbxMontior.Controls.Add(uc); // } // //} // } // GbxMontior.Refresh(); // ListViewGroup CountGroup = new ListViewGroup(); // CountGroup.Header = "统计列表"; // CountGroup.Name = "统计列表"; // lstCount.Groups.Add(CountGroup); // if (dataSet.Tables["sqlCount"] != null) // { // Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlCount"].Rows.Count]; // for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) // { // crmv1[i] = new Class_Record_Monitor_View(); // crmv1[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); // crmv1[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); // crmv1[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); // ListViewItem tempItem = new ListViewItem(); // tempItem.Tag = crmv1[i]; // tempItem.Name = crmv1[i].DocType; // tempItem.Text = crmv1[i].DocType + "[" + crmv1[i].Num.ToString() + "]"; // if (crmv1[i].PV == 0) // { // tempItem.ImageIndex = 1;//黄灯 // } // else // { // tempItem.ImageIndex = 0;//红灯 // } // tempItem.Group = lstCount.Groups["统计列表"]; // lstCount.Items.Add(tempItem); // } // } //} #endregion /// <summary> /// 质控监控界面-初始化数据 /// </summary> /// <param name="GbxMontior"></param> /// <param name="sqlSel"></param> /// <param name="comboxSA"></param> /// <param name="flag"></param> /// <param name="pCount"></param> /// <param name="sqlCount"></param> /// <param name="img"></param> public void InitFlexGrid(Panel GbxMontior, string sqlSel, ComboBox comboxSA, string flag, Panel pCount, string sqlCount, ImageList img) { GbxMontior.Controls.Clear(); pCount.Controls.Clear(); Class_Table[] table = new Class_Table[2]; table[0] = new Class_Table(); table[0].Sql = sqlSel; table[0].Tablename = "sqlSel"; table[1] = new Class_Table(); table[1].Sql = sqlCount; table[1].Tablename = "sqlCount"; DS_QUALITYTABLE = App.GetDataSet(table); DataSet dataSet = DS_QUALITYTABLE; Class_Record_Monitor_View[] crmv = null; if (dataSet.Tables[0].Rows.Count > 0) { crmv = new Class_Record_Monitor_View[dataSet.Tables[0].Rows.Count]; } else { return; } if (dataSet.Tables["sqlSel"] != null) { Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlSel"].Rows.Count]; //using (Graphics gh = Graphics.FromHwnd(GbxMontior.Handle)) //{ string section_name = string.Empty; int no = 0; bool isLine = false; for (int j = 0; j < dataSet.Tables["sqlSel"].Rows.Count; j++) { crmv1[j] = new Class_Record_Monitor_View(); crmv1[j].SickArea_ID = dataSet.Tables["sqlSel"].Rows[j]["SECTION_ID"].ToString(); crmv1[j].SickArea_Name = dataSet.Tables["sqlSel"].Rows[j]["SECTION_NAME"].ToString(); crmv1[j].DocType = dataSet.Tables["sqlSel"].Rows[j]["DOCTYPE"].ToString(); crmv1[j].Num = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["NUM"].ToString()); crmv1[j].PV = Convert.ToInt32(dataSet.Tables["sqlSel"].Rows[j]["PV"].ToString()); if (crmv1[j].DocType == "体温单" || crmv1[j].DocType == "体温单其他") //'体温单','体温单其他' { //找出所有对应的规则id crmv1[j].DocTypeID = App.ReadSqlVal("select wm_concat(tqv.id) id from t_quality_var_hlb tqv inner join t_data_code ta on tqv.document_type=ta.id where ta.name='" + crmv1[j].DocType + "'", 0, "id"); } int onePv = crmv1[j].PV; int oneNum = crmv1[j].Num; string text = crmv1[j].DocType; //取反条件 int intPv = onePv == 1 ? 0 : 1; string swithcs = "SECTION_ID='" + crmv1[j].SickArea_ID + "' and DOCTYPE='" + crmv1[j].DocType + "' and PV='" + intPv + "'"; DataRow[] rows = dataSet.Tables["sqlSel"].Select(swithcs); int otherPv = 0; int otherNum = 0; UserControl uc; if (rows.Length > 0) //相同的文书 { otherNum = Convert.ToInt32(rows[0]["NUM"].ToString()); otherPv = Convert.ToInt32(rows[0]["PV"].ToString()); dataSet.Tables["sqlSel"].Rows.Remove(rows[0]); Image red = img.Images[0]; Image yellow = img.Images[1]; if (onePv == 0)//黄灯 { uc = new UcMerger(text, oneNum, yellow, otherNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } else { uc = new UcMerger(text, otherNum, yellow, oneNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } } else { Image image; if (onePv == 3) { image = img.Images[3]; //补录 } else if (onePv == 0) //黄灯 { image = img.Images[1]; } else { image = img.Images[0]; } uc = new UcLight(text, oneNum, image, flag); //uc = new PbLight(text, oneNum, img); } uc.Tag = crmv1[j]; if (section_name != crmv1[j].SickArea_Name) { if (!string.IsNullOrEmpty(crmv1[j].SickArea_Name)) { section_name = crmv1[j].SickArea_Name; Label lbl = new Label(); //lbl.AutoSize = true; no++; lbl.Text = no.ToString() + "." + section_name; lbl.Width = 120; lbl.ForeColor = Color.Blue; GbxMontior.Controls.Add(lbl); //AddUcontrol(GbxMontior, uc, section_name); } } else { //AddUcontrol(GbxMontior, uc); } GbxMontior.Controls.Add(uc); } //} } GbxMontior.Refresh(); if (dataSet.Tables["sqlCount"] != null) { Class_Record_Monitor_View[] crmv1 = new Class_Record_Monitor_View[dataSet.Tables["sqlCount"].Rows.Count]; for (int i = 0; i < dataSet.Tables["sqlCount"].Rows.Count; i++) { crmv1[i] = new Class_Record_Monitor_View(); crmv1[i].DocType = dataSet.Tables["sqlCount"].Rows[i]["DOCTYPE"].ToString(); crmv1[i].Num = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["NUM"].ToString()); crmv1[i].PV = Convert.ToInt32(dataSet.Tables["sqlCount"].Rows[i]["PV"].ToString()); if (comboxSA.Text != "" && !comboxSA.Text.Contains("请选择")) { crmv1[i].SickArea_ID = comboxSA.SelectedValue == null ? "" : comboxSA.SelectedValue.ToString(); crmv1[i].SickArea_Name = comboxSA.Text; } if (crmv1[i].DocType == "体温单" || crmv1[i].DocType == "体温单其他") //'体温单','体温单其他' { //找出所有对应的规则id crmv1[i].DocTypeID = App.ReadSqlVal("select wm_concat(tqv.id) id from t_quality_var_hlb tqv inner join t_data_code ta on tqv.document_type=ta.id where ta.name='" + crmv1[i].DocType + "'", 0, "id"); } int onePv = crmv1[i].PV; int oneNum = crmv1[i].Num; string text = crmv1[i].DocType; //取反条件 int intPv = onePv == 1 ? 0 : 1; string swithcs = " DOCTYPE='" + crmv1[i].DocType + "' and PV='" + intPv + "'"; DataRow[] rows = dataSet.Tables["sqlCount"].Select(swithcs); int otherPv = 0; int otherNum = 0; UserControl uc; if (rows.Length > 0) //相同的文书 { otherNum = Convert.ToInt32(rows[0]["NUM"].ToString()); otherPv = Convert.ToInt32(rows[0]["PV"].ToString()); dataSet.Tables["sqlCount"].Rows.Remove(rows[0]); Image red = img.Images[0]; Image yellow = img.Images[1]; if (onePv == 0)//黄灯 { uc = new UcMerger(text, oneNum, yellow, otherNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } else { uc = new UcMerger(text, otherNum, yellow, oneNum, red, flag); //uc = new PbMerger(text, oneNum, yellow, otherNum, red); } } else { Image image; if (onePv == 3)//补录 { image = img.Images[3]; } else if (onePv == 0)//黄灯 { image = img.Images[1]; } else { image = img.Images[0]; } uc = new UcLight(text, oneNum, image, flag); //uc = new PbLight(text, oneNum, img); } uc.Tag = crmv1[i]; pCount.Controls.Add(uc); } } pCount.Refresh(); }