using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using SOH.Kernel; using EAS.Services; using SOH.BLL; using SOH.Entities; using SOH.Data; using SOH.Common; using System.Text.RegularExpressions; namespace SOH.KeFu { [ModuleAttribute(ModuleID = "7DAEBA08-2857-4DA9-A201-3D0ECDC19670", ModuleName = "体检结果分析")] public partial class frmTiJianJieGuoFenXi : SOH.Window.baseChildForm { private DataTable dtTj; private DataTable dtGj; public frmTiJianJieGuoFenXi() { InitializeComponent(); } public void frmTiJianJieGuoFenXi_Load(object sender, EventArgs e) { GetAllDfxList(); } public void GetAllDfxList() { string yydmstr = LoginUser.yydm; //当前医院代码-分店 short yydm = 0; short.TryParse(yydmstr, out yydm); string czyxm = LoginUser.xm; int numpeople = 0; var vservice = ServiceContainer.GetService(); String dataTj = vservice.GetTjDfxList(yydm); dtTj = Newtonsoft.Json.JsonConvert.DeserializeObject(dataTj, typeof(DataTable)) as DataTable; String dataGj = vservice.GetGjDfxList(yydm); dtGj = Newtonsoft.Json.JsonConvert.DeserializeObject(dataGj, typeof(DataTable)) as DataTable; dtTj.Merge(dtGj); iDataBindBindingSource.DataSource = dtTj; //dgvAll.DataSource = iDataBindBindingSource.DataSource; numpeople = dtTj.Rows.Count; this.labRs.Text = numpeople.ToString(); this.labxm.Text = czyxm; } private void button2_Click(object sender, EventArgs e) { if (dgvAll.CurrentRow.Index < 0) { return; } DataRowView o = dgvAll.Rows[dgvAll.CurrentRow.Index].DataBoundItem as DataRowView; //frmTiJanFenXiLuRu cz = new frmTiJanFenXiLuRu(o, this); frmTiJanFenXiLuRuNew cz = new frmTiJanFenXiLuRuNew(o, this); cz.ShowDialog(); } private void txtFind_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (dgvAll.Rows.Count != 0) { string tmh = this.txtFind.Text; int index = iDataBindBindingSource.Find("tm", tmh); if (index != -1) { this.iDataBindBindingSource.Position = index;//定位BindingSource //this.dgvAll.Rows[index].Selected = true; //dgvAll.CurrentCell = this.dgvAll[0, index]; } } } } private void button3_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { GetAllDfxList(); } private void dgvAll_RowPrePaint_1(object sender, DataGridViewRowPrePaintEventArgs e) { if (e.RowIndex < dgvAll.RowCount) { DataGridViewRow dgrSingle = dgvAll.Rows[e.RowIndex]; try { if (dgrSingle.Cells["tmztz"].Value.ToString().Contains("10")) { dgrSingle.DefaultCellStyle.BackColor = Color.LightGreen; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } }