示例#1
0
        internal Task <T> PostIdentification <T>(IIdentification identification, Uri uri)
        {
            var messageAction = new IdentificationAction(identification);
            var httpContent   = messageAction.Content(identification);

            return(_requestHelper.Post <T>(httpContent, messageAction.RequestContent, uri));
        }
示例#2
0
        public async Task <IIdentificationResult> IdentifyAsync(IIdentification identification)
        {
            _logger.LogDebug($"Outgoing identification request: {identification}");

            var uri = new Uri("identification", UriKind.Relative);

            var identifyResponse = RequestHelper.PostIdentification <identificationresult>(identification, uri);

            if (identifyResponse.IsFaulted)
            {
                var exception = identifyResponse.Exception?.InnerException;

                _logger.LogWarning($"Identification failed, {exception}");

                if (identifyResponse.Exception != null)
                {
                    throw identifyResponse.Exception.InnerException;
                }
            }

            var identificationResultDataTransferObject = await identifyResponse.ConfigureAwait(false);

            var identificationResult = DataTransferObjectConverter.FromDataTransferObject(identificationResultDataTransferObject);

            _logger.LogDebug($"Response received for identification to recipient, ResultType '{identificationResult.ResultType}', Data '{identificationResult.Data}'.");

            return(identificationResult);
        }
        public GenericCloudWrapperProvider(IConfiguration config)
        {
            var dllName = config.GetSection("GenericCloudProvider:DllName");

            if (dllName.Value is null)
            {
                throw new MissingFieldException("GenericCloudProvider: dll name miss");
            }
            var parentFolder = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
            var absolutePath = Path.Combine(parentFolder, dllName.Value);
            var dllFile      = new FileInfo(absolutePath);

            if (!dllFile.Exists)
            {
                throw new FileNotFoundException("GenericCloudProvider dll miss");
            }
            var provider = Assembly.LoadFile(dllFile.FullName);

            var identificationClass = config.GetSection("GenericCloudProvider:IdentificationClass");

            if (identificationClass.Value is null)
            {
                throw new MissingFieldException("GenericCloudProvider:IdentificationClass miss");
            }
            var identificationType = provider.GetType(identificationClass.Value);

            _identification = (IIdentification)Activator.CreateInstance(identificationType, config);
        }
        public string[] GetTripperNames(string[] ary_str_account)
        {
            if (ary_str_account == null || ary_str_account.Length == 0) return new string[0];

            _iidentification = new Identification();
            return _iidentification.GetTripperName(ary_str_account);
        }
示例#5
0
 public RepositoryBase(TContext MyDataContext, bool SubmitSaveChanges = true)
 {
     _MyDataContext      = MyDataContext;
     _DbSet              = _MyDataContext.Set <TEntity>();
     _IgnoreLog          = true;
     _UserIdentification = null;
     _SubmitSaveChanges  = SubmitSaveChanges;
 }
            private void Identify(IIdentification identification)
            {
                var fakeResponseHandler = new FakeResponseHandler {
                    ResultCode = HttpStatusCode.OK, HttpContent = XmlResource.Identification.GetResult()
                };
                var digipostApi = GetDigipostApi(fakeResponseHandler);

                digipostApi.Identify(identification);
            }
示例#7
0
        public string[] GetTripperNames(string[] ary_str_account)
        {
            if (ary_str_account == null || ary_str_account.Length == 0)
            {
                return(new string[0]);
            }

            _iidentification = new Identification();
            return(_iidentification.GetTripperName(ary_str_account));
        }
        /// <summary>
        /// Copy constructor
        /// </summary>
        public Identification(IIdentification other)
        {
            Identity    = other.Identity;
            Claims      = other.Claims;
            Purposes    = other.Purposes;
            IsAnonymous = other.IsAnonymous;

            var upstream = other as IUpstreamIdentification;

            AllowAnonymous = upstream == null || upstream.AllowAnonymous;
        }
 public StandardResult Register(string account, string password)
 {
     _iidentification = new Identification();
     var ret = _iidentification.Register(account, password);
     if (ret.Ret)
     {
         GetService<IPackageDelivery>().RegisterTripper(account, account);
         GetService<IRecipientRegistration>().RegisterTripper(account, account);
         GetService<ITripperStatusParser>().RegisterTripper(account, account);
     }
     return ret;
 }
示例#10
0
 public virtual bool VerfyProduct(IIdentification newBarcode, IIdentification oldBarcode)
 {
     if (newBarcode.RecordId == oldBarcode.RecordId)
     {
         return(true);
     }
     if (string.IsNullOrEmpty(newBarcode.RecordId) && SameBarcode(oldBarcode, newBarcode.MainBarcode) && !oldBarcode.HasEditPrice && oldBarcode.ProductType != ProductType.Weigh)
     {
         return(true);
     }
     return(false);
 }
示例#11
0
        public StandardResult Register(string account, string password)
        {
            _iidentification = new Identification();
            var ret = _iidentification.Register(account, password);

            if (ret.Ret)
            {
                GetService <IPackageDelivery>().RegisterTripper(account, account);
                GetService <IRecipientRegistration>().RegisterTripper(account, account);
                GetService <ITripperStatusParser>().RegisterTripper(account, account);
            }
            return(ret);
        }
        public IIdentification GetIdentification()
        {
            lock (_lock)
            {
                if (_identification != null)
                {
                    return(_identification);
                }
                _identification = new Identification(new RecipientById(IdentificationType.PersonalIdentificationNumber, "01013300001"));
            }

            return(_identification);
        }
示例#13
0
        public RepositoryBase(TContext MyDataContext, IIdentification UserIdentification = null, bool SubmitSaveChanges = true, bool IgnoreLog = false)
        {
            _MyDataContext      = MyDataContext;
            _DbSet              = _MyDataContext.Set <TEntity>();
            _IgnoreLog          = IgnoreLog;
            _UserIdentification = UserIdentification;
            _SubmitSaveChanges  = SubmitSaveChanges;

            if (IgnoreLog == false)
            {
                _Log = new LogBase <TLog, TContext>(_MyDataContext, UserIdentification);
            }
        }
示例#14
0
        public LogBase(TContext DataContext, IIdentification Identification, bool SaveSQL)
            : this(DataContext, Identification)
        {
            _SaveSQL = SaveSQL;

            if (SaveSQL)
            {
                _sbLog = new StringBuilder();
                _DataContext.Database.Log = message =>
                {
                    _sbLog.AppendLine(message);
                };
            }
        }
        public static identification ToDataTransferObject(IIdentification identification)
        {
            identification identificationDto = null;

            if (identification.DigipostRecipient is RecipientById)
            {
                identificationDto = IdentificationDataTransferObjectFromIdentificationById((RecipientById)identification.DigipostRecipient);
            }

            if (identification.DigipostRecipient is RecipientByNameAndAddress)
            {
                identificationDto = IdentificationDataTranferObjectFromIdentificationByNameAndAddress((RecipientByNameAndAddress)identification.DigipostRecipient);
            }

            return(identificationDto);
        }
示例#16
0
 public override bool VerfyProduct(IIdentification newBarcode, IIdentification oldBarcode)
 {
     if (base.VerfyProduct(newBarcode, oldBarcode))
     {
         var newP = (newBarcode as ChangeProduct);
         var oldP = (oldBarcode as ChangeProduct);
         if (string.IsNullOrEmpty(newBarcode.RecordId))
         {
             return(newP.IsChange == oldP.IsChange);
         }
         else
         {
             return(true);
         }
     }
     return(false);
 }
示例#17
0
        private static ICompanyContactPerson CreateCompanyContactPerson(IDalSession session,
                                                        IContactCompany company,
                                                        string BurgerServiceNummer,
                                                        string Voorletters,
                                                        string Tussenvoegsels,
                                                        string Naam,
                                                        Address PostalAddress,
                                                        Address ResidentialAddress,
                                                        IContactDetails ContactDetails,
                                                        Gender ContactGender,
                                                        INationality ContactNationality,
                                                        IIdentification Id,
                                                        DateTime Dob,
                                                        IManagementCompany AssetManager,
                                                        DateTime creationdate)
        {
            ICompanyContactPerson cmpcp = null;
            IContactPerson contact = null;

            if (company != null && !string.IsNullOrEmpty(Naam))
            {
                if (!LookupContactPersonByBSN(session, BurgerServiceNummer, out contact))
                {
                    contact = new ContactPerson(Voorletters,
                                                    Tussenvoegsels,
                                                    ContactGender,
                                                    ContactNationality,
                                                    Naam,
                                                    PostalAddress,
                                                    ResidentialAddress,
                                                    ContactDetails);
                    contact.BurgerServiceNummer = BurgerServiceNummer;
                    contact.AssetManager = (IAssetManager)AssetManager;
                    contact.Identification = Id;
                    contact.DateOfBirth = Dob;
                    contact.CreationDate = creationdate;
                }
                cmpcp = new CompanyContactPerson(contact, company);
            }
            return cmpcp;
        }
示例#18
0
 public bool SameBarcode(IIdentification oldBarcode, string barcode)
 {
     return(oldBarcode.MainBarcode == barcode || (oldBarcode.MultiCode != null && oldBarcode.MultiCode.Contains(barcode)));
 }
示例#19
0
 public IIdentificationResult Identify(IIdentification identification)
 {
     return(IdentifyAsync(identification).Result);
 }
示例#20
0
 public LogBase(TContext DataContext, IIdentification Identification)
 {
     _DataContext    = DataContext;
     _Identification = Identification;
     _GravaLog       = new GravaLog <TLog, TContext>(_DataContext);
 }
 public StandardResult UpdateTelphone(string ticket, string telphone)
 {
     _iidentification = new Identification();
     return _iidentification.UpdatePhone(ticket, telphone);
 }
 public StandardResult UpdateInfo(string ticket, Gender gender)
 {
     _iidentification = new Identification();
     return _iidentification.UpdateGender(ticket, gender);
 }
 public IStageChain GetChain(IIdentification identification)
 {
     throw new NotImplementedException();
 }
 public StandardResult Logout(string ticket)
 {
     _iidentification = new Identification();
     return _iidentification.Logout(ticket);
 }
 public StandardResult Login(string account, string password, DeviceType device_type, string device_sn)
 {
     _iidentification = new Identification();
     return _iidentification.Login(account, password, device_type, device_sn);
 }
示例#26
0
 public IdentificationAction(IIdentification identification)
     : base(identification)
 {
 }
示例#27
0
 public StandardResult UpdateInfo(string ticket, Gender gender)
 {
     _iidentification = new Identification();
     return(_iidentification.UpdateGender(ticket, gender));
 }
示例#28
0
 public StandardResult Login(string account, string password, DeviceType device_type, string device_sn)
 {
     _iidentification = new Identification();
     return(_iidentification.Login(account, password, device_type, device_sn));
 }
示例#29
0
 public StandardResult Logout(string ticket)
 {
     _iidentification = new Identification();
     return(_iidentification.Logout(ticket));
 }
 public IIdentificationResult Identify(IIdentification identification)
 {
     return(_api.Identify(identification));
 }
示例#31
0
 public StandardResult CheckTicket(string ticket)
 {
     _iidentification = new Identification();
     return(_iidentification.Check(ticket));
 }
 public Task <IIdentificationResult> IdentifyAsync(IIdentification identification)
 {
     return(_api.IdentifyAsync(identification));
 }
示例#33
0
 public StandardResult UpdateTelphone(string ticket, string telphone)
 {
     _iidentification = new Identification();
     return(_iidentification.UpdatePhone(ticket, telphone));
 }
 public StandardResult CheckTicket(string ticket)
 {
     _iidentification = new Identification();
     return _iidentification.Check(ticket);
 }
示例#35
0
 public Car(ISteeringWheel steeringWheel, IIdentification identification)
 {
     this.steeringWheel  = steeringWheel;
     this.identification = identification;
 }
示例#36
0
        private static IContactPerson CreateContactPerson(IDalSession session,
                                                        string BurgerServiceNummer,
                                                        string Voorletters,
                                                        string Tussenvoegsels,
                                                        string Naam,
                                                        Address PostalAddress,
                                                        Address ResidentialAddress,
                                                        IContactDetails ContactDetails,
                                                        Gender ContactGender,
                                                        INationality ContactNationality,
                                                        IIdentification Id,
                                                        DateTime Dob,
                                                        IManagementCompany AssetManager,
                                                        DateTime creationdate)
        {
            IContactPerson theContact = null;

            //1st see if the contact exists
            if (!LookupContactPersonByBSN(session, BurgerServiceNummer, out theContact))
            {
                if (!string.IsNullOrEmpty(Naam))
                {
                    theContact = new ContactPerson(Voorletters,
                                                    Tussenvoegsels,
                                                    ContactGender,
                                                    ContactNationality,
                                                    Naam,
                                                    PostalAddress,
                                                    ResidentialAddress,
                                                    ContactDetails);
                    theContact.BurgerServiceNummer = BurgerServiceNummer;
                    theContact.AssetManager = (IAssetManager)AssetManager;
                    theContact.Identification = Id;
                    theContact.DateOfBirth = Dob;
                    theContact.CreationDate = creationdate;
                }
            }
            return theContact;
        }