Пример #1
0
        public static RestServiceClientBase GetRestClient(string type)
        {
            RestServiceClientBase restClient = null;

            switch (type)
            {
            case "OrganizationRestClient":
                restClient = new OrganizationRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "PaymentReportsRestClient":
                restClient = new PaymentReportsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "OrdersRestClient":
                restClient = new OrdersRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "ReportsRestClient":
                restClient = new ReportsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "ContractsRestClient":
                restClient = new ContractsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "PaymentsRestClient":
                restClient = new PaymentsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "UserRestClient":
                restClient = new UserRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "ReferencesRestClient":
                restClient = new ReferencesRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "SiteRestClient":
                restClient = new SiteRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "OrdersDocumentsRestClient":
                restClient = new OrdersDocumentsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "FlightsRestClient":
                restClient = new FlightsRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            case "SystemRestClient":
                restClient = new SystemRestClient(Config.Url, Config.SiteSlug, Config.ApiKey);
                break;

            default:
                throw new Exception("RestClient type was set incorrectly.");
            }
            restClient.ImpersonationToken = new ImpersonationToken(Config.UserLogin, Config.UserPassword);
            return(restClient);
        }
Пример #2
0
 public string EndGetAllForMenu(IAsyncResult result)
 {
     try
     {
         return(((ICategoryManager)_core).EndGetAllForMenu(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #3
0
 public ObservableCollection <WinPhoneClientProxy.CategoryManagerService.SelectListItemWithClass> EndGetAllSortedJson(IAsyncResult result)
 {
     try
     {
         return(((ICategoryManager)_core).EndGetAllSortedJson(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #4
0
 public WinPhoneClientProxy.CategoryManagerService.InCategoryCWPLVM EndGetCategoriesWithProductsInCategory(IAsyncResult result)
 {
     try
     {
         return(((ICategoryManager)_core).EndGetCategoriesWithProductsInCategory(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #5
0
 public BookBlockPLVM EndGetUsersProducts(IAsyncResult result)
 {
     try
     {
         return(((IProductManager)_core).EndGetUsersProducts(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #6
0
 public InCategoryPLVM EndGetProductsInCategory(IAsyncResult result)
 {
     try
     {
         return(((IProductManager)_core).EndGetProductsInCategory(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #7
0
 public BookRowPLVM EndGetFullDetailed(IAsyncResult result)
 {
     try
     {
         return(((IProductGroupManager)_core).EndGetFullDetailed(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #8
0
 public WinPhoneClientProxy.ProductGroupManagerService.BookBlockPLVM EndSearch(IAsyncResult result)
 {
     try
     {
         return(((IProductGroupManager)_core).EndSearch(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #9
0
 public InCategoryCWPLVM EndSearchWithGroupedByCategory(IAsyncResult result)
 {
     try
     {
         return(((IProductGroupManager)_core).EndSearchWithGroupedByCategory(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #10
0
 public ObservableCollection <LabelValuePair> EndSearchAutoComplete(IAsyncResult result)
 {
     try
     {
         return(((IProductGroupManager)_core).EndSearchAutoComplete(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #11
0
 public string EndSearchAutoCompleteJson(IAsyncResult result)
 {
     try
     {
         return(((IProductGroupManager)_core).EndSearchAutoCompleteJson(result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     return(null);
 }
Пример #12
0
 public BookBlockPLVM EndGetUsersProductsByFriendlyUrl(out string userName, IAsyncResult result)
 {
     try
     {
         return(((IProductManager)_core).EndGetUsersProductsByFriendlyUrl(out userName, result));
     }
     catch (Exception e)
     {
         RestServiceClientBase.ShowDefaultErrorMsg();
     }
     userName = "";
     return(null);
 }