// GET: Admin/BaoCaoBanHang
        public ActionResult Index(string thang, string nam)
        {
            int month;
            int year;

            try
            {
                month = Int32.Parse(thang);
                year  = Int32.Parse(nam);
            }
            catch { return(null); }
            List <int>  dataSanPhamDaBanOnline  = new List <int>(); //Lay du lieu tung ngay
            List <int>  dataSanPhamDaBanTaiQuan = new List <int>(); //Lay du lieu tung ngay
            List <int>  dataTongSanPhamDaBan    = new List <int>(); //Lay du lieu tung ngay
            BaoCaoModel baocao = new BaoCaoModel();

            for (int i = 1; i <= DateTime.DaysInMonth(year, month); i++)
            {
                int soSPBanOnline  = baocao.GetSoSPBanOnlineTrongNgay(i, month, year);
                int soSPBanTaiQuan = baocao.GetSoSPBanTaiQuanTrongNgay(i, month, year);
                dataSanPhamDaBanOnline.Add(soSPBanOnline);
                dataSanPhamDaBanTaiQuan.Add(soSPBanTaiQuan);
                dataTongSanPhamDaBan.Add(soSPBanOnline + soSPBanTaiQuan);
            }
            ViewBag.BaoCaoSoSanPhamBanOnlineCuaThang  = dataSanPhamDaBanOnline;
            ViewBag.BaoCaoSoSanPhamBanTaiQuanCuaThang = dataSanPhamDaBanTaiQuan;
            ViewBag.BaoCaoSoSanPhamDaBanCuaThang      = dataTongSanPhamDaBan;
            ViewBag.Thang = thang;
            ViewBag.Nam   = nam;
            //LAY so ngay can hien thi
            int soNgayCanHienThi = 1;

            if (month == DateTime.Now.Month && year == DateTime.Now.Year)
            {
                soNgayCanHienThi = DateTime.Now.Day;
            }
            else
            {
                soNgayCanHienThi = DateTime.DaysInMonth(year, month);
            }
            ViewBag.SoNgayCanHienThi = soNgayCanHienThi;

            //Lay BXH MONAN TRONG THANG
            //ViewBag.BXHMONAN = baocao.GetBXHMONANTrongThang(month,year);
            //ViewBag.BXHNGK = baocao.GetBXHNGKTrongThang(month, year);
            //LAY BXH NUOCGIAIKHAT TRONG THANG
            return(View());
        }
        // GET: Admin/QuanLy
        public ActionResult Index()
        {
            BaoCaoModel baocao = new BaoCaoModel();
            int         day    = DateTime.Now.Day;
            int         month  = DateTime.Now.Month;
            int         year   = DateTime.Now.Year;

            //Lay so sp da ban
            int soSPDaBanHomNay = baocao.GetSoSPBanTaiQuanTrongNgay(day, month, year) + baocao.GetSoSPBanOnlineTrongNgay(day, month, year);

            ViewBag.SoSPDaBanHomNay = soSPDaBanHomNay;

            //Lay doanh thu 1 ngay
            ViewBag.TongThuHomNay = baocao.GetTongThu1Ngay(day, month, year);
            ViewBag.TongChiHomNay = baocao.GetTongChi1Ngay(day, month, year);

            int soDonChuaXacNhan = baocao.GetSoDDHChuaXacNhanTrongNgay(day, month, year);

            ViewBag.SoDonChuaXacNhan = soDonChuaXacNhan;

            ViewBag.SoTienThuTaiQuan = baocao.GetTongThuTaiQuan1Ngay(day, month, year);
            ViewBag.SoTienThuOnline  = baocao.GetTongThuOnline1Ngay(day, month, year);
            ViewBag.SoTienThuKhac    = baocao.GetTongThuKhac1Ngay(day, month, year);

            ViewBag.TongThuBuoiTrua = baocao.GetTongThuBuoiTrua1Ngay(day, month, year);
            ViewBag.TongThuBuoiToi  = baocao.GetTongThuBuoiToi1Ngay(day, month, year);

            ViewBag.ChiNhapNguyenLieu   = baocao.GetChiNhapNguyenLieu1Ngay(day, month, year);
            ViewBag.ChiNhapDungCu       = baocao.GetChiNhapDungCu1Ngay(day, month, year);
            ViewBag.ChiNhapNuocGiaiKhat = baocao.GetChiNhapNuocGiaiKhat1Ngay(day, month, year);
            ViewBag.ChiTraLuongNhanVien = baocao.GetChiTraLuongNhanVien1Ngay(day, month, year);
            ViewBag.ChiKhac             = baocao.GetChiKhac1Ngay(day, month, year);
            return(View());
        }
示例#3
0
        // GET: Admin/BaoCaoHangNgay
        public ActionResult Index(string ngay, string thang, string nam)
        {
            int day;
            int month;
            int year;

            try
            {
                day   = Int32.Parse(ngay);
                month = Int32.Parse(thang);
                year  = Int32.Parse(nam);
            }
            catch { return(null); }

            BaoCaoModel baocao = new BaoCaoModel();
            //Lay so sp da ban
            int soSPDaBanHomNay = baocao.GetSoSPBanTaiQuanTrongNgay(day, month, year) + baocao.GetSoSPBanOnlineTrongNgay(day, month, year);

            ViewBag.SoSPDaBanHomNay = soSPDaBanHomNay;

            //Lay doanh thu 1 ngay
            ViewBag.TongThuHomNay = baocao.GetTongThu1Ngay(day, month, year);
            ViewBag.TongChiHomNay = baocao.GetTongChi1Ngay(day, month, year);

            int soDonChuaXacNhan = baocao.GetSoDDHChuaXacNhanTrongNgay(day, month, year);

            ViewBag.SoDonChuaXacNhan = soDonChuaXacNhan;

            ViewBag.SoTienThuTaiQuan = baocao.GetTongThuTaiQuan1Ngay(day, month, year);
            ViewBag.SoTienThuOnline  = baocao.GetTongThuOnline1Ngay(day, month, year);
            ViewBag.SoTienThuKhac    = baocao.GetTongThuKhac1Ngay(day, month, year);

            ViewBag.TongThuBuoiTrua = baocao.GetTongThuBuoiTrua1Ngay(day, month, year);
            ViewBag.TongThuBuoiToi  = baocao.GetTongThuBuoiToi1Ngay(day, month, year);

            ViewBag.ChiNhapNguyenLieu   = baocao.GetChiNhapNguyenLieu1Ngay(day, month, year);
            ViewBag.ChiNhapDungCu       = baocao.GetChiNhapDungCu1Ngay(day, month, year);
            ViewBag.ChiNhapNuocGiaiKhat = baocao.GetChiNhapNuocGiaiKhat1Ngay(day, month, year);
            ViewBag.ChiTraLuongNhanVien = baocao.GetChiTraLuongNhanVien1Ngay(day, month, year);
            ViewBag.ChiKhac             = baocao.GetChiKhac1Ngay(day, month, year);
            ViewBag.Ngay  = ngay;
            ViewBag.Thang = thang;
            ViewBag.Nam   = nam;
            return(View());
        }