Beispiel #1
0
        /// <summary>
        /// Gets the ordersby condition. --sunny
        /// </summary>
        /// <param name="customerName">Name of the customer.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns></returns>
        public List <OrderBE> GetOrdersbyCondition(string customerName, string startDate, string endDate)
        {
            GetOrdersbyConditionRequst request = new GetOrdersbyConditionRequst()
            {
                OrderSearchCondition = new OrderSearchParameterBE()
                {
                    CustomerName = customerName,
                    StartDate    = startDate,
                    EndDate      = endDate
                }
            };
            GetOrdersbyConditionResponse response = null;
            ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

            try
            {
                response = MyChannelFactory.CreateChannel().GetOrdersbyCondition(request);
            }
            catch (System.Exception ex)
            {
                log.Error("error", ex);
                log.Fatal("fatal", ex);
                throw new Exception("We have a error! Maybe the remote service is down");
            }
            if (response.IsFailed == true)
            {
                log.Error("error", new Exception(response.Message));
                log.Fatal("fatal", new Exception(response.Message));
                throw (new Exception(response.Message));
            }
            return(response.OrderList);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the ordersby codition.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        public GetOrdersbyConditionResponse GetOrdersbyCondition(GetOrdersbyConditionRequst request)
        {
            GetOrdersbyConditionResponse response = new GetOrdersbyConditionResponse();
            OrderService service = new OrderService();

            try
            {
                response.OrderList = service.GetbyCondition(request.OrderSearchCondition.CustomerName, request.OrderSearchCondition.StartDate, request.OrderSearchCondition.EndDate);
            }
            catch (Exception ex)
            {
                response.IsFailed = true;
                response.Message  = ex.Message;
            }

            return(response);
        }
Beispiel #3
0
        /// <summary>
        /// Gets the ordersby condition. --sunny
        /// </summary>
        /// <param name="customerName">Name of the customer.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns></returns>
        public List <OrderBE> GetOrdersbyCondition(string customerName, string startDate, string endDate)
        {
            GetOrdersbyConditionRequst request = new GetOrdersbyConditionRequst()
            {
                OrderSearchCondition = new OrderSearchParameterBE()
                {
                    CustomerName = customerName,
                    StartDate    = startDate,
                    EndDate      = endDate
                }
            };
            GetOrdersbyConditionResponse response = MyChannelFactory.CreateChannel().GetOrdersbyCondition(request);

            if (response.IsFailed == true)
            {
                throw (new Exception(response.Message));
            }
            return(response.OrderList);
        }