Ejemplo n.º 1
0
        public async Task <bool> AddAsync(Customer entity)
        {
            try
            {
                var a                  = Convert.ToInt64(entity.TRIDNo);
                var tridcliend         = new ServiceReference1.KPSPublicSoapClient(KPSPublicSoapClient.EndpointConfiguration.KPSPublicSoap12);
                var verificationresult = await tridcliend.TCKimlikNoDogrulaAsync(a, entity.Name.ToUpper(), entity.Surname.ToUpper(), entity.BirthDate);

                if (verificationresult.Body.TCKimlikNoDogrulaResult)
                {
                    _work.Customers.Add(entity);
                }
                else
                {
                    throw new Exception("Girilen kişi için vatandaşlık doğrulanamadığı için kayıt başarısız oldu!");
                }
            }
            catch (Exception)
            {
                return(false);
            }

            //_work.Customers.Add(entity);
            return(await _work.SaveChangesAsync() > 0);
        }
Ejemplo n.º 2
0
        public bool Dogrulama(Gamer gamer)
        {
            ServiceReference1.KPSPublicSoapClient client = new ServiceReference1.KPSPublicSoapClient(KPSPublicSoapClient.EndpointConfiguration.KPSPublicSoap);

            var result = client.TCKimlikNoDogrulaAsync(Convert.ToInt64(gamer.TcNum),
                                                       gamer.FirstName,
                                                       gamer.LastName,
                                                       gamer.BirtYear).Result;

            return(result.Body.TCKimlikNoDogrulaResult);
        }
Ejemplo n.º 3
0
 public KPSPublicSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(KPSPublicSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Ejemplo n.º 4
0
 public KPSPublicSoapClient(EndpointConfiguration endpointConfiguration) :
     base(KPSPublicSoapClient.GetBindingForEndpoint(endpointConfiguration), KPSPublicSoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
 public bool CheckIfRealPerson(Gamer gamer)
 {
     ServiceReference1.KPSPublicSoapClient client = new ServiceReference1.KPSPublicSoapClient(ServiceReference1.KPSPublicSoapClient.EndpointConfiguration.KPSPublicSoap);
     return(client.TCKimlikNoDogrulaAsync(new TCKimlikNoDogrulaRequest(new TCKimlikNoDogrulaRequestBody(TCKimlikNo: Convert.ToInt64(gamer.NationalityId), gamer.FirstName, gamer.LastName, gamer.DateOfBirth.Year))).Result.Body.TCKimlikNoDogrulaResult);
 }