Exemple #1
0
        T IIntegrate <T> .Save(string jsonKeys, ParamsIntegrateErp configErp, List <Object> parameterAditional)
        {
            DealerShopIntegrate     dealerShopIntegrate = null;
            CloudCatalogDealerShops dealerShop          = null;

            if (Enum.TryParse(configErp.DllType, out ErpsTypes dllType))
            {
                dealerShop = DataAccesErpContract.GetDealerShop(jsonKeys, dllType, configErp.ConfigParamsToErp);
                if (dealerShop != null)
                {
                    dealerShop = new DealerShopsSystime(configErp.ConectionStringToSystime).SaveDealerShop(dealerShop);
                }
            }

            if (dealerShop != null)
            {
                dealerShopIntegrate = new DealerShopIntegrate()
                {
                    DealerShopSystime = dealerShop
                };
                if (configErp.SaveInAzure)
                {
                    dealerShopIntegrate.DealerShopUbicar = SaveInAzure(dealerShop, configErp);
                }

                return((T)Convert.ChangeType(dealerShopIntegrate, typeof(T)));
            }
            return(default(T));
        }
 /// <summary>
 /// Metoto encargado de convertir la bodeaga de erp a bodega systime
 /// </summary>
 /// <param name="dealerShopErp"></param>
 /// <returns></returns>
 internal CloudCatalogDealerShops ParseDealerShop(bodegas dealerShopErp)
 {
     if (dealerShopErp != null)
     {
         String[] phones = new ToolsDmsV1(ParamsContract).AjustPhone(dealerShopErp.telefono, null);
         CloudCatalogDealerShops dealerShop = new CloudCatalogDealerShops()
         {
             Shop         = dealerShopErp.descripcion,
             Address      = dealerShopErp.direccion,
             IdCity       = new ToolsDmsV1(ParamsContract).AjusCity(dealerShopErp.ciudad, dealerShopErp.departamento, dealerShopErp.ciudad),
             Phone        = phones[1],
             IdDealerShop = dealerShopErp.id.ToString(),
             Mobile       = phones[0]
         };
         return(dealerShop);
     }
     return(null);
 }
Exemple #3
0
        public Models.DealerShop SaveInAzure(CloudCatalogDealerShops dealerShop, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new Models.DealerShop()
            {
                IdCity    = dealerShop?.IdCity,
                IdDealer  = configErp.IdDealerUbicarService,
                IdErpShop = dealerShop?.IdDealerShop,
                Email     = dealerShop?.Email,
                Latitude  = dealerShop?.Latitude,
                Longitude = dealerShop?.Longitude,
                Address   = dealerShop?.Address,
                Mobile    = dealerShop?.Mobile,
                Phone     = dealerShop?.Phone,
                FullName  = dealerShop?.Shop
            }, configErp.ReturnModelService, configErp.UrlService, configErp.LanguageDb, configErp.Token);

            if (ServiceUbicar.CodErrorRequest().HasValue&& (ServiceUbicar.CodErrorRequest().Value == TypeErrorWebServicess.OperationOk.GetHashCode() || ServiceUbicar.CodErrorRequest().Value == TypeErrorWebServicess.NotDataFromUpdate.GetHashCode()))
            {
                return(ServiceUbicar.CastObjectResponse <Models.DealerShop>());
            }

            return(null);
        }