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 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); } }