Beispiel #1
0
        public IActionResult getDTNVTrongNgay_Linq([FromBody] DateReq req)
        {
            var res = new SingleRsp();

            res.Data = _svc.GetDoanhThuNhanVien_linq(req.date);
            return(Ok(res));
        }
Beispiel #2
0
        public IActionResult DoanhThuNhanVien([FromBody] DateReq req)
        {
            var res = new SingleRsp();

            res.Data = _svc.GetDoanhThuNhanVien(req.date);
            return(Ok(res));
        }
Beispiel #3
0
        public IActionResult getDSDonHangDe5_Linq([FromBody] DateReq req)
        {
            var res = new SingleRsp();

            res.Data = _svc.GetDSDonHangDe5_Linq(req.date);
            return(Ok(res));
        }
        /// <summary> đề 4 câu 4
        /// </summary>
        /// <param name="req"></param>
        /// <returns>Doanh thu shipper</returns>
        public SingleRsp DoanhThuShipper(DateReq req)
        {
            var res = from s in Context.Shippers
                      join o in Context.Orders on s.ShipperId equals o.ShipVia
                      where o.OrderDate.Value.Month == req.Month && o.OrderDate.Value.Year == req.Year
                      select new
            {
                s.ShipperId,
                o.Freight
            };
            SingleRsp result = new SingleRsp();

            result.Data = from r in res
                          group r by new { r.ShipperId } into e
                select new
            {
                e.Key.ShipperId,
                DoanhThu = e.Sum(x => x.Freight).ToString()
            };

            return(result);
        }
Beispiel #5
0
 public SingleRsp DoanhThuShipper(DateReq req)
 {
     return(_rep.DoanhThuShipper(req));
 }
Beispiel #6
0
        public IActionResult DoanhThuShipper(DateReq req)
        {
            var res = _svc.DoanhThuShipper(req);

            return(Ok(res));
        }