/// <summary> /// Attempts to remove an order from the current IOrderRepository data /// </summary> /// <param name="inputtedDate">The date to parse & search for</param> /// <param name="orderNumber">The specific order number to delete within the file</param> /// <returns>A validated response</returns> public Response RemoveOrder(string inputtedDate, int orderNumber) { Response response = new Response(); ParseDate(response, inputtedDate); if (response.ResponseType.Equals(ResponseType.Invalid)) { return(response); } Order order = OrderRepository.GetByValue(orderNumber); if (order == null) { response.ResponseType = ResponseType.Fail; response.Message = "Could not find order."; return(response); } OrderRepository.Delete(orderNumber); response.ResponseType = ResponseType.Success; return(response); }