Пример #1
0
        public void Update(Kiosks kiosksParam)
        {
            var kiosks = _context.Kiosks.Find(kiosksParam.Id);

            if (kiosks == null)
            {
                throw new AppException("User not found");
            }


            // update user properties
            kiosks.IsActive             = kiosksParam.IsActive;
            kiosks.IsNoFingerprintKiosk = kiosksParam.IsNoFingerprintKiosk;
            kiosks.NoOfVotes            = kiosksParam.NoOfVotes;
            kiosks.LastRegisteredVoteAt = kiosksParam.LastRegisteredVoteAt;
            kiosks.IsUnifiedKiosk       = kiosksParam.IsUnifiedKiosk;
            kiosks.WilayatCode          = kiosksParam.WilayatCode;
            kiosks.OpenTime             = kiosksParam.OpenTime;
            kiosks.PollingDayStatus     = kiosksParam.PollingDayStatus;
            kiosks.PollingStationID     = kiosksParam.PollingStationID;
            kiosks.SerialNumber         = kiosksParam.SerialNumber;
            kiosks.UnlockCode           = kiosksParam.UnlockCode;
            kiosks.WilayatCode          = kiosksParam.WilayatCode;
            _context.Kiosks.Update(kiosks);
            _context.SaveChanges();
        }
 public bool DeepEquals(DestinyCharacterResponse?other)
 {
     return(other is not null &&
            (Inventory is not null ? Inventory.DeepEquals(other.Inventory) : other.Inventory is null) &&
            (Character is not null ? Character.DeepEquals(other.Character) : other.Character is null) &&
            (Progressions is not null ? Progressions.DeepEquals(other.Progressions) : other.Progressions is null) &&
            (RenderData is not null ? RenderData.DeepEquals(other.RenderData) : other.RenderData is null) &&
            (Activities is not null ? Activities.DeepEquals(other.Activities) : other.Activities is null) &&
            (Equipment is not null ? Equipment.DeepEquals(other.Equipment) : other.Equipment is null) &&
            (Kiosks is not null ? Kiosks.DeepEquals(other.Kiosks) : other.Kiosks is null) &&
            (PlugSets is not null ? PlugSets.DeepEquals(other.PlugSets) : other.PlugSets is null) &&
            (PresentationNodes is not null ? PresentationNodes.DeepEquals(other.PresentationNodes) : other.PresentationNodes is null) &&
            (Records is not null ? Records.DeepEquals(other.Records) : other.Records is null) &&
            (Collectibles is not null ? Collectibles.DeepEquals(other.Collectibles) : other.Collectibles is null) &&
            (ItemComponents is not null ? ItemComponents.DeepEquals(other.ItemComponents) : other.ItemComponents is null) &&
            (UninstancedItemComponents is not null ? UninstancedItemComponents.DeepEquals(other.UninstancedItemComponents) : other.UninstancedItemComponents is null) &&
            (CurrencyLookups is not null ? CurrencyLookups.DeepEquals(other.CurrencyLookups) : other.CurrencyLookups is null));
 }
Пример #3
0
        /// <summary>
        /// Checks if the kiosk ip begins with the ResourceIPPrefix (e.g. 192.168.1), or is a defined kiosk IP, or if Request.IsLocal is true. Does not check if user is in the lab.
        /// </summary>
        public bool IsKiosk()
        {
            bool result = Kiosks.Create(Provider.Scheduler.Kiosk).IsKiosk(Context.CurrentIP()) || Context.Request.IsLocal;

            return(result);
        }
Пример #4
0
 public Kiosks Create(Kiosks kiosks)
 {
     _context.Kiosks.Add(kiosks);
     _context.SaveChanges();
     return(kiosks);
 }
Пример #5
0
 public PhysicalAccessUtility(IEnumerable <Badge> inlab, string kioskIp, IKioskRepository repo)
     : this(inlab, Kiosks.Create(repo).IsOnKiosk(kioskIp))
 {
 }
 public void Update(DestinyCharacterResponse?other)
 {
     if (other is null)
     {
         return;
     }
     if (!Inventory.DeepEquals(other.Inventory))
     {
         Inventory.Update(other.Inventory);
         OnPropertyChanged(nameof(Inventory));
     }
     if (!Character.DeepEquals(other.Character))
     {
         Character.Update(other.Character);
         OnPropertyChanged(nameof(Character));
     }
     if (!Progressions.DeepEquals(other.Progressions))
     {
         Progressions.Update(other.Progressions);
         OnPropertyChanged(nameof(Progressions));
     }
     if (!RenderData.DeepEquals(other.RenderData))
     {
         RenderData.Update(other.RenderData);
         OnPropertyChanged(nameof(RenderData));
     }
     if (!Activities.DeepEquals(other.Activities))
     {
         Activities.Update(other.Activities);
         OnPropertyChanged(nameof(Activities));
     }
     if (!Equipment.DeepEquals(other.Equipment))
     {
         Equipment.Update(other.Equipment);
         OnPropertyChanged(nameof(Equipment));
     }
     if (!Kiosks.DeepEquals(other.Kiosks))
     {
         Kiosks.Update(other.Kiosks);
         OnPropertyChanged(nameof(Kiosks));
     }
     if (!PlugSets.DeepEquals(other.PlugSets))
     {
         PlugSets.Update(other.PlugSets);
         OnPropertyChanged(nameof(PlugSets));
     }
     if (!PresentationNodes.DeepEquals(other.PresentationNodes))
     {
         PresentationNodes.Update(other.PresentationNodes);
         OnPropertyChanged(nameof(PresentationNodes));
     }
     if (!Records.DeepEquals(other.Records))
     {
         Records.Update(other.Records);
         OnPropertyChanged(nameof(Records));
     }
     if (!Collectibles.DeepEquals(other.Collectibles))
     {
         Collectibles.Update(other.Collectibles);
         OnPropertyChanged(nameof(Collectibles));
     }
     if (!ItemComponents.DeepEquals(other.ItemComponents))
     {
         ItemComponents.Update(other.ItemComponents);
         OnPropertyChanged(nameof(ItemComponents));
     }
     if (!UninstancedItemComponents.DeepEquals(other.UninstancedItemComponents))
     {
         UninstancedItemComponents.Update(other.UninstancedItemComponents);
         OnPropertyChanged(nameof(UninstancedItemComponents));
     }
     if (!CurrencyLookups.DeepEquals(other.CurrencyLookups))
     {
         CurrencyLookups.Update(other.CurrencyLookups);
         OnPropertyChanged(nameof(CurrencyLookups));
     }
 }
        public bool Equals(DestinyCharacterResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Inventory == input.Inventory ||
                     (Inventory != null && Inventory.Equals(input.Inventory))
                     ) &&
                 (
                     Character == input.Character ||
                     (Character != null && Character.Equals(input.Character))
                 ) &&
                 (
                     Progressions == input.Progressions ||
                     (Progressions != null && Progressions.Equals(input.Progressions))
                 ) &&
                 (
                     RenderData == input.RenderData ||
                     (RenderData != null && RenderData.Equals(input.RenderData))
                 ) &&
                 (
                     Activities == input.Activities ||
                     (Activities != null && Activities.Equals(input.Activities))
                 ) &&
                 (
                     Equipment == input.Equipment ||
                     (Equipment != null && Equipment.Equals(input.Equipment))
                 ) &&
                 (
                     Kiosks == input.Kiosks ||
                     (Kiosks != null && Kiosks.Equals(input.Kiosks))
                 ) &&
                 (
                     PlugSets == input.PlugSets ||
                     (PlugSets != null && PlugSets.Equals(input.PlugSets))
                 ) &&
                 (
                     PresentationNodes == input.PresentationNodes ||
                     (PresentationNodes != null && PresentationNodes.Equals(input.PresentationNodes))
                 ) &&
                 (
                     Records == input.Records ||
                     (Records != null && Records.Equals(input.Records))
                 ) &&
                 (
                     Collectibles == input.Collectibles ||
                     (Collectibles != null && Collectibles.Equals(input.Collectibles))
                 ) &&
                 (
                     ItemComponents == input.ItemComponents ||
                     (ItemComponents != null && ItemComponents.Equals(input.ItemComponents))
                 ) &&
                 (
                     UninstancedItemComponents == input.UninstancedItemComponents ||
                     (UninstancedItemComponents != null && UninstancedItemComponents.Equals(input.UninstancedItemComponents))
                 ) &&
                 (
                     CurrencyLookups == input.CurrencyLookups ||
                     (CurrencyLookups != null && CurrencyLookups.Equals(input.CurrencyLookups))
                 ));
        }
Пример #8
0
 public static bool IsKiosk(IKioskRepository repo, string userHostAddress)
 {
     return(Kiosks.Create(repo).IsKiosk(userHostAddress));
 }