示例#1
0
文件: Proxy.cs 项目: willdarwin/tta
        /// <summary>
        /// Insert a piece of order and return the orderid  --by Eric
        /// </summary>
        /// <param name="order"></param>
        /// <returns>Inserted order </returns>
        public OrderBE InsertOrder(OrderBE order)
        {
            InsertOrderRequest request = new InsertOrderRequest();

            request.OrderBE = order;
            InsertOrderResponse response = MyChannelFactory.CreateChannel().InsertOrder(request);

            if (response != null)
            {
                if (response.IsFailed == true)
                {
                    throw (new Exception(response.Message));
                }
            }
            return(response.OrderBE);
        }
示例#2
0
        /// <summary>
        /// Insert orderdetails
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public InsertOrderResponse InsertOrder(InsertOrderRequest request)
        {
            OrderDetailsService service  = new OrderDetailsService();
            InsertOrderResponse response = new InsertOrderResponse();

            try
            {
                response.OrderBE = service.InsertOrder(request.OrderBE);
            }
            catch (Exception ex)
            {
                response.Message  = ex.Message;
                response.IsFailed = true;
            }
            return(response);
        }
示例#3
0
        /// <summary>
        /// Insert a piece of order and return the orderid  --by Eric
        /// </summary>
        /// <param name="order"></param>
        /// <returns>Inserted order </returns>
        public OrderBE InsertOrder(OrderBE order)
        {
            InsertOrderRequest request = new InsertOrderRequest();

            request.OrderBE = order;
            InsertOrderResponse response = MyChannelFactory.CreateChannel().InsertOrder(request);

            if (response != null)
            {
                if (response.IsFailed == true)
                {
                    ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
                    log.Error("error", new Exception(response.Message));
                    log.Fatal("fatal", new Exception(response.Message));
                    throw (new Exception(response.Message));
                }
            }
            return(response.OrderBE);
        }