コード例 #1
0
 public OrderBusiness()
 {
     _orderDAO       = new OrderDAO();
     _productDAO     = new ProductDAO();
     _clientDAO      = new ClientDAO();
     _clientBus      = new ClientBusiness();
     _orderStatusDAO = new OrderStatusDAO();
 }
コード例 #2
0
        public async Task <bool> Delete(OrderStatus OrderStatus)
        {
            OrderStatusDAO OrderStatusDAO = await DataContext.OrderStatus.Where(x => x.Id == OrderStatus.Id).FirstOrDefaultAsync();

            DataContext.OrderStatus.Remove(OrderStatusDAO);
            await DataContext.SaveChangesAsync();

            return(true);
        }
コード例 #3
0
        public async Task <bool> Update(OrderStatus OrderStatus)
        {
            OrderStatusDAO OrderStatusDAO = DataContext.OrderStatus.Where(x => x.Id == OrderStatus.Id).FirstOrDefault();

            OrderStatusDAO.Id          = OrderStatus.Id;
            OrderStatusDAO.Code        = OrderStatus.Code;
            OrderStatusDAO.Name        = OrderStatus.Name;
            OrderStatusDAO.Description = OrderStatus.Description;
            await DataContext.SaveChangesAsync();

            return(true);
        }
コード例 #4
0
        public async Task <bool> Create(OrderStatus OrderStatus)
        {
            OrderStatusDAO OrderStatusDAO = new OrderStatusDAO();

            OrderStatusDAO.Id          = OrderStatus.Id;
            OrderStatusDAO.Code        = OrderStatus.Code;
            OrderStatusDAO.Name        = OrderStatus.Name;
            OrderStatusDAO.Description = OrderStatus.Description;

            await DataContext.OrderStatus.AddAsync(OrderStatusDAO);

            await DataContext.SaveChangesAsync();

            OrderStatus.Id = OrderStatusDAO.Id;
            return(true);
        }
コード例 #5
0
 public OrderStatusBussiness()
 {
     _orderStatusDAO = new OrderStatusDAO();
 }