private void button1_Click(object sender, EventArgs e) { List <zhuyuan> zhu = new IdCard_BLL().p_zhuyuan_Select(); List <SectionRoom> se = new UsersBLL().Section(); txtID2.Text = ""; txtmingzi2.Text = ""; txtyujiao2.Text = ""; foreach (Control item in groupBox4.Controls) { if (item is TextBox) { item.Text = ""; } } foreach (Control item in groupBox3.Controls) { item.Enabled = false; } try { if (textBox1.Text == "") { PromptingForm p = new PromptingForm("请输入卡号!"); p.ShowDialog(); return; } if (zhu.Where(p => p.kId == int.Parse(textBox1.Text)).Count() == 0) { PromptingForm p = new PromptingForm("没有数据!"); p.ShowDialog(); return; } foreach (var z in zhu.Where(p => p.kId == int.Parse(textBox1.Text))) { txtId.Text = z.kId + ""; txtmingzi.Text = z.Kname; txtkeshi.Text = (se[z.Sid].Sname); txttime.Text = (z.Ztime + ""); txtyujiao.Text = (z.Imprest + ""); } List <zhuyuanxiaofei> xfs = new IdCard_BLL().p_zhuyuanxiaofei_select(int.Parse(txtId.Text)); int i = 0; foreach (zhuyuanxiaofei xf in xfs) { List <Drug_insert> di = new Drug_insert_BLL().SelectAll(xf.yaoName); i = i + int.Parse(xf.yaonum + "") * int.Parse(di[0].DsellPrice + ""); } txtyiyong.Text = i + ""; txtshengyu.Text = int.Parse(txtyujiao.Text) - int.Parse(txtyiyong.Text) + ""; } catch { PromptingForm p = new PromptingForm("病人编号只能是数字!"); p.ShowDialog(); } }
private void ListView1_SelectionChanged(object sender, SelectionChangedEventArgs e) { List <Bed> Bed = new IdCard_BLL().Bed_select(); string str = listView1.Items[listView1.SelectedIndex].ToString(); string[] ss = str.Split(','); for (int i = 0; i < listView1.Items.Count; i++) { //判断此行是否被选中 if (listView1.SelectedItems.Count > 0) { var result = Bed.Where(p => p.Idsickroom == int.Parse(ss[0].Substring(4).Replace("=", "").Trim())); listView2.Items.Clear(); foreach (var s in result) { listView2.Items.Add(new { c1 = s.Idsickroom, c2 = s.Idbed, c3 = s.KId, c4 = s.State }); } } } }
private void cboSectionRoom_SelectedIndexChanged(object sender, EventArgs e) { us = new IdCard_BLL().p_users_select01(); cboDoctor.Items.Clear(); cboDoctor.Text = ""; foreach (Users q in us.Where(p => p.SectionRoom == cboSectionRoom.Text))//)) { cboDoctor.Items.Add(q.name); } //txtGuaHaoFei.Text = se[cboSectionRoom.SelectedIndex].Sprice + ""; }
private void lvwzhuyuan_SelectedIndexChanged(object sender, EventArgs e) { int date = 0; lvwselect.Items.Clear(); if (lvwzhuyuan.SelectedItems.Count > 0) { ListViewItem item = lvwzhuyuan.SelectedItems[0]; txtId.Text = item.SubItems[0].Text; textBox4.Text = item.SubItems[3].Text; textBox4.Tag = item.SubItems[4].Text; txtkeshi.Text = item.SubItems[2].Text; dTime.Value = DateTime.Parse(item.SubItems[8].Text); // date = int.Parse((dateTimePicker1.Value - dTime.Value + "").Substring(0, 1)); txtmingzi.Text = item.SubItems[1].Text; txtyujiao.Text = item.SubItems[5].Text; } List <sickroom> ssic = new IdCard_BLL().sickroom_select(); foreach (sickroom item in ssic.Where(p => p.Idsickroom == int.Parse(textBox4.Text))) { txtyiyong.Text = item.Price * (date + 1) + ""; } List <zhuyuanxiaofei> xfs = new IdCard_BLL().p_zhuyuanxiaofei_select(int.Parse(txtId.Text)); foreach (zhuyuanxiaofei xf in xfs) { List <Drug_insert> di = new Drug_insert_BLL().SelectAll(xf.yaoName); int i = 0; ListViewItem item = new ListViewItem(di[i].Dname + ""); item.SubItems.Add(di[i].Dtype + ""); item.SubItems.Add(di[i].DcostName + ""); item.SubItems.Add(xf.yaonum + ""); item.SubItems.Add(di[i].Dspec + ""); item.SubItems.Add(di[i].DjiXing + ""); item.SubItems.Add(di[i].DsellPrice + ""); item.SubItems.Add(di[i].DeffectTime + ""); item.SubItems.Add(di[i].DproductTime + ""); item.SubItems.Add(di[i].Efficay + ""); lvwselect.Items.Add(item); i++; } int num = 0; foreach (ListViewItem item in lvwselect.Items) { num += int.Parse(item.SubItems[6].Text); } textBox3.Text = num + ""; textBox2.Text = int.Parse(txtyiyong.Text) + int.Parse(textBox3.Text) - int.Parse(txtyujiao.Text) + ""; }
private void cbobingfang_SelectedIndexChanged(object sender, EventArgs e) { cbobingchuang.Items.Clear(); txtyujiaofei.Text = ""; List <bed> Bed = new IdCard_BLL().Bed_select(); if (cbobingfang.Text != "") { foreach (var item in Bed.Where(p => p.Idsickroom == int.Parse(cbobingfang.Text))) { if (item.State == "空") { cbobingchuang.Items.Add(item.Idbed); } } } }
//下拉框选中项改变 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox cb = e.Source as ComboBox; string txt = cb.Tag.ToString(); switch (txt) { case "科别": txtyujiaofei.Text = ""; foreach (var item in ssic.Where(p => p.Sid == cboKebie.SelectedIndex)) { cbobingfang.Items.Add(item.Idsickroom); } break; case "病房号": txtyujiaofei.Text = ""; List <Bed> Bed = new IdCard_BLL().Bed_select(); if (cbobingfang.Text != "") { foreach (var item in Bed.Where(p => p.Idsickroom == int.Parse(cbobingfang.Text))) { if (item.State == "空") { cbobingchuang.Items.Add(item.Idbed); } } } break; case "病床号": foreach (var item in ssic.Where(p => p.Idsickroom == int.Parse(cbobingfang.Text))) { txtyujiaofei.Text = item.Price + ""; } break; } }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { List <bed> Bed = new IdCard_BLL().Bed_select(); for (int i = 0; i < listView1.Items.Count; i++) { //判断此行是否被选中 if (listView1.Items[i].Selected) { var result = Bed.Where(p => p.Idsickroom == int.Parse(listView1.Items[i].SubItems[0].Text)); listView2.Items.Clear(); foreach (var s in result) { ListViewItem item = new ListViewItem(s.Idsickroom + ""); item.SubItems.Add(s.Idbed + ""); item.SubItems.Add(s.KId + ""); item.SubItems.Add(s.State + ""); if (s.State == "空") { item.ImageIndex = 0; } else if (s.State == "占用") { item.ImageIndex = 2; } else { item.ImageIndex = 1; } listView2.Items.Add(item); } // == int.Parse (listView1.Items[i].SubItems[0].Text)>; } } }
private void Button1_Click(object sender, RoutedEventArgs e) { List <zhuyuan> zhu = new IdCard_BLL().p_zhuyuan_Select(); List <SectionRoom> se = new UsersBLL().Section(); txtId2.Text = ""; txtname2.Text = ""; txtyujiao2.Text = ""; List <Control> conList2 = new List <Control>() { txtId, txtkeshi, txttime, txtname, txtshengyu, txtyujiao, txtyiyong }; List <Control> conList3 = new List <Control>() { txtname2, txtId2, txtyujiao2 }; foreach (Control item in conList2) { if (item is TextBox) { ((TextBox)item).Text = ""; } } foreach (Control item in conList3) { item.IsEnabled = false; } try { if (textBox1.Text == "") { var p = new Tip("请输入卡号!"); p.ShowDialog(); return; } if (zhu.Where(p => p.kId == int.Parse(textBox1.Text)).Count() == 0) { var p = new Tip("没有数据!"); p.ShowDialog(); return; } foreach (var z in zhu.Where(p => p.kId == int.Parse(textBox1.Text))) { txtId.Text = z.kId + ""; txtname.Text = z.Kname; txtkeshi.Text = (se[z.Sid].Sname); txttime.Text = (z.Ztime + ""); txtyujiao.Text = (z.Imprest + ""); } List <zhuyuanxiaofei> xfs = new IdCard_BLL().p_zhuyuanxiaofei_select(int.Parse(txtId.Text)); int i = 0; foreach (zhuyuanxiaofei xf in xfs) { List <Drug_insert> di = new Drug_insert_BLL().SelectAll(xf.yaoName); i = i + int.Parse(xf.yaonum + "") * int.Parse(di[0].DsellPrice + ""); } txtyiyong.Text = i + ""; txtshengyu.Text = int.Parse(txtyujiao.Text) - int.Parse(txtyiyong.Text) + ""; } catch { var p = new Tip("病人编号只能是数字!"); p.ShowDialog(); } }
private void ListView1_SelectionChanged(object sender, SelectionChangedEventArgs e) { int date = 0; listView2.Items.Clear(); if (listView1.SelectedItems.Count > 0) { string s = listView1.Items[listView1.SelectedIndex].ToString(); string[] ss = s.Split(','); txtId.Text = ss[0].Substring(4).Replace("=", "").Trim(); textBox4.Text = ss[3].Substring(3).Replace("=", "").Trim(); textBox4.Tag = ss[4].Substring(4).Replace("=", "").Replace("}", "").Trim(); txtkeshi.Text = ss[2].Substring(3).Replace("=", "").Trim(); dpTime1.Text = ss[8].Substring(3).Replace("=", "").Replace("}", "").Trim(); txtmingzi.Text = ss[1].Substring(3).Replace("=", "").Trim(); txtyujiao.Text = ss[5].Substring(3).Replace("=", "").Trim(); //计算两个日期间隔的天数 //DateTime st = Convert.ToDateTime(dpTime1.Text); //DateTime et = Convert.ToDateTime(dpTime2.Text); //TimeSpan span = et - st; //date = span.Days; } List <Sickroom> ssic = new IdCard_BLL().sickroom_select(); foreach (Sickroom item in ssic.Where(p => p.Idsickroom == int.Parse(textBox4.Text))) { txtyiyong.Text = item.Price * (date + 1) + ""; } List <zhuyuanxiaofei> xfs = new IdCard_BLL().p_zhuyuanxiaofei_select(int.Parse(txtId.Text)); foreach (zhuyuanxiaofei xf in xfs) { List <Drug_insert> di = new Drug_insert_BLL().SelectAll(xf.yaoName); int i = 0; listView2.Items.Add(new { c1 = di[i].Dname, c2 = di[i].Dtype, c3 = di[i].DcostName, c4 = xf.yaonum, c5 = di[i].Dspec, c6 = di[i].DjiXing, c7 = di[i].DsellPrice, c8 = di[i].DeffectTime, c9 = di[i].DproductTime, c10 = di[i].Efficay }); i++; } int num = 0; foreach (ListViewItem item in listView2.Items) { string s = listView2.Items[listView2.SelectedIndex].ToString(); string[] ss = s.Split(','); num += int.Parse(ss[6].Substring(3).Replace("=", "").Trim()); } textBox3.Text = num + ""; textBox2.Text = int.Parse(txtyiyong.Text) + int.Parse(textBox3.Text) - int.Parse(txtyujiao.Text) + ""; }