Exemple #1
0
        private void BtnXoa_Click(object sender, EventArgs e)
        {
            int blresult;

            blresult = 0;
            blresult = Convert.ToInt16(MessageBox.Show("Bạn có muốn xóa thuốc", "Xóa Thuốc", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation));
            //MessageBox.Show(blresult.ToString());
            if (blresult == 1)
            {
                hd_DTO = new HoaDon_DTO();
                hd_BUS = new HoaDon_BUS();


                hd_DTO.MaHoaDon = mahoadon;



                cthd_DTO          = new ChiTietHoaDon_DTO();
                cthd_BUS          = new ChiTietHoaDon_BUS();
                cthd_DTO.MaHoaDon = mahoadon;

                hd_BUS.XoaHoaDon(hd_DTO);
                cthd_BUS.XoaChiTietHoaDon(cthd_DTO);

                FrmHoaDon_GUI FrmHoaDon = new FrmHoaDon_GUI();
                Close();
                FrmHoaDon.Show();
            }
        }
        private void btnThem_Click(object sender, EventArgs e)
        {
            int blresult;

            blresult  = 0;
            tienthuoc = Int32.Parse(strtienthuoc);
            //  string tong = (txtTienKham.Text + txtTienThuoc.Text).ToString();
            tongtien = tienthuoc + tienkham;
            blresult = Convert.ToInt16(MessageBox.Show("Bạn có muốn thêm hoa don", "Thêm Hoa Don", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation));

            //MessageBox.Show(blresult.ToString());
            //Tổng tiền



            if (blresult == 1)
            {
                hd_DTO = new HoaDon_DTO();
                hd_BUS = new HoaDon_BUS();

                hd_DTO.MaHoaDon    = mahoadon;
                hd_DTO.MaPhieuKham = cbxPhieuKham.Text;
                hd_DTO.MaBenhNhan  = mabn;
                hd_DTO.Tienkham    = txtTienKham.Text;
                hd_DTO.Tienthuoc   = txtTienThuoc.Text;
                hd_DTO.NgayKham    = txtNgayKham.Text;

                hd_BUS.NhapThongTinHoaDonMoi(hd_DTO);

                cthd_DTO          = new ChiTietHoaDon_DTO();
                cthd_BUS          = new ChiTietHoaDon_BUS();
                cthd_DTO.MaHoaDon = mahoadon;
                cthd_DTO.MaNhanSu = manhansu;
                cthd_DTO.Ngaykham = txtNgayKham.Text;
                cthd_DTO.Tongtien = tongtien.ToString();
                cthd_BUS.NhapThongTinChiTietHoaDonMoi(cthd_DTO);

                FrmHoaDon_GUI FrmHoaDon = new FrmHoaDon_GUI();
                Close();
                FrmHoaDon.Show();
            }
        }
        private void btnQuanLyHoaDon_Click(object sender, EventArgs e)
        {
            FrmHoaDon_GUI FrmHD = new FrmHoaDon_GUI();

            FrmHD.Show();
        }