public IActionResult SoLuongHangCanGiaoTrongKhoangThoiGian_LinQ([FromBody] OrdersReq req) { var res = new SingleRsp(); res.Data = _svc.SoLuongHangCanGiaoTrongKhoangThoiGian_LinQ(req.dateF, req.dateT); return(Ok(res)); }
public IActionResult TimKiemOrderTheoCompanyNameVaEmployeeName([FromBody] OrdersReq req) { var res = new SingleRsp(); res.Data = _svc.TimKiemOrderTheoCompanyNameVaEmployeeName(req.size, req.page, req.companyName, req.employeeName); return(Ok(res)); }
public IActionResult DanhSachDonHangTrongNgay_LinQ([FromBody] OrdersReq req) { var res = new SingleRsp(); res.Data = _svc.DanhSachDonHangTrongNgay_LinQ(req.size, req.page, req.dateF); return(Ok(res)); }
public IActionResult GetDSDonHangNhanVienTrongKhoangThoiGianTheoKeyword([FromBody] OrdersReq req) { var res = new SingleRsp(); res.Data = _svc.GetDSDonHangNhanVienTrongKhoangThoiGianTheoKeyword(req.size, req.page, req.keyword, req.dateF, req.dateT); return(Ok(res)); }
public IActionResult GetDSDonHangTrongKhoangThoiGian_LinQ([FromBody] OrdersReq req) { var res = new SingleRsp(); res.Data = _svc.GetDSDonHangTrongKhoangThoiGian_LinQ(req.size, req.page, req.dateF, req.dateT); return(Ok(res)); }
public IActionResult GetOrders(string LastName) { var db = new s19278Context(); var db2 = new s19278Context(); var req = db.Zamowienie.Where(e => e.IdKlientNavigation.Nazwisko == LastName); List <OrdersReq> td = new List <OrdersReq>(); foreach (var i in req) { var response = new OrdersReq() { IdZamowienia = i.IdZamowienia, DataPrzyjecia = i.DataPrzyjecia, DataRealizacji = i.DataRealizacji, IdKlient = i.IdKlient, IdPracownik = i.IdPracownik, Uwagi = i.Uwagi, list = db2.ZamowienieWyrobCukierniczy.Where(e => e.IdZamowienia == i.IdZamowienia).ToList() }; td.Add(response); db2 = new s19278Context(); } if (req.Any()) { return(Ok(td)); } else { return(NotFound("Klient o takim nazwisku nie zlozyl zamowienia")); } }
public IActionResult GetOrders() { var db = new s19278Context(); var db2 = new s19278Context(); var res = db.Zamowienie; List <OrdersReq> td = new List <OrdersReq>(); foreach (var i in res) { var response = new OrdersReq() { IdZamowienia = i.IdZamowienia, DataPrzyjecia = i.DataPrzyjecia, DataRealizacji = i.DataRealizacji, IdKlient = i.IdKlient, IdPracownik = i.IdPracownik, Uwagi = i.Uwagi, list = db2.ZamowienieWyrobCukierniczy.Where(e => e.IdZamowienia == i.IdZamowienia).ToList() }; td.Add(response); db2 = new s19278Context(); } if (!res.Any()) { return(NotFound("Nie ma zadnych zamowien")); } return(Ok(td)); }
public SingleRsp UpdateOrder(OrdersReq ord) { var res = new SingleRsp(); Orders orders = new Orders(); orders = _rep.Read(ord.OrderId); orders.EmployeeId = ord.EmployeeId; orders.OrderDate = ord.OrderDate; res = _rep.UpdateOrder(orders); return(res); }
//=========================================================== //=========================================================== #region -- Update Orders -- public SingleRsp UpdateOrders(OrdersReq ord) { var res = new SingleRsp(); Orders orders = new Orders(); orders.OrderId = ord.OrderId; orders.UserId = ord.UserId; orders.OrderTotal = ord.OrderTotal; orders.OrderPhone = ord.OrderPhone; orders.OrderDate = ord.OrderDate; orders.IsCompleted = ord.IsCompleted; orders.ShippingAddress = ord.ShippingAddress; orders.OrderDescription = ord.OrderDescription; res = _rep.UpdateOrders(orders); return(res); }
//=========================================================== //=========================================================== #region -- Update Orders -- public SingleRsp UpdateOrders(int id, OrdersReq ord) { var res = new SingleRsp(); Orders orders = new Orders(); orders.OrderId = ord.id; orders.UserId = ord.user_id; orders.OrderTotal = ord.order_total; orders.OrderPhone = ord.phone; orders.OrderDate = ord.date; orders.IsCompleted = ord.is_completed; orders.ShippingAddress = ord.shipping_address; orders.OrderDescription = ord.description; res = _rep.UpdateOrders(orders); return(res); }
public IActionResult UpdateOrders([FromBody] OrdersReq req) { var res = _svc.UpdateOrders(req); return(Ok(res)); }
public IActionResult DeleteOrders(OrdersReq req) { var res = _svc.DeleteOrders(req.OrderId); return(Ok(res)); }