public static void NhapPhieuThuTien(PhieuThuTien phieuThuTien) { PhieuThuTienDAL.NhapPhieuThuTien(phieuThuTien); string hieuXe = XeDAL.GetHieuXe(phieuThuTien.BienSo); string maBCDT = BaoCaoDoanhThuBLL.GetMaBC(phieuThuTien.NgayThu.Month, phieuThuTien.NgayThu.Year); if (maBCDT == "") { maBCDT = BaoCaoDoanhThuBLL.AutoMABC(); BaoCaoDoanhThu baoCao = new BaoCaoDoanhThu(); baoCao.MaBaoCaoDoanhThu = maBCDT; baoCao.Thang = phieuThuTien.NgayThu.Month; baoCao.Nam = phieuThuTien.NgayThu.Year; BaoCaoDoanhThuBLL.ThemBC(baoCao); } ChiTietBaoCaoDoanhThu chiTiet = new ChiTietBaoCaoDoanhThu(); chiTiet.MaBC = maBCDT; chiTiet.MaCTBC = ChiTietBaoCaoDoanhThuBLL.GetMaCTBC(maBCDT, hieuXe); chiTiet.HieuXe = hieuXe; if (chiTiet.MaCTBC == "") { chiTiet.MaCTBC = ChiTietBaoCaoDoanhThuBLL.AutoMACTBC(); ChiTietBaoCaoDoanhThuBLL.ThemCTBC(chiTiet); } ChiTietBaoCaoDoanhThuBLL.CapNhatBaoCao(chiTiet, phieuThuTien.SoTienThu); }
public static void ThemPhieuSuaChua(PhieuSuaChua psc) { PhieuSuaChuaDAL.ThemPhieuSuaChua(psc); string hieuXe = XeDAL.GetHieuXe(psc.BienSo); string maBCDT = BaoCaoDoanhThuBLL.GetMaBC(psc.NgaySuaChua.Month, psc.NgaySuaChua.Year); if (maBCDT == "") { maBCDT = BaoCaoDoanhThuBLL.AutoMABC(); BaoCaoDoanhThu baoCao = new BaoCaoDoanhThu(); baoCao.MaBaoCaoDoanhThu = maBCDT; baoCao.Thang = psc.NgaySuaChua.Month; baoCao.Nam = psc.NgaySuaChua.Year; BaoCaoDoanhThuBLL.ThemBC(baoCao); } ChiTietBaoCaoDoanhThu chiTiet = new ChiTietBaoCaoDoanhThu(); chiTiet.MaBC = maBCDT; chiTiet.MaCTBC = ChiTietBaoCaoDoanhThuBLL.GetMaCTBC(maBCDT, hieuXe); if (chiTiet.MaCTBC == "") { chiTiet.MaCTBC = ChiTietBaoCaoDoanhThuBLL.AutoMACTBC(); chiTiet.HieuXe = hieuXe; ChiTietBaoCaoDoanhThuBLL.ThemCTBC(chiTiet); } ChiTietBaoCaoDoanhThuBLL.CapNhatSoLuotSua(chiTiet); string maBCT = BaoCaoTonBLL.GetMaBCT(psc.NgaySuaChua.Month, psc.NgaySuaChua.Year); if (maBCT == "") { maBCT = BaoCaoTonBLL.AutoMABCT(); BaoCaoTon BCT = new BaoCaoTon(); BCT.MaBCT = maBCT; BCT.Thang = psc.NgaySuaChua.Month; BCT.Nam = psc.NgaySuaChua.Year; BaoCaoTonBLL.ThemBC(BCT); } }