private void load_dm() { ads = new DataSet(); ads.ReadXml("..//..//..//xml//m_bienbankienthaotuvong.xml"); dsbs = m.get_data("select * from medibv.dmbs order by ma"); listChutoa.DisplayMember = "MA"; listChutoa.ValueMember = "HOTEN"; listChutoa.DataSource = dsbs.Tables[0]; dticd = m.get_data("select cicd10,vviet from medibv.icd10 order by cicd10").Tables[0]; listICD.DisplayMember = "CICD10"; listICD.ValueMember = "VVIET"; listICD.DataSource = dticd; phai.DisplayMember = "TEN"; phai.ValueMember = "MA"; phai.DataSource = m.get_data("select * from medibv.dmphai").Tables[0]; nn.DisplayMember = "tennn"; nn.ValueMember = "mann"; nn.DataSource = m.get_data("select * from medibv.btdnn_bv order by mann").Tables[0]; ngay_VV = m.DateToString("dd/MM/yyyy HH:mm", DateTime.Now); ngayvv.Text = ngay_VV.Substring(0, 10); giovv.Text = ngay_VV.Substring(11); }
private void load_bhyt() { string so = m.sothe(1); string sql = ""; if (int.Parse(so.Substring(0, 2)) > 0 && v_ngayvv != "") { if (so.Substring(2, 1) == "1" && bDenngay_sothe) { sql = "select * from xxx.bhyt where mabn='" + v_mabn + "' and denngay>=to_timestamp('" + v_ngayvv + "','" + m.f_ngay + "') order by maql desc"; } else { sql = "select * from xxx.bhyt where mabn='" + v_mabn + "' order by maql desc"; } DataSet lds = m.get_data_nam_dec(v_nam, sql); if (lds != null && lds.Tables.Count > 0) { foreach (DataRow r in lds.Tables[0].Rows) { txtsothe.Text = r["sothe"].ToString(); if (bTungay && r["tungay"].ToString() != "") { txtTungay.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["tungay"].ToString())); } if (r["denngay"].ToString() != "") { txtDenngay.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["denngay"].ToString())); } if (bSothe_ngay_huong) { if (r["ngay1"].ToString() != "") { txtTungay1.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay1"].ToString())); } if (r["ngay2"].ToString() != "") { txtTungay2.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay2"].ToString())); } if (r["ngay3"].ToString() != "") { txtTungay3.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay3"].ToString())); } } break; } } if (txtsothe.Text == "") { if (so.Substring(2, 1) == "1" && bDenngay_sothe) { sql = "select * from " + m.user + ".bhyt where mabn='" + v_mabn + "' and denngay>=to_timestamp('" + v_ngayvv + "','" + m.f_ngay + "')" + " order by maql desc"; } else { sql = "select * from " + m.user + ".bhyt where mabn='" + v_mabn + "' order by maql desc"; } foreach (DataRow r in m.get_data(sql).Tables[0].Rows) { txtsothe.Text = r["sothe"].ToString(); if (bTungay && r["tungay"].ToString() != "") { txtTungay.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["tungay"].ToString())); } if (r["denngay"].ToString() != "") { txtDenngay.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["denngay"].ToString())); } if (bSothe_ngay_huong) { if (r["ngay1"].ToString() != "") { txtTungay1.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay1"].ToString())); } if (r["ngay2"].ToString() != "") { txtTungay2.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay2"].ToString())); } if (r["ngay3"].ToString() != "") { txtTungay3.Text = m.DateToString("dd/MM/yyyy", DateTime.Parse(r["ngay3"].ToString())); } } break; } } } else { txtTungay1.Text = txtTungay2.Text = txtTungay3.Text = txtsothe.Text = v_Denngay = v_Tungay = ""; } }