Exemplo n.º 1
0
        protected override string ExecuteCore()
        {
            var orderId    = Context.GetParameterValue("orderId");
            var passengers = Context.GetParameterValue("passengers");
            var voyages    = Context.GetParameterValue("voyages");
            var refundType = Context.GetParameterValue("refundType");
            var reason     = Context.GetParameterValue("reason");

            if (string.IsNullOrWhiteSpace(orderId))
            {
                InterfaceInvokeException.ThrowParameterMissException("orderId");
            }
            if (string.IsNullOrWhiteSpace(passengers))
            {
                InterfaceInvokeException.ThrowParameterMissException("passengers");
            }
            if (string.IsNullOrWhiteSpace(voyages))
            {
                InterfaceInvokeException.ThrowParameterMissException("voyages");
            }
            if (string.IsNullOrWhiteSpace(refundType))
            {
                InterfaceInvokeException.ThrowParameterMissException("refundType");
            }
            if (string.IsNullOrWhiteSpace(reason))
            {
                InterfaceInvokeException.ThrowParameterMissException("reason");
            }

            decimal id;

            if (!decimal.TryParse(orderId, out id))
            {
                InterfaceInvokeException.ThrowParameterErrorException("订单号");
            }
            var order = Service.OrderQueryService.QueryOrder(id);

            if (order == null)
            {
                InterfaceInvokeException.ThrowCustomMsgException("暂无此订单");
            }
            if (order.Purchaser.CompanyId != Company.CompanyId)
            {
                InterfaceInvokeException.ThrowCustomMsgException("暂无此订单");
            }
            id = ApplyRefundObj(order, refundType, passengers, voyages, reason);
            var obj = Service.ApplyformQueryService.QueryApplyform(id);

            return(ReturnStringUtility.GetApplyform(obj));
        }
Exemplo n.º 2
0
        protected override string ExecuteCore()
        {
            string  applyformId = Context.GetParameterValue("applyformId");
            decimal id;

            if (!decimal.TryParse(applyformId, out id))
            {
                InterfaceInvokeException.ThrowParameterErrorException("applyformId");
            }
            var obj = Service.ApplyformQueryService.QueryApplyform(id);

            if (obj == null)
            {
                InterfaceInvokeException.ThrowCustomMsgException("暂无此申请单");
            }
            if (obj.Purchaser.CompanyId != Company.CompanyId)
            {
                InterfaceInvokeException.ThrowCustomMsgException("暂无此申请单");
            }
            return(ReturnStringUtility.GetApplyform(obj));
        }