コード例 #1
0
        public ActionResult GetStore(string CustomerId, string ServiceTypeId)
        {
            var order        = _orderService.GetOrders(t => !t.IsDelete);
            var orderService = _orderSService.GetOrderServices(t => !t.IsDelete);
            var service      = _serviceService.GetServices(t => !t.IsDelete);
            var store        = _storeService.GetStores(t => !t.IsDelete);
            var customer     = _customerService.GetCustomers(t => !t.IsDelete);
            var serviceType  = _serviceTypeService.GetServiceTypes(t => !t.IsDelete);

            if (ServiceTypeId.Equals("0"))
            {
                var temp = from st in store
                           join s in service on st.Id equals s.StoreId
                           join se in serviceType on s.ServiceTypeId equals se.Id
                           join os in orderService on s.Id equals os.ServiceId
                           join o in order on os.OrderId equals o.Id
                           join c in customer on o.CustomerId equals c.Id
                           where c.Id.ToString().Equals(CustomerId)
                           select st;
                return(Ok(temp.Distinct().Adapt <List <StoreVM> >()));
            }
            else
            {
                var temp = from st in store
                           join s in service on st.Id equals s.StoreId
                           join se in serviceType on s.ServiceTypeId equals se.Id
                           join os in orderService on s.Id equals os.ServiceId
                           join o in order on os.OrderId equals o.Id
                           join c in customer on o.CustomerId equals c.Id
                           where se.Id.ToString().Equals(ServiceTypeId)
                           where c.Id.ToString().Equals(CustomerId)
                           select st;
                return(Ok(temp.Distinct().Adapt <List <StoreVM> >()));
            }
        }
コード例 #2
0
        public ActionResult Delete(Guid Id)
        {
            var checkOrder = _orderService.GetOrder(Id);

            if (checkOrder == null)
            {
                return(NotFound("Not Found Order"));
            }
            var listOrderService = _orderServiceService.GetOrderServices(s => s.OrderId == Id).ToList();

            foreach (var item in listOrderService)
            {
                _orderServiceService.DeleteOrderService(item);
            }
            _orderService.DeleteOrder(checkOrder);
            _orderService.Save();
            _orderServiceService.Save();
            return(Ok(201));
        }
コード例 #3
0
 public ActionResult GetOrderDetail(Guid Id)
 {
     return(Ok(_orderServiceService.GetOrderServices(o => o.OrderId == Id).Adapt <List <OrderServiceVM> >()));
 }
コード例 #4
0
 public ActionResult GetAllOrderService()
 {
     return(Ok(_orderServiceService.GetOrderServices(o => !o.IsDelete).Adapt <List <OrderServiceVM> >()));
 }