Exemple #1
0
        public CreateDonThuocVM GetCreateDonThuocVM(CreateDonThuocVM CreateDonThuocVM, int MaPhieuKham)
        {
            // list danh sach thuoc
            var listThuoc = _service.GetAllListThuoc();
            // thong tin don thoc
            var thuoc = _service.GetThuocCondition(CreateDonThuocVM.thongTinDonThuoc.TenThuoc.ToLower());
            // new mot don thuoc
            var              MaThuoc          = thuoc.MaThuoc;
            double?          DonGia           = thuoc.DonGia;
            int              SoLuongkeToa     = CreateDonThuocVM.thongTinDonThuoc.SoLuong;
            double           ThanhTien        = (SoLuongkeToa * DonGia).Value;
            string           TenThuoc         = CreateDonThuocVM.thongTinDonThuoc.TenThuoc;
            string           CachDung         = CreateDonThuocVM.thongTinDonThuoc.CachDung;
            ThongTinDonThuoc thongTinDonThuoc = new ThongTinDonThuoc
            {
                MaThuoc   = MaThuoc,
                TenThuoc  = TenThuoc,
                SoLuong   = SoLuongkeToa,
                CachDung  = CachDung,
                ThanhTien = ThanhTien
            };

            if (DonThuocController.listTam == null)
            {
                DonThuocController.listTam = new List <ThongTinDonThuoc>();
            }
            DonThuocController.listTam.Add(thongTinDonThuoc);
            return(new CreateDonThuocVM
            {
                thongtinthuoc = listThuoc,
                listThongTinDonThuoc = DonThuocController.listTam,
                TongTien = _service.TinhTongTien(DonThuocController.listTam),
                MaPhieuKham = MaPhieuKham
            });
        }
        private void dgvLichSu_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string           maDon = dgvLichSu.SelectedRows[0].Cells[0].Value.ToString();
            string           maBS  = donthuoc.LayMaBacSiTuMaDon(maDon);
            string           maBN  = donthuoc.LayMaBenhNhanTuMaDon(maDon);
            ThongTinDonThuoc fo    = new ThongTinDonThuoc(maDon, maBS, maBN);

            this.Hide();
            fo.ShowDialog();
            this.Show();
        }