コード例 #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);
        }
コード例 #3
0
        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);
        }
コード例 #4
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);
        }
コード例 #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));
        }
コード例 #8
0
        /// <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;
        }
コード例 #9
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;
 }
コード例 #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);
        }
コード例 #12
0
        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
ファイル: ImportAccountsAdapter.cs プロジェクト: kiquenet/B4F
        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);
 }
コード例 #21
0
 public StandardResult UpdateTelphone(string ticket, string telphone)
 {
     _iidentification = new Identification();
     return _iidentification.UpdatePhone(ticket, telphone);
 }
コード例 #22
0
 public StandardResult UpdateInfo(string ticket, Gender gender)
 {
     _iidentification = new Identification();
     return _iidentification.UpdateGender(ticket, gender);
 }
コード例 #23
0
 public IStageChain GetChain(IIdentification identification)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
 public StandardResult Logout(string ticket)
 {
     _iidentification = new Identification();
     return _iidentification.Logout(ticket);
 }
コード例 #25
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);
 }
コード例 #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));
 }
コード例 #30
0
 public IIdentificationResult Identify(IIdentification identification)
 {
     return(_api.Identify(identification));
 }
コード例 #31
0
 public StandardResult CheckTicket(string ticket)
 {
     _iidentification = new Identification();
     return(_iidentification.Check(ticket));
 }
コード例 #32
0
 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));
 }
コード例 #34
0
 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
ファイル: ImportAccountsAdapter.cs プロジェクト: kiquenet/B4F
        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;
        }