Esempio n. 1
0
 private void btnCTDV_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Bạn có muốn xóa không?", "Chú ý", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             busCTDichVu = new BUS.BUSCHITIETDV();
             int _MaDV = (int)grdv_CTDV.GetRowCellValue(grdv_CTDV.FocusedRowHandle, colMaDV_CTDV);
             int _MaPhieu = (int)grdv_CTDV.GetRowCellValue(grdv_CTDV.FocusedRowHandle, colMaPhieu);
             DateTime _NgayThue = (DateTime)grdv_CTDV.GetRowCellValue(grdv_CTDV.FocusedRowHandle, colNgayThue);
             busCTDichVu.XoaCHITIETDV(_MaDV, _MaPhieu, _NgayThue);
             LoadDV();
         }
     }
     catch
     {
         MessageBox.Show("Xin chọn 1 dòng");
     }
 }
Esempio n. 2
0
 private void LoadDichVu()
 {
     busDichVu = new BUS.BUSDICHVU();
     busCTDichVu = new BUS.BUSCHITIETDV();
     if (glkPhong.EditValue.ToString() != "")
     {
         int _MaPhieu = (int)glkvPhong.GetRowCellValue(glkvPhong.FocusedRowHandle, colMaPhieu);
         var _DVSuDung = (from a in busCTDichVu.LayTatCaCHITIETDV().AsEnumerable()
                          join b in busDichVu.LayTatCaDICHVU().AsEnumerable() on a.MADV equals b.MADV
                          join c in busPhieuNhanPhong.LayTheoMaPHIEUNHANPHONG(_MaPhieu).AsEnumerable() on a.MAPHIEU equals c.MAPHIEU
                          select new
                          {
                              NgayThue = a.NGAYTHUE,
                              DichVu = b.TENDV,
                              SoLuong = a.SOLUONGDV,
                              DonGia = a.GIADV
                          });
         lblGioTinh.DataSource = _DVSuDung.ToList();
     }
 }
Esempio n. 3
0
        private void gridViewHoaDon_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (txtMaHD.Text.Trim() == "") return;
            BUS.BUSCHIETKHAU _ChietKhau = new BUS.BUSCHIETKHAU();
            BUS.BUSPHUTHU _PhuThu = new BUS.BUSPHUTHU();
            BUS.BUSCTCHIETKHAU _CTCK = new BUS.BUSCTCHIETKHAU();
            BUS.BUSCTPHUTHU _CTPT = new BUS.BUSCTPHUTHU();
            BUS.BUSDICHVU _DichVu = new BUS.BUSDICHVU();
            BUS.BUSCHITIETDV _CTDV = new BUS.BUSCHITIETDV();

            var _ctck = from a in _ChietKhau.LayTatCaCHIETKHAU()
                        join b in _CTCK.LayTatCaCTCHIETKHAU() on a.MACK equals b.MACK
                        where b.MAHD == Convert.ToInt32(txtMaHD.Text)
                        select new
                        {
                            MACK = a.MACK,
                            TENCK = a.TENCK,
                            PHANTRAMCK = b.PHANTRAMCK
                        };
            grdCK.DataSource = _ctck.Where(a => a.MACK != 23).ToList(); ;
            var _ctpt = from a in _PhuThu.LayTatCaPHUTHU()
                        join b in _CTPT.LayTatCaCTPHUTHU() on a.MAPT equals b.MAPT
                        where b.MAHD == Convert.ToInt32(txtMaHD.Text)
                        select new
                        {
                            MAPT = a.MAPT,
                            TENPT = a.TENPT,
                            PHANTRAMPT = b.PHANTRAMPT
                        };
            grdPT.DataSource = _ctpt.Where(a => a.MAPT != 15).ToList();
            var _ctdv = from a in _DichVu.LayTatCaDICHVU()
                        join b in _CTDV.LayTatCaCHITIETDV() on a.MADV equals b.MADV
                        where b.MAPHIEU == Convert.ToInt32(cmbMaPhieu.SelectedValue)
                        select new
                        {
                            MADV = a.MADV,
                            TENDV = a.TENDV,
                            NGAYTHUE = b.NGAYTHUE,
                            SOLUONGDV = b.SOLUONGDV,
                            GIADV = b.GIADV
                        };
            grdDV.DataSource = _ctdv;
        }