public JsonResult GetShipper(System.Int32 id) { DataTableViewModel data1; GetShipperRequest request = new GetShipperRequest(); request.ShipperID = id; DetailShipper_ShipperDetailView data = _shipperService.GetShipper(request).Shipper.ConvertToDetailShipper_ShipperDetailView(); return(Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult GetDetail(System.Int32 id) { ShipperDetailView vm = new ShipperDetailView(); GetShipperRequest request = new GetShipperRequest(); request.ShipperID = id; GetShipperResponse response = _shipperService.GetShipper(request); if (response.ShipperFound) { vm = response.Shipper.ConvertToShipperDetailView(); } return(Json(vm, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateShipperTake([FromBody] UpdateShipperTake model) { var CheckShipper = _shipperService.GetShipper(model.ShipperId); if (CheckShipper == null) { return(NotFound("Shipper Not Found")); } var _order = _orderService.GetOrders(o => o.Id == model.OrderId).AsEnumerable().ElementAt(0); _order.ShipperTakeId = CheckShipper.Id; _orderService.UpdateOrder(_order); _orderService.Save(); return(Ok(201)); }
public JsonResult Update(OrderDetailView vm) { GetOrderRequest request = new GetOrderRequest(); request.OrderID = vm.OrderID; ModifyOrderRequest updateRequest = _orderService.GetOrder(request).Order.ConvertToModifyOrderRequest(); updateRequest.OrderID = vm.OrderID; GetCustomerRequest customerRequest = new GetCustomerRequest(); customerRequest.CustomerID = vm.CustomerCustomerID; updateRequest.Customer = _customerService.GetCustomer(customerRequest).Customer; GetEmployeeRequest employeeRequest = new GetEmployeeRequest(); employeeRequest.EmployeeID = vm.EmployeeEmployeeID; updateRequest.Employee = _employeeService.GetEmployee(employeeRequest).Employee; updateRequest.OrderDate = vm.OrderDate; updateRequest.RequiredDate = vm.RequiredDate; updateRequest.ShippedDate = vm.ShippedDate; GetShipperRequest shipperRequest = new GetShipperRequest(); shipperRequest.ShipperID = vm.ShipperShipperID; updateRequest.Shipper = _shipperService.GetShipper(shipperRequest).Shipper; updateRequest.Freight = vm.Freight; updateRequest.ShipName = vm.ShipName; updateRequest.ShipAddress = vm.ShipAddress; updateRequest.ShipCity = vm.ShipCity; updateRequest.ShipRegion = vm.ShipRegion; updateRequest.ShipPostalCode = vm.ShipPostalCode; updateRequest.ShipCountry = vm.ShipCountry; ModifyOrderResponse response = _orderService.ModifyOrder(updateRequest); return(Json(response)); }
public ActionResult GetShipper(Guid Id) { return(Ok(_shipperService.GetShipper(Id).Adapt <ShipperVM>())); }
public async Task <IEnumerable <ShipperModel> > Get() { return(await _shippderService.GetShipper()); }
public async Task TestMethod_測試GetShipper() { var result = await shipperService.GetShipper(); Assert.IsTrue(result.Any()); }