Exemplo n.º 1
0
        public Models.Person SaveAzure(Customers customers, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new Models.Person()
            {
                IdCity         = customers?.IdCity,
                IdCountry      = customers?.IdCountry,
                Email          = customers?.Email,
                Address        = customers?.Address,
                FullName       = customers?.FullName,
                IdentityNumber = customers?.DocumentNumber
            }, 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.Person>());
            }

            return(null);
        }
Exemplo n.º 2
0
        public WorkOrder SaveInAzure(WorkOrders workOrder, List <Object> paramsService, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new WorkOrder()
            {
                IdCustomer             = UtilsIIntegrateErpToSystime.ResolveTypeParameter <Person>(paramsService)?.IdPerson,
                IdDealerRepresentative = UtilsIIntegrateErpToSystime.ResolveTypeParameter <DealerRepresentative>(paramsService)?.IdDealerRepresentative,
                IdDealerShop           = UtilsIIntegrateErpToSystime.ResolveTypeParameter <DealerShop>(paramsService)?.IdDealerShop,
                IdInsuraceConpany      = UtilsIIntegrateErpToSystime.ResolveTypeParameter <InsuranceCompany>(paramsService)?.IdInsuranceCompany,
                IdVehicle           = UtilsIIntegrateErpToSystime.ResolveTypeParameter <Vehicle>(paramsService)?.IdVehicle,
                IdErpQuote          = workOrder?.IdErpQuote?.ToString(),
                WorkOrderIdErp      = workOrder?.WorkOrderNumber,
                EnteredAt           = workOrder?.EnteredAt,
                AutorizedAt         = workOrder?.AuthorizedAt,
                IsTotalLoss         = workOrder?.HasTotalLoss,
                Note                = workOrder?.Note,
                ProgressMessaje     = workOrder?.Note,
                PartsCompletedAt    = workOrder?.PartsCompletedAt,
                ReadyToBePickedUpAt = workOrder?.ReadyToPickUpAt,
                PickedUpAt          = workOrder?.PickedUpAt,
                PromisedAt          = workOrder?.PromisedAt
            }, configErp.ReturnModelService, configErp.UrlService, configErp.LanguageDb, configErp.Token);

            if (ServiceUbicar.CodErrorRequest().HasValue&& (ServiceUbicar.CodErrorRequest().Value == TypeErrorWebServicess.OperationOk.GetHashCode() || ServiceUbicar.CodErrorRequest().Value == TypeErrorWebServicess.NotDataFromUpdate.GetHashCode()))
            {
                new WorkOrderLoadErrorLogSystime(configErp.ConectionStringToSystime).DeleteWorkOrderError(workOrder.WorkOrderNumber, workOrder.IdDealerShop);
            }
            else
            {
                new WorkOrderLoadErrorLogSystime(configErp.ConectionStringToSystime).SaveWorkOrderError(new WorkOrderLoadErrorLog()
                {
                    idCustomerOT         = workOrder.IdCustomer.ToString(),
                    idVehicle            = workOrder.IdVinNumber,
                    IdWorkOrderNumberErp = workOrder.WorkOrderNumber,
                    idDealerShopOtErp    = workOrder.IdDealerShop,
                    idWorkerOT           = workOrder.WorkOrderNumber,
                    CloudUpdateError     = String.Concat(ServiceUbicar.CodErrorRequest(), "-", ServiceUbicar.MessageError())
                }, configErp.UserModify);
            }

            return(null);
        }
Exemplo n.º 3
0
        public Models.DealerRepresentative SaveInAzure(Workers worker, List <Object> paramsService, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new Models.DealerRepresentative()
            {
                IdCity              = worker?.IdCity,
                IdDealer            = configErp.IdDealerUbicarService,
                IdDealerShop        = UtilsIIntegrateErpToSystime.ResolveTypeParameter <Models.DealerShop>(paramsService)?.IdDealerShop,
                IdErpRepresentative = worker?.IdWorker,
                IdentityNumber      = worker?.IdWorker,
                Email    = worker?.Email,
                FullName = worker?.FullName,
                Mobile   = worker?.Mobile,
                Phone    = worker?.Phone
            }, 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.DealerRepresentative>());
            }

            return(null);
        }
Exemplo n.º 4
0
        public Models.InsuranceCompany SaveInAzure(CloudCatalogInsuranceCompanies insuranceCompany, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new Models.InsuranceCompany()
            {
                IdCity    = insuranceCompany?.IdCity,
                IdCountry = insuranceCompany?.IdCountry,
                Email     = insuranceCompany?.Email,
                Phone     = insuranceCompany?.Phone,
                Phone2    = insuranceCompany?.Mobile,
                Address   = insuranceCompany?.Address,
                FullName  = insuranceCompany?.InsuranceCompany,
                Tin       = insuranceCompany?.TIN,
                WebSite   = insuranceCompany?.Website
            }, 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.InsuranceCompany>());
            }

            return(null);
        }
Exemplo n.º 5
0
        public Models.Vehicle SaveInAzure(Vehicles vehicle, List <Object> paramsService, ParamsIntegrateErp configErp)
        {
            ServiceUbicar.Save(new Models.Vehicle()
            {
                IdDealer             = configErp.IdDealerUbicarService,
                IdCity               = vehicle?.IdCity,
                IdCountry            = vehicle?.IdCountry,
                IdVehicleModel       = vehicle?.IdVehicleModel,
                IdInsuranceCompany   = UtilsIIntegrateErpToSystime.ResolveTypeParameter <Models.InsuranceCompany>(paramsService)?.IdInsuranceCompany ?? ConstansServiceUbicar.ID_DEFAULT_INSURANCECOMPANYCLOUD,
                IdVehicleServiceType = vehicle?.IdVehicleServiceType,
                Vin           = String.IsNullOrEmpty(vehicle?.IdVinNumber) ? vehicle?.Plate : vehicle?.IdVinNumber,
                IdVehicleType = vehicle?.IdVehicleType,
                ModelYear     = vehicle?.ModelYear,
                Plate         = vehicle?.Plate
            }, 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.Vehicle>());
            }

            return(null);
        }
Exemplo n.º 6
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);
        }