コード例 #1
0
ファイル: ReceptionControl.cs プロジェクト: thuantv1996/OOAD
        private void btnCreate_Click(object sender, EventArgs e)
        {
            var loaiHoSo      = (DTO.LoaiHoSoDTO) this.cbLoaiHoSo.SelectedItem;
            var nguoiTiepNhan = (DTO.NhanVienDTO) this.cbNguoiTiepNhan.SelectedItem;
            var phongKham     = (DTO.PhongKhamDTO) this.cbPhong.SelectedItem;

            if (this.patient == null)
            {
                return;
            }

            var hoso = new DTO.HoSoBenhAnDTO()
            {
                MaBenhNhan   = this.patient.MaBenhNhan,
                MaHoSoTruoc  = this.cbMaHoSoTruoc.Text,
                MaLoaiHoSo   = loaiHoSo != null ? loaiHoSo.MaLoaiHoSo : "",
                MaNguoiTN    = nguoiTiepNhan != null ? nguoiTiepNhan.MaNV : "",
                NgayTiepNhan = DateTime.Now.ToString("yyyyMMdd"),
                YeuCauKham   = this.txtYeuCauKham.getText,
                MaPhongKham  = phongKham != null ? phongKham.MaPhong : ""
            };
            var thanhToan = new DTO.ThanhToanDTO()
            {
                ChiPhiKham = ClinicManagement.Common.SourceLibrary.PhiKhamTiepNhan
            };


            this.bus.TiepNhanInputCheck(hoso, thanhToan, (result, listMessageError) =>
            {
                if (result.Equals(COM.Constant.RES_FAI))
                {
                    var msg = "";
                    listMessageError.ForEach(m => msg += String.Format("{0}\n", m));
                    MessageBox.Show(msg, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                this.btnConfirm.BringToFront();
                this.btnBack.Visible = true;
                this.cbLoaiHoSo.Enabled
                            = this.cbMaHoSoTruoc.Enabled
                            = this.cbNguoiTiepNhan.Enabled
                            = this.cbPhong.Enabled
                            = this.txtYeuCauKham.Enabled
                            = false;
            });
        }
コード例 #2
0
        public void TiepNhanInputCheck(DTO.HoSoBenhAnDTO hoso, DTO.ThanhToanDTO thanhToan, Action <string, List <string> > completion)
        {
            var listMessageError = new List <string>();
            var tiepNhanEntity   = new BUS.Inc.TiepNhanInputCheck.TiepNhanEntity()
            {
                MaHoSoTruoc  = hoso.MaHoSoTruoc,
                MaLoaiHoSo   = hoso.MaLoaiHoSo,
                NgayTiepNhan = hoso.NgayTiepNhan,
                MaNguoiTN    = hoso.MaNguoiTN,
                MaPhongKham  = hoso.MaPhongKham,
                ChiPhiKham   = thanhToan.ChiPhiKham,
                YeuCauKham   = hoso.YeuCauKham
            };
            var result = this.clientBus.TiepNhanInputCheck(tiepNhanEntity, ref listMessageError);

            completion(result, listMessageError);
        }
コード例 #3
0
        public void confirmReception(DTO.HoSoBenhAnDTO hoso, DTO.ThanhToanDTO thanhToan, Action <int, string> completion)
        {
            var result = this.clientBus.SaveHoSo(hoso, thanhToan);

            completion(hoso.SoThuTu, result);
        }
コード例 #4
0
ファイル: ReceptionControl.cs プロジェクト: thuantv1996/OOAD
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var loaiHoSo      = (DTO.LoaiHoSoDTO) this.cbLoaiHoSo.SelectedItem;
            var nguoiTiepNhan = (DTO.NhanVienDTO) this.cbNguoiTiepNhan.SelectedItem;
            var phongKham     = (DTO.PhongKhamDTO) this.cbPhong.SelectedItem;

            if (this.patient == null)
            {
                return;
            }

            var hoso = new DTO.HoSoBenhAnDTO()
            {
                MaBenhNhan   = this.patient.MaBenhNhan,
                MaHoSoTruoc  = this.cbMaHoSoTruoc.Text,
                MaLoaiHoSo   = loaiHoSo != null ? loaiHoSo.MaLoaiHoSo : "",
                MaNguoiTN    = nguoiTiepNhan != null ? nguoiTiepNhan.MaNV : "",
                NgayTiepNhan = DateTime.Now.ToString("yyyyMMdd"),
                YeuCauKham   = this.txtYeuCauKham.Text,
                MaPhongKham  = phongKham != null ? phongKham.MaPhong : ""
            };
            var thanhToan = new DTO.ThanhToanDTO()
            {
                ChiPhiKham = ClinicManagement.Common.SourceLibrary.PhiKhamTiepNhan
            };

            this.bus.confirmReception(hoso, thanhToan, (stt, result) =>
            {
                if (result.Equals(COM.Constant.RES_SUC))
                {
                    DevExpress.Utils.WaitDialogForm f = new DevExpress.Utils.WaitDialogForm();
                    f.Show();

                    Report.FormSoThuTu soThuTuForm = new Report.FormSoThuTu()
                    {
                        AutoSize      = true,
                        StartPosition = FormStartPosition.CenterParent,
                        DataReport    = new Report.DataReportSoThuTu()
                        {
                            MaHoSo      = hoso.MaHoSo,
                            TenBenhNhan = patient.HoTen,
                            DiaChi      = patient.DiaChi,
                            NgayKham    = DateTime.Now.ToString("dd/MM/yyyy"),
                            SoThuTu     = hoso.SoThuTu.ToString(),
                            TenPhong    = phongKham?.TenPhong
                        }
                    };

                    soThuTuForm.FormClosed += (obj, er) =>
                    {
                        this.refreshEvent?.Invoke(this, null);
                        if (this.Parent is Form)
                        {
                            var formParent = (Form)this.Parent;
                            formParent.Close();
                        }
                    };


                    f.Close();
                    soThuTuForm.ShowDialog();
                }
            });
        }