private void AutocompleteKieuKham() { DataTable dtStaff = new DataTable(); try { dtStaff = new Select(SysUser.Columns.PkSuid, string.Format("({0} + isnull(' - ' + {1},'')) as Staff_Name", SysUser.Columns.PkSuid, SysUser.Columns.SFullName)).From(SysUser.Schema).ExecuteDataSet().Tables[0]; if (dtStaff == null) return; if (!dtStaff.Columns.Contains("ShortCut")) dtStaff.Columns.Add(new DataColumn("ShortCut", typeof(string))); foreach (DataRow dr in dtStaff.Rows) { string shortcut = ""; string realName = dr["Staff_Name"].ToString().Trim() + " " + Utility.Bodau(dr["Staff_Name"].ToString().Trim()); shortcut = dr[SysUser.Columns.PkSuid].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } } catch { } finally { var source = new List<string>(); var query = from p in dtStaff.AsEnumerable() select p[SysUser.Columns.PkSuid].ToString() + "#" + p[SysUser.Columns.PkSuid].ToString() + "@" + p["Staff_Name"].ToString() + "@" + p.Field<string>("shortcut").ToString(); source = query.ToList(); this.txtNhanvien.AutoCompleteList = source; this.txtNhanvien.TextAlign = HorizontalAlignment.Center; this.txtNhanvien.CaseSensitive = false; this.txtNhanvien.MinTypedCharacters = 1; } }
private void AutocompleteBenhvien() { DataTable m_dtBenhvien = new Select().From(DmucBenhvien.Schema).ExecuteDataSet().Tables[0]; try { if (m_dtBenhvien == null) return; if (!m_dtBenhvien.Columns.Contains("ShortCut")) m_dtBenhvien.Columns.Add(new DataColumn("ShortCut", typeof(string))); foreach (DataRow dr in m_dtBenhvien.Rows) { string shortcut = ""; string realName = dr[DmucBenhvien.Columns.TenBenhvien].ToString().Trim() + " " + Utility.Bodau(dr[DmucBenhvien.Columns.TenBenhvien].ToString().Trim()); shortcut = dr[DmucBenhvien.Columns.MaBenhvien].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } var source = new List<string>(); var query = from p in m_dtBenhvien.AsEnumerable() select p[DmucBenhvien.Columns.IdBenhvien].ToString() + "#" + p[DmucBenhvien.Columns.MaBenhvien].ToString() + "@" + p[DmucBenhvien.Columns.TenBenhvien].ToString() + "@" + p["shortcut"].ToString(); source = query.ToList(); this.txtNoichuyenden.AutoCompleteList = source; this.txtNoichuyenden.TextAlign = HorizontalAlignment.Left; this.txtNoichuyenden.CaseSensitive = false; this.txtNoichuyenden.MinTypedCharacters = 1; } catch (Exception ex) { Utility.CatchException(ex); } finally { } }
private void AutocompleteDautheBHYT() { try { return; DataTable dt_dataDoituongBHYT = new Select().From(DmucDoituongbhyt.Schema).ExecuteDataSet().Tables[0]; if (!dt_dataDoituongBHYT.Columns.Contains("ShortCut")) dt_dataDoituongBHYT.Columns.Add(new DataColumn("ShortCut", typeof(string))); foreach (DataRow dr in dt_dataDoituongBHYT.Rows) { string shortcut = ""; string realName = dr[DmucDoituongbhyt.TenDoituongbhytColumn.ColumnName].ToString().Trim() + " " + Utility.Bodau(dr[DmucDoituongbhyt.TenDoituongbhytColumn.ColumnName].ToString().Trim()); shortcut = dr[DmucDoituongbhyt.MaDoituongbhytColumn.ColumnName].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } var source = new List<string>(); var query = from p in dt_dataDoituongBHYT.AsEnumerable() select p[DmucDoituongbhyt.IdDoituongbhytColumn.ColumnName].ToString()+"#" + p[DmucDoituongbhyt.MaDoituongbhytColumn.ColumnName].ToString() + "@" +p[DmucDoituongbhyt.MaDoituongbhytColumn.ColumnName].ToString()+"-"+ p[DmucDoituongbhyt.TenDoituongbhytColumn.ColumnName].ToString() + "@" + p.Field<string>("shortcut").ToString(); source = query.ToList<string>(); this.txtMaDtuong_BHYT2.AutoCompleteList = source; this.txtMaDtuong_BHYT2.TextAlign = HorizontalAlignment.Center; this.txtMaDtuong_BHYT2.CaseSensitive = false; this.txtMaDtuong_BHYT2.MinTypedCharacters = 1; } catch { } finally { } }
private void AutocompleteLoaithuoc() { DataTable dtLoaithuoc = null; try { dtLoaithuoc = new Select().From(DmucLoaithuoc.Schema).Where(DmucLoaithuoc.KieuThuocvattuColumn).IsEqualTo(KIEU_THUOC_VT).ExecuteDataSet().Tables[0]; if (dtLoaithuoc == null) return; if (!dtLoaithuoc.Columns.Contains("ShortCut")) dtLoaithuoc.Columns.Add(new DataColumn("ShortCut", typeof(string))); foreach (DataRow dr in dtLoaithuoc.Rows) { string shortcut = ""; string realName = dr[DmucLoaithuoc.TenLoaithuocColumn.ColumnName].ToString().Trim() + " " + Utility.Bodau(dr[DmucLoaithuoc.TenLoaithuocColumn.ColumnName].ToString().Trim()); shortcut = dr[DmucLoaithuoc.MaLoaithuocColumn.ColumnName].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } } catch { } finally { var source = new List<string>(); var query = from p in dtLoaithuoc.AsEnumerable() select p[DmucLoaithuoc.IdLoaithuocColumn.ColumnName].ToString() + "#" + p[DmucLoaithuoc.MaLoaithuocColumn.ColumnName].ToString() + "@" + p[DmucLoaithuoc.TenLoaithuocColumn.ColumnName].ToString() + "@" + p.Field<string>("shortcut").ToString(); source = query.ToList(); this.txtLoaithuoc.AutoCompleteList = source; this.txtLoaithuoc.TextAlign = HorizontalAlignment.Left; this.txtLoaithuoc.CaseSensitive = false; this.txtLoaithuoc.MinTypedCharacters = 1; } }
private void AutocompleteThanhpho() { DataTable m_dtThanhpho = new Select().From(DmucDiachinh.Schema).Where(DmucDiachinh.Columns.LoaiDiachinh).IsEqualTo(0).ExecuteDataSet().Tables[0]; try { if (m_dtThanhpho == null) return; if (!m_dtThanhpho.Columns.Contains("ShortCut")) m_dtThanhpho.Columns.Add(new DataColumn("ShortCut", typeof(string))); foreach (DataRow dr in m_dtThanhpho.Rows) { string shortcut = ""; string realName = dr[DmucDiachinh.Columns.TenDiachinh].ToString().Trim() + " " + Utility.Bodau(dr[DmucDiachinh.Columns.TenDiachinh].ToString().Trim()); shortcut = dr[DmucDiachinh.Columns.MaDiachinh].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } } catch { } finally { var source = new List<string>(); var query = from p in m_dtThanhpho.AsEnumerable() select p.Field<Int16>(DmucDiachinh.Columns.MaDiachinh).ToString() + "#" + p.Field<string>(DmucDiachinh.Columns.MaDiachinh).ToString() + "@" + p.Field<string>(DmucDiachinh.Columns.TenDiachinh).ToString() + "@" + p.Field<string>("shortcut").ToString(); source = query.ToList(); this.txtThanhpho.AutoCompleteList = source; this.txtThanhpho.TextAlign = HorizontalAlignment.Left; this.txtThanhpho.CaseSensitive = false; this.txtThanhpho.MinTypedCharacters = 1; } }
private void LoadQuanHeNhanVienQuyen() { QheNhanvienQuyensudungCollection LstQheNhanvienQuyensudung = new Select().From(QheNhanvienQuyensudung.Schema) .Where(QheNhanvienQuyensudung.Columns.IdNhanvien).IsEqualTo(Utility.Int32Dbnull(txtID.Text)). ExecuteAsCollection<QheNhanvienQuyensudungCollection>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdQuyen.GetDataRows()) { gridExRow.BeginEdit(); var query = from kho in LstQheNhanvienQuyensudung.AsEnumerable() where kho.Ma == Utility.sDbnull(gridExRow.Cells[QheNhanvienQuyensudung.Columns.Ma].Value) select kho; if (query.Count() > 0) { gridExRow.IsChecked = true; } else { gridExRow.IsChecked = false; } gridExRow.EndEdit(); } }
private void LoadQuanHeNhanVienKho() { QheNhanvienKhoCollection objNhanvienKhoCollection = new Select().From(QheNhanvienKho.Schema) .Where(QheNhanvienKho.Columns.IdNhanvien).IsEqualTo(Utility.Int32Dbnull(txtID.Text)). ExecuteAsCollection<QheNhanvienKhoCollection>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdKhoThuoc.GetDataRows()) { gridExRow.BeginEdit(); var query = from kho in objNhanvienKhoCollection.AsEnumerable() where kho.IdKho == Utility.Int32Dbnull(gridExRow.Cells[TDmucKho.Columns.IdKho].Value) select kho; if (query.Count() > 0) { gridExRow.Cells["IsChon"].Value = 1; gridExRow.IsChecked = true; } else { gridExRow.Cells["IsChon"].Value = 0; gridExRow.IsChecked = false; } gridExRow.EndEdit(); } }
private void LoadQheLoaithuoc() { QheNhanvienDanhmucCollection lstQhenhanviendanhmucthuoc = new Select().From(QheNhanvienDanhmuc.Schema) .Where(QheNhanvienDanhmuc.Columns.IdNhanvien).IsEqualTo(Utility.Int32Dbnull(txtID.Text)) .And(QheNhanvienDanhmuc.Columns.Loai).IsEqualTo(1) .ExecuteAsCollection<QheNhanvienDanhmucCollection>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdLoaiThuoc.GetDataRows()) { gridExRow.BeginEdit(); var query = from kho in lstQhenhanviendanhmucthuoc.AsEnumerable() where kho.IdDichvu == Utility.sDbnull(gridExRow.Cells[DmucLoaithuoc.Columns.IdLoaithuoc].Value) select kho; if (query.Count() > 0) { gridExRow.IsChecked = true; } else { gridExRow.IsChecked = false; } gridExRow.EndEdit(); } }
private void LoadQheBS_khoanoitru() { QheBacsiKhoaphongCollection lstQheBacsiKhoaphong = new Select().From(QheBacsiKhoaphong.Schema) .Where(QheBacsiKhoaphong.Columns.IdBacsi).IsEqualTo(Utility.Int32Dbnull(txtID.Text)) .And(QheBacsiKhoaphong.Columns.Noitru).IsEqualTo(1) .ExecuteAsCollection<QheBacsiKhoaphongCollection>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdKhoanoitru.GetDataRows()) { gridExRow.BeginEdit(); var query = from kho in lstQheBacsiKhoaphong.AsEnumerable() where kho.IdKhoa == Utility.Int32Dbnull(gridExRow.Cells[DmucKhoaphong.Columns.IdKhoaphong].Value) select kho; if (query.Count() > 0) { gridExRow.IsChecked = true; } else { gridExRow.IsChecked = false; } gridExRow.EndEdit(); } }
private void cboUserName_SelectedValueChanged(object sender, System.EventArgs e) { DataTable objNhanvien = new Select("*").From(SysUser.Schema).Where(SysUser.Columns.PkSuid).IsEqualTo( Utility.sDbnull(cboUserName.SelectedValue)).ExecuteDataSet().Tables[0]; if (objNhanvien != null && em_Action == action.Insert) { foreach (DataRow row in objNhanvien.AsEnumerable()) { txtName.Text = row["sFullName"].ToString(); txtStaffCode.Text = row["PK_sUID"].ToString(); txtKhoa.Text = row["sDepart"].ToString(); } } }
private void AutocompleICD10() { DataTable _dtMabenhICD10 = new Select(DmucBenh.Columns.IdBenh, DmucBenh.Columns.MaBenh, DmucBenh.Columns.TenBenh).From( DmucBenh.Schema).ExecuteDataSet().Tables[0]; txtMaBenhICD10.Init(_dtMabenhICD10, new List<string> {DmucBenh.Columns.IdBenh, DmucBenh.Columns.MaBenh, DmucBenh.Columns.TenBenh}); try { if (_dtMabenhICD10 == null) return; if (!_dtMabenhICD10.Columns.Contains("ShortCut")) _dtMabenhICD10.Columns.Add(new DataColumn("ShortCut", typeof (string))); foreach (DataRow dr in _dtMabenhICD10.Rows) { string shortcut = ""; string realName = dr[DmucBenh.Columns.TenBenh].ToString().Trim() + " " + Utility.Bodau(dr[DmucBenh.Columns.TenBenh].ToString().Trim()); shortcut = dr[DmucBenh.Columns.MaBenh].ToString().Trim(); string[] arrWords = realName.ToLower().Split(' '); string _space = ""; string _Nospace = ""; foreach (string word in arrWords) { if (word.Trim() != "") { _space += word + " "; //_Nospace += word; } } shortcut += _space; // +_Nospace; foreach (string word in arrWords) { if (word.Trim() != "") shortcut += word.Substring(0, 1); } dr["ShortCut"] = shortcut; } } catch (Exception ex) { if(globalVariables.IsAdmin) Utility.ShowMsg("Lỗi:" +ex.Message); } finally { var source = new List<string>(); EnumerableRowCollection<string> query = from p in _dtMabenhICD10.AsEnumerable() select p[DmucBenh.Columns.IdBenh] + "#" + Utility.sDbnull(p[DmucBenh.Columns.MaBenh], "") + "@" + p.Field<string>(DmucBenh.Columns.TenBenh) + "@" + p.Field<string>("shortcut"); source = query.ToList(); txtMaBenhICD10.AutoCompleteList = source; txtMaBenhICD10.TextAlign = HorizontalAlignment.Center; txtMaBenhICD10.CaseSensitive = false; txtMaBenhICD10.MinTypedCharacters = 1; } }
/// <summary> /// hàm thưucj hiện lấy thông tin của dữ liệu /// </summary> private void Getdata() { // objRoom = NoitruDmucBuong.FetchByID(Utility.Int32Dbnull(txtID.Text, -1)); //if (objRoom != null) //{ // txt_Mo_Ta.Text = Utility.sDbnull(objRoom.MotaThem, ""); // txt_STT_HTHI.Text = Utility.sDbnull(objRoom.SttHthi, 1); // txtTEN.Text = Utility.sDbnull(objRoom.Ten, "")b; //} if (m_enAct == action.Update) { chkcodefrom.Enabled = false; chkAutoupdate.Visible=lblSample.Visible = lblSuffix.Visible = false; if (objBed != null) { txtID.Text = Utility.sDbnull(objBed.IdGiuong); txtMa.Text = objBed.MaGiuong; txtTen_BHYT.Text = Utility.sDbnull(objBed.TenBhyt); txt_Mo_Ta.Text = Utility.sDbnull(objBed.MotaThem); txt_STT_HTHI.Text = Utility.sDbnull(objBed.SttHthi); txtTEN.Text = Utility.sDbnull(objBed.TenGiuong); txtSuChua.Text = Utility.sDbnull(objBed.SonguoiToida); txtDongia.Text = Utility.sDbnull(objBed.GiaDichvu); txtGiaBHYT.Text = Utility.sDbnull(objBed.GiaBhyt); txtGiakhac.Text = Utility.sDbnull(objBed.GiaKhac); txtPTDT.Text = Utility.sDbnull(objBed.PhuthuDungtuyen); txtPTTT.Text = Utility.sDbnull(objBed.PhuthuTraituyen); chktutuc.Checked = Utility.Byte2Bool(objBed.TthaiTunguyen); chkTrangThai.Checked = Utility.Int32Dbnull(objBed.TrangThai) == 1; if (Utility.Int32Dbnull(objBed.IdKhoanoitru) > 0) cboKhoaNoiTru.SelectedIndex = Utility.GetSelectedIndex(cboKhoaNoiTru, objBed.IdKhoanoitru.ToString()); txtBuong.SetId(Utility.Int32Dbnull(objBed.IdBuong,0)); txtDonvitinh.SetCode(objBed.MaDonvitinh); } } m_dtQuanHe = SPs.NoitruLaydulieuqheDoituongBuonggiuong(Utility.Int32Dbnull(txtID.Text)).GetDataSet().Tables[0]; Utility.SetDataSourceForDataGridEx(grdQuanheGiuong, m_dtQuanHe, false, true, "1=1", ""); NoitruQheDoituongBuonggiuongCollection roomBedObjectTypeCollection = new Select().From(NoitruQheDoituongBuonggiuong.Schema) .Where(NoitruQheDoituongBuonggiuong.Columns.IdGiuong).IsEqualTo(Utility.Int32Dbnull(objBed.IdGiuong)).ExecuteAsCollection <NoitruQheDoituongBuonggiuongCollection>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdQuanheGiuong.GetDataRows()) { var query = from giuong in roomBedObjectTypeCollection.AsEnumerable() where Utility.sDbnull(giuong.MaDoituongKcb) == Utility.sDbnull(gridExRow.Cells[NoitruQheDoituongBuonggiuong.Columns.MaDoituongKcb].Value) select giuong; if (query.Any()) { gridExRow.IsChecked = true; } else { gridExRow.IsChecked = false; } } if (roomBedObjectTypeCollection.Count() <= 0) grdQuanheGiuong.GetCheckedRows(); chkApDungGia.Checked = roomBedObjectTypeCollection.Count() > 0; // Utility.TryToSetBindData(dtNgayLapPhieu, "Text", objTreatment, }