private void OnEditDichVuLamThem() { if (dgDichVuLamThem.SelectedRows == null || dgDichVuLamThem.SelectedRows.Count <= 0) { MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 dịch vụ làm thêm cần sửa.", IconType.Information); return; } DataRow drDichVuLamThem = (dgDichVuLamThem.SelectedRows[0].DataBoundItem as DataRowView).Row; if (drDichVuLamThem == null) { return; } if (_patientGUID == string.Empty) { return; } dlgAddServiceHistory dlg = new dlgAddServiceHistory(_patientGUID, drDichVuLamThem, AllowEdit); dlg.HopDongGUID = _hopDongGUID; if (dlg.ShowDialog(this) == DialogResult.OK) { OnDisplayDichVuLamThem(_patientGUID); OnTinhTongTienDichVuLamThem(); } }
private void OnAdd() { dlgAddServiceHistory dlg = new dlgAddServiceHistory(_patientGUID); if (dlg.ShowDialog(this) == DialogResult.OK) { base.RaiseServiceHistoryChanged(); } }
private void OnAddDichVuLamThem() { if (_patientGUID == string.Empty) { return; } dlgAddServiceHistory dlg = new dlgAddServiceHistory(_patientGUID); dlg.HopDongGUID = _hopDongGUID; if (dlg.ShowDialog(this) == DialogResult.OK) { OnDisplayDichVuLamThem(_patientGUID); OnTinhTongTienDichVuLamThem(); } }
private void OnEdit() { if (dgServiceHistory.SelectedRows == null || dgServiceHistory.SelectedRows.Count <= 0) { MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 dịch vụ.", IconType.Information); return; } DataRow drServiceHistory = (dgServiceHistory.SelectedRows[0].DataBoundItem as DataRowView).Row; bool allowEdit = _isChuyenBenhAn ? false : Global.AllowEditDichVuDaSuDung; dlgAddServiceHistory dlg = new dlgAddServiceHistory(_patientGUID, drServiceHistory, allowEdit); if (dlg.ShowDialog(this) == DialogResult.OK) { base.RaiseServiceHistoryChanged(); } }
private void OnConfirmDichVuChiDinh() { List <DataRow> checkedRows = new List <DataRow>(); DataTable dt = dgChiTiet.DataSource as DataTable; foreach (DataRow row in dt.Rows) { if (Boolean.Parse(row["Checked"].ToString())) { string chiTietChiDinhGUID = row["ChiTietChiDinhGUID"].ToString(); if (_dtDichVuChiDinh == null && _dtDichVuChiDinh.Rows.Count <= 0) { checkedRows.Add(row); } else { DataRow[] rows = _dtDichVuChiDinh.Select(string.Format("ChiTietChiDinhGUID='{0}'", chiTietChiDinhGUID)); if (rows != null && rows.Length > 0) { MsgBox.Show(Application.ProductName, "Không thể xác nhận chỉ định vì có 1 số chỉ định đã được xác nhận rồi.", IconType.Information); return; } else { checkedRows.Add(row); } } } } if (checkedRows.Count > 0) { if (MsgBox.Question(Application.ProductName, "Bạn có muốn xác nhận những dịch vụ chỉ định mà bạn đánh dấu ?") == DialogResult.Yes) { foreach (DataRow row in checkedRows) { dlgAddServiceHistory dlg = new dlgAddServiceHistory(_patientRow["PatientGUID"].ToString()); dlg.ServiceGUID = row["ServiceGUID"].ToString(); dlg.BacSiChiDinhGUID = row["BacSiChiDinhGUID"].ToString(); if (dlg.ShowDialog(this) == DialogResult.OK) { if (dlg.ServiceHistory.ServiceHistoryGUID == Guid.Empty) { return; } DichVuChiDinh dichVuChiDinh = new DichVuChiDinh(); dichVuChiDinh.ServiceHistoryGUID = dlg.ServiceHistory.ServiceHistoryGUID; dichVuChiDinh.ChiTietChiDinhGUID = Guid.Parse(row["ChiTietChiDinhGUID"].ToString()); dichVuChiDinh.CreatedDate = DateTime.Now; dichVuChiDinh.CraetedBy = Guid.Parse(Global.UserGUID); dichVuChiDinh.Status = (byte)Status.Actived; Result result = ChiDinhBus.InsertDichVuChiDinh(dichVuChiDinh); if (!result.IsOK) { MsgBox.Show(Application.ProductName, result.GetErrorAsString("ChiDinhBus.InsertDichVuChiDinh"), IconType.Error); Utility.WriteToTraceLog(result.GetErrorAsString("ChiDinhBus.InsertDichVuChiDinh")); return; } } } OnGetDichVuChiDinh(_patientRow["PatientGUID"].ToString()); } } else { MsgBox.Show(Application.ProductName, "Vui lòng đánh dấu những dịch vụ chỉ định cần xác nhận.", IconType.Information); } }