private void Bind_dataGridView1Cell0() { DateTime date1 = Convert.ToDateTime(dateTimePicker1.Value.ToString("yyyy-MM-dd 0:00")); DateTime date2 = Convert.ToDateTime(dateTimePicker2.Value.ToString("yyyy-MM-dd 23:59")); dataGridView1.Rows.Clear(); DataTable dt = _DataDicDal.GetAll_hushi();//护士 DataTable dt1 = _OperStatisticsDal.GetAllMZLbyTime(date1, date2); int SumAll = Convert.ToInt32(dt1.Rows[0][0].ToString()); if (SumAll != 0) { dataGridView1.Rows.Add(dt.Rows.Count); for (int i = 0; i < dt.Rows.Count; i++) { dataGridView1.Rows[i].Cells[0].Value = dt.Rows[i][0].ToString(); } for (int i = 0; i < dataGridView1.Rows.Count; i++) { string ysName = dataGridView1.Rows[i].Cells[0].Value.ToString(); DataTable dt2 = _OperStatisticsDal.GetHSMZLbyTime(SumAll, date1, date2, ysName); if (dt2.Rows[0][0] == null) { dataGridView1.Rows[i].Cells[1].Value = 0; } if (dt2.Rows[0][1] == null) { dataGridView1.Rows[i].Cells[2].Value = 0; } if (dt2.Rows[0][2] == null) { dataGridView1.Rows[i].Cells[5].Value = 0; } if (dt2.Rows[0][3] == null) { dataGridView1.Rows[i].Cells[3].Value = 0; } if (dt2.Rows[0][4] == null) { dataGridView1.Rows[i].Cells[4].Value = 0; } dataGridView1.Rows[i].Cells[1].Value = dt2.Rows[0][0].ToString(); dataGridView1.Rows[i].Cells[2].Value = dt2.Rows[0][1].ToString(); dataGridView1.Rows[i].Cells[5].Value = dt2.Rows[0][2].ToString(); dataGridView1.Rows[i].Cells[3].Value = dt2.Rows[0][3].ToString(); dataGridView1.Rows[i].Cells[4].Value = dt2.Rows[0][4].ToString(); } } else { MessageBox.Show("当前时间段没有数据!!"); } }
private void BindCombox3() { cmbQXHS.Items.Clear(); cmbXHHS.Items.Clear(); DataTable dt = new DataTable(); dt = _DataDicDal.GetAll_hushi(); for (int i = 0; i < dt.Rows.Count; i++) { cmbQXHS.Items.Add(dt.Rows[i][0]); cmbXHHS.Items.Add(dt.Rows[i][0]); } }
/// <summary> /// 窗体加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PACU_TJ_Load(object sender, EventArgs e) { //this.FormBorderStyle = FormBorderStyle.None; //this.TransparencyKey = this.BackColor; this.WindowState = FormWindowState.Maximized; int month = DateTime.Now.Month; int year = DateTime.Now.Year; //初始化年第一天 dateTimePicker1.Text = year + "/1/1"; //初始化月份第一天 dateTimePicker1.Text = year + "/" + month + "/1"; //string sqlWhere = " 1=1 "; //System.Data.DataTable dt = adimsController.GetMzjldList(sqlWhere); BindDataGridView(); DataTable dt0 = _DataDicDal.GetAllMZYS(); if (dt0.Rows.Count > 0) { for (int i = 0; i < dt0.Rows.Count; i++) { treeView1.Nodes[0].Nodes.Add(dt0.Rows[i][0].ToString()); } } DataTable dt1 = new DataTable(); dt1 = _DataDicDal.GetOroom(); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { treeView1.Nodes[1].Nodes.Add(dt1.Rows[i][0].ToString()); } } DataTable dt2 = _DataDicDal.GetKeshi(); if (dt2.Rows.Count > 0) { for (int i = 0; i < dt2.Rows.Count; i++) { treeView1.Nodes[2].Nodes.Add(dt2.Rows[i][0].ToString()); } } List <string> list = new List <string>(); list.Add("Ⅰ"); list.Add("Ⅱ"); list.Add("Ⅲ"); list.Add("Ⅳ"); list.Add("Ⅴ"); //DataTable dt3 = opr.GetKShiname(); if (list.Count > 0) { for (int i = 0; i < list.Count; i++) { treeView1.Nodes[3].Nodes.Add(list[i].ToString()); } } DataTable dt4 = _DataDicDal.GetMazuiFangfaAll(); if (dt4.Rows.Count > 0) { for (int i = 0; i < dt4.Rows.Count; i++) { treeView1.Nodes[4].Nodes.Add(dt4.Rows[i][0].ToString()); } } List <string> list5 = new List <string>(); list5.Add("优"); list5.Add("良"); list5.Add("差"); if (list5.Count > 0) { for (int i = 0; i < list5.Count; i++) { treeView1.Nodes[5].Nodes.Add(list5[i].ToString()); } } DataTable dt6 = _DataDicDal.GetAll_hushi(); if (dt6.Rows.Count > 0) { for (int i = 0; i < dt6.Rows.Count; i++) { treeView1.Nodes[6].Nodes.Add(dt6.Rows[i][0].ToString()); } } DataTable dt7 = _DataDicDal.GetAllSSJB(); if (dt7.Rows.Count > 0) { for (int i = 0; i < dt7.Rows.Count; i++) { treeView1.Nodes[7].Nodes.Add(dt7.Rows[i][0].ToString()); } } DataTable dt8 = _DataDicDal.GetAllFXPG(); if (dt8.Rows.Count > 0) { for (int i = 0; i < dt8.Rows.Count; i++) { treeView1.Nodes[8].Nodes.Add(dt8.Rows[i][0].ToString()); } } DataTable dt9 = _DataDicDal.GetAllSSYS(); if (dt9.Rows.Count > 0) { for (int i = 0; i < dt9.Rows.Count; i++) { treeView1.Nodes[9].Nodes.Add(dt9.Rows[i][0].ToString()); } } DataTable dt10 = _DataDicDal.GetAllSF(); if (dt10.Rows.Count > 0) { for (int i = 0; i < dt10.Rows.Count; i++) { treeView1.Nodes[10].Nodes.Add(dt10.Rows[i][0].ToString()); } } DataTable dt11 = _DataDicDal.GetAllSSLB(); if (dt11.Rows.Count > 0) { for (int i = 0; i < dt11.Rows.Count; i++) { treeView1.Nodes[11].Nodes.Add(dt11.Rows[i][0].ToString()); } } }