public OrderBusiness() { _orderDAO = new OrderDAO(); _productDAO = new ProductDAO(); _clientDAO = new ClientDAO(); _clientBus = new ClientBusiness(); _orderStatusDAO = new OrderStatusDAO(); }
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); }
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); }
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); }
public OrderStatusBussiness() { _orderStatusDAO = new OrderStatusDAO(); }