private void OnDisplayContractList() { lock (ThisLock) { Result result = CompanyContractBus.GetContractList(_name, _isMaHopDong); if (result.IsOK) { dgContract.Invoke(new MethodInvoker(delegate() { ClearData(); DataTable dt = result.QueryResult as DataTable; if (_dtTemp == null) { _dtTemp = dt.Clone(); } UpdateChecked(dt); dgContract.DataSource = dt; })); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetContractList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetContractList")); } } }
private void OnDisplayCheckList(DataRow patientRow) { ClearCheckList(); chkChecked.Checked = false; Result result = CompanyContractBus.GetCheckList(_hopDongGUID, patientRow["PatientGUID"].ToString()); if (result.IsOK) { DataTable dt = result.QueryResult as DataTable; dgService.DataSource = dt; foreach (DataGridViewRow row in dgService.Rows) { DataRow drRow = (row.DataBoundItem as DataRowView).Row; if (drRow["NguoiChuyenNhuong"] != null && drRow["NguoiChuyenNhuong"] != DBNull.Value && drRow["NguoiChuyenNhuong"].ToString().Trim() != string.Empty) { DataGridViewDisableCheckBoxCell cell = row.Cells["Using"] as DataGridViewDisableCheckBoxCell; cell.Enabled = false; } } OnTinhTongTienChecklist(patientRow); //btnLuu.Enabled = AllowEdit; } else { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList")); } }
private void OnDisplayDanhSachNhanVien() { lock (ThisLock) { Result result = CompanyContractBus.GetContractMemberList(_hopDongGUID, _name, _type, _doiTuong, _traHoSo); if (result.IsOK) { dgPatient.Invoke(new MethodInvoker(delegate() { ClearData(); DataTable dt = result.QueryResult as DataTable; if (_dtTemp == null) { _dtTemp = dt.Clone(); } dgPatient.DataSource = dt; UpdateChecked(dt); })); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetContractMemberList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetContractMemberList")); } } }
private void InitData() { //Service Result result = ServicesBus.GetServicesList(); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("ServicesBus.GetServicesList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("ServicesBus.GetServicesList")); return; } else { cboService.DataSource = result.QueryResult; } //Dich Vụ Con result = CompanyContractBus.GetDichVuCon(Guid.Empty.ToString()); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetDichVuCon"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetDichVuCon")); return; } else { dgDichVuCon.DataSource = result.QueryResult; } }
private void OnTraHoSo() { List <DataRow> checkedRows = _dictPatient.Values.ToList(); if (checkedRows.Count > 0) { dlgNgayTraHoSo dlg = new dlgNgayTraHoSo(); if (dlg.ShowDialog() == DialogResult.OK) { Cursor.Current = Cursors.WaitCursor; foreach (DataRow row in checkedRows) { string contractMemberGUID = row["ContractMemberGUID"].ToString(); string tenHopDong = cboMaHopDong.Text; string tenBenhNhan = row["FullName"].ToString(); string patientGUID = row["PatientGUID"].ToString(); Result result = CompanyContractBus.TraHoSo(contractMemberGUID, patientGUID, tenBenhNhan, _hopDongGUID, tenHopDong, true, dlg.NgayTra); if (!result.IsOK) { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.TraHoSo"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.TraHoSo")); return; } } MsgBox.Show(Application.ProductName, "Đã trả hồ sơ hoàn tất.", IconType.Information); SearchAsThread(); } } else { MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những bệnh nhân cần trả hồ sơ.", IconType.Information); } }
private void OnDisplayPatientList() { lock (ThisLock) { Result result = CompanyContractBus.GetDanhSachNhanVien(_hopDongGUID, _type2, _name, _type); if (result.IsOK) { dgPatient.Invoke(new MethodInvoker(delegate() { ClearData2(); DataTable dt = result.QueryResult as DataTable; if (_dtTemp == null) { _dtTemp = dt.Clone(); } UpdateChecked(dt); dgPatient.DataSource = dt; lbKetQuaTimDuoc.Text = string.Format("Kết quả tìm được: {0}", dt.Rows.Count); })); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("PatientBus.GetPatientList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("PatientBus.GetPatientList")); } } }
private void OnDisplayInfo() { Result result = CompanyContractBus.GetDanhSachNhanVien(_contractGUID, _type, string.Empty, 0); if (result.IsOK) { MethodInvoker method = delegate { dgDSNV.DataSource = result.QueryResult; RefreshNo(); }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } else { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetDanhSachNhanVien"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetDanhSachNhanVien")); } }
private void OnDisplayHopDongList() { Result result = CompanyContractBus.GetContractList(); if (result.IsOK) { MethodInvoker method = delegate { cboMaHopDong.DataSource = result.QueryResult; }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetNoCompletedContractList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetNoCompletedContractList")); } }
private void OnHuyTraHoSo() { List <DataRow> checkedRows = _dictPatient.Values.ToList(); if (checkedRows.Count > 0) { if (MsgBox.Question(Application.ProductName, "Bạn có muốn hủy trả hồ những bệnh nhân mà bạn đã đánh dấu ?") == DialogResult.Yes) { foreach (DataRow row in checkedRows) { string contractMemberGUID = row["ContractMemberGUID"].ToString(); string tenHopDong = cboMaHopDong.Text; string tenBenhNhan = row["FullName"].ToString(); string patientGUID = row["PatientGUID"].ToString(); Result result = CompanyContractBus.TraHoSo(contractMemberGUID, patientGUID, tenBenhNhan, _hopDongGUID, tenHopDong, false, DateTime.Now); if (!result.IsOK) { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.TraHoSo"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.TraHoSo")); return; } } MsgBox.Show(Application.ProductName, "Đã hủy trả hồ sơ hoàn tất.", IconType.Information); SearchAsThread(); } } else { MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những bệnh nhân cần hủy trả hồ sơ.", IconType.Information); } }
private void OnDeleteContract() { if (_dictContract == null) { return; } List <string> deletedConList = new List <string>(); List <DataRow> deletedRows = _dictContract.Values.ToList(); foreach (DataRow row in deletedRows) { deletedConList.Add(row["CompanyContractGUID"].ToString()); } if (deletedConList.Count > 0) { if (MsgBox.Question(Application.ProductName, "Bạn có muốn xóa những hợp đồng mà bạn đã đánh dấu ?") == DialogResult.Yes) { Result result = CompanyContractBus.DeleteContract(deletedConList); if (result.IsOK) { DataTable dt = dgContract.DataSource as DataTable; if (dt == null || dt.Rows.Count <= 0) { return; } foreach (string key in deletedConList) { DataRow[] rows = dt.Select(string.Format("CompanyContractGUID='{0}'", key)); if (rows == null || rows.Length <= 0) { continue; } dt.Rows.Remove(rows[0]); } _dictContract.Clear(); _dtTemp.Rows.Clear(); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.DeleteContract"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.DeleteContract")); } } } else { MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những hợp đồng cần xóa.", IconType.Information); } }
private void OnDisplayHopDongList() { Result result = CompanyContractBus.GetContractList(); if (result.IsOK) { cboMaHopDong.DataSource = result.QueryResult as DataTable; } else { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetContractList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetContractList")); } }
private void OnDisplayPatientList() { lock (ThisLock) { Result result = null; if (_patientSearchType == Common.PatientSearchType.BenhNhan) { result = PatientBus.GetPatientList(_name, _type); } else if (_patientSearchType == Common.PatientSearchType.BenhNhanThanThuoc) { result = PatientBus.GetBenhNhanThanThuocList(_name, _type); } else if (_patientSearchType == Common.PatientSearchType.BenhNhanKhongThanThuoc) { result = PatientBus.GetBenhNhanKhongThanThuocList(_name, _type); } else if (_patientSearchType == Common.PatientSearchType.NhanVienHopDong) { result = CompanyContractBus.GetContractMemberList(_hopDongGUID, _serviceGUID, _patientGUID, _name, _type); } if (result.IsOK) { dgPatient.Invoke(new MethodInvoker(delegate() { ClearDataSource(); DataTable dt = result.QueryResult as DataTable; if (_dtTemp == null) { _dtTemp = dt.Clone(); } if (_isMulti) { UpdateChecked(dt); } dgPatient.DataSource = dt; lbKetQuaTimDuoc.Text = string.Format("Kết quả tìm được: {0}", dt.Rows.Count); })); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("PatientBus.GetPatientList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("PatientBus.GetPatientList")); } } }
public void DisplayAsThread() { UpdateGUI(); Result result = CompanyContractBus.GetContractList(); if (result.IsOK) { DataTable dtContract = result.QueryResult as DataTable; cboHopDong.DataSource = dtContract; } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetContractList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetContractList")); } }
private void GetCheckListByPatient(string patientGUID) { Result result = CompanyContractBus.GetCheckListByPatient(patientGUID); if (result.IsOK) { if (_dtCheckList != null) { _dtCheckList.Rows.Clear(); _dtCheckList = null; } _dtCheckList = result.QueryResult as DataTable; } else { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyBus.GetCompanyMemberList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyBus.GetCompanyMemberList")); } }
private void OnDisplayCheckList(string patientGUID) { Result result = CompanyContractBus.GetCheckListByPatient(patientGUID); if (result.IsOK) { MethodInvoker method = delegate { DataTable dt = result.QueryResult as DataTable; lvService.Visible = dt.Rows.Count > 0 ? true : false; foreach (DataRow row in dt.Rows) { string code = row["Code"].ToString(); string name = row["Name"].ToString(); string nguoiNhanCN = row["NguoiChuyenNhuong"].ToString(); bool isChecked = Convert.ToBoolean(row["Checked"]); int imgIndex = isChecked ? 0 : 1; ListViewItem item = new ListViewItem(string.Empty, imgIndex); item.SubItems.Add(code); item.SubItems.Add(name); item.SubItems.Add(nguoiNhanCN); lvService.Items.Add(item); } }; if (InvokeRequired) { BeginInvoke(method); } else { method.Invoke(); } } else { lvService.Visible = false; MsgBox.Show(this.Text, result.GetErrorAsString("CompanyBus.GetCompanyMemberList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyBus.GetCompanyMemberList")); } }
public void DisplayComboHopDong() { Result result = CompanyContractBus.GetContractList(); if (result.IsOK) { DataTable dt = result.QueryResult as DataTable; DataRow newRow = dt.NewRow(); newRow["CompanyContractGUID"] = Guid.Empty.ToString(); newRow["ContractName"] = string.Empty; dt.Rows.InsertAt(newRow, 0); cboMaHopDong.DataSource = dt; } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetNoCompletedContractList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetNoCompletedContractList")); } }
private void OnCapNhatAllChecklist(List <string> checkedPatientList) { foreach (string patientGUID in checkedPatientList) { Result result = CompanyContractBus.GetCheckList(_hopDongGUID, patientGUID); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList")); return; } DataTable dtChecklist = result.QueryResult as DataTable; List <DataRow> checkListRows = new List <DataRow>(); foreach (DataRow row in dtChecklist.Rows) { bool isUsing = Convert.ToBoolean(row["Using"]); if (isUsing) { continue; } row["Using"] = true; checkListRows.Add(row); } if (checkListRows.Count <= 0) { continue; } result = ServiceHistoryBus.UpdateChecklist(patientGUID, _hopDongGUID, _beginDate, _endDate, checkListRows); if (!result.IsOK) { MsgBox.Show(this.Text, result.GetErrorAsString("ServiceHistoryBus.UpdateChecklist"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("ServiceHistoryBus.UpdateChecklist")); return; } } MsgBox.Show(this.Text, "Đã cập nhật thành công.", IconType.Information); }
private void raKhamTheoHopDong_CheckedChanged(object sender, EventArgs e) { if (raKhamTheoHopDong.Checked && _dtCheckList != null && _dtCheckList.Rows.Count > 0) { numPrice.Enabled = false; DataRow[] rows = _dtCheckList.Select(string.Format("ServiceGUID='{0}'", cboService.SelectedValue.ToString())); if (rows != null && rows.Length > 0) { string hopDongGUID = rows[0]["CompanyContractGUID"].ToString(); Result result = CompanyContractBus.GetGiaDichVuHopDong(hopDongGUID, cboService.SelectedValue.ToString()); if (result.IsOK) { if (result.QueryResult != null) numPrice.Value = (Decimal)Convert.ToDouble(result.QueryResult); } else { MsgBox.Show(Application.ProductName, result.GetErrorAsString("CompanyContractBus.GetGiaDichVuHopDong"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetGiaDichVuHopDong")); } } } }
private void OnDisplayCheckList() { Cursor.Current = Cursors.WaitCursor; if (dgDSNV.SelectedRows == null || dgDSNV.SelectedRows.Count <= 0) { return; } DataRow drMember = (dgDSNV.SelectedRows[0].DataBoundItem as DataRowView).Row; string patientGUID = drMember["PatientGUID"].ToString(); Result result = CompanyContractBus.GetCheckList(_contractGUID, patientGUID); if (result.IsOK) { dgService.DataSource = result.QueryResult as DataTable; RefreshUsingService(); } else { MsgBox.Show(this.Text, result.GetErrorAsString("CompanyContractBus.GetCheckList"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("CompanyContractBus.GetCheckList")); } }