﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ECCentral.Portal.Basic.Utilities;
using Newegg.Oversea.Silverlight.ControlPanel.Core;
using Newegg.Oversea.Silverlight.Controls;
using ECCentral.QueryFilter.Customer;
using ECCentral.Service.Customer.Restful.RequestMsg;

namespace ECCentral.Portal.UI.Customer.Facades
{
    public class RefundRequestFacade
    {
        private readonly RestClient restClient;
        private string ServiceBaseUrl
        {
            get
            {
                return CPApplication.Current.CurrentPage.Context.Window.Configuration.GetConfigValue("Customer", "ServiceBaseUrl");
            }
        }
        public RefundRequestFacade()
        {
            restClient = new RestClient(ServiceBaseUrl);
        }
        public RefundRequestFacade(IPage page)
        {
            restClient = new RestClient(ServiceBaseUrl, page);

        }
        public void Query(RefundRequestQueryFilter request, EventHandler<RestClientEventArgs<dynamic>> callback)
        {
            string relativeUrl = "/CustomerService/RefundReqest/Query";
            restClient.QueryDynamicData(relativeUrl, request, callback);
        }

        public void Audit(RefundAuditReq request, EventHandler<RestClientEventArgs<dynamic>> callback)
        {
            string relativeUrl = "/CustomerService/RefundReqest/Audit";
            restClient.Update(relativeUrl, request, callback);
        }
    }
}
