Пример #1
0
 private static void Postfix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus)
 {
     if (guestStatus == GuestStatus.Prisoner)
     {
         __instance.interactionMode = DefDatabase <PrisonerInteractionModeDef> .GetNamed(PrisonLaborPrefs.DefaultInteractionMode);
     }
 }
 private static void Postfix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus)
 {
     if (guestStatus != GuestStatus.Prisoner)
     {
         Pawn pawn = Traverse.Create(__instance).Field("pawn").GetValue <Pawn>();
         CleanPrisonersStatus.CleanHediffs(pawn);
     }
 }
Пример #3
0
 private static void Prefix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus = GuestStatus.Guest)
 {
     if (!Registry.IsActive)
     {
         return;
     }
     Registry.FactionUpdate(Traverse.Create(__instance).Field <Pawn>("pawn").Value, newHost, guestStatus == GuestStatus.Guest);
 }
Пример #4
0
 static void Prefix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus)
 {
     if (guestStatus == GuestStatus.Prisoner && newHost != null && (newHost != __instance.HostFaction || !__instance.IsPrisoner || !__instance.IsSlave))
     {
         var pawnProperty = typeof(Pawn_GuestTracker).GetField("pawn", BindingFlags.Instance | BindingFlags.NonPublic);
         BadPeopleUtility.NotifyPawnGetCaptured(pawnProperty.GetValue(__instance) as Pawn);
     }
 }
Пример #5
0
        public async Task UpdateGuestStatusAsync(string guestId, GuestStatus status)
        {
            var guest = await _reservationsContext.Guests.FirstOrDefaultAsync(g => g.Id == guestId);

            GuardAgainstNullGuestTableEntry(guestId, guest);
            guest.Status = status.ToString();

            _reservationsContext.Guests.Update(guest);
            await _reservationsContext.SaveChangesAsync();
        }
Пример #6
0
        private static void ChangeUserStatus(string id, GuestStatus status)
        {
            using (var context = new ApplicationDbContext())
            {
                var user = context.Guests.First(u => u.Id == id);

                user.Status = status;
                context.SaveChanges();
            }
        }
Пример #7
0
 static bool Prefix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus)
 {
     if (guestStatus == GuestStatus.Slave || guestStatus == GuestStatus.Guest)
     {
         var pawn = typeof(Pawn_GuestTracker).GetField("pawn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance) as Pawn;
         if (oldNames.ContainsKey(pawn))
         {
             pawn.Name = oldNames[pawn];
         }
     }
     return(true);
 }
        private static void Postfix(Pawn_GuestTracker __instance, Faction newHost, GuestStatus guestStatus)
        {
            if (guestStatus == GuestStatus.Prisoner && newHost == Faction.OfPlayer)
            {
                __instance.interactionMode = DefDatabase <PrisonerInteractionModeDef> .GetNamed(PrisonLaborPrefs.DefaultInteractionMode);

                if (__instance.interactionMode == PL_DefOf.PrisonLabor_workAndConvertOption ||
                    __instance.interactionMode == PrisonerInteractionModeDefOf.Convert)
                {
                    __instance.ideoForConversion = Faction.OfPlayer.ideos.PrimaryIdeo;
                }
            }
        }
        public async Task <IActionResult> GuestList(int?edit, string action, string guest_name, string Address, string Country, string Email, Side Side, string City, string Phone, GuestStatus RSVP, int?guestId)
        {
            var user = await _userManager.GetUserAsync(User);

            DashBoardViewModel model = new DashBoardViewModel();

            if (edit != null)
            {
                var guest = _context.GuestLists.Where(x => x.Id == edit).SingleOrDefault();
                model.GuestId = edit;
                model.Guest   = guest;
            }
            if (action == "addguest")
            {
                _context.GuestLists.Add(new DAL.GuestList {
                    Address = Address, Email = Email, FullName = guest_name, Side = Side, GuestStatus = RSVP, Phone = Phone, User = user, Country = Country, City = City
                });
                _context.SaveChanges();
            }
            else if (action == "editguest")
            {
                var guest = _context.GuestLists.Where(x => x.Id == guestId).SingleOrDefault();
                if (guest == null)
                {
                    return(NotFound());
                }
                else
                {
                    guest.Address     = Address;
                    guest.Email       = Email;
                    guest.FullName    = guest_name;
                    guest.Side        = Side;
                    guest.GuestStatus = RSVP;
                    guest.Phone       = Phone;
                    guest.City        = City;
                    guest.Country     = Country;
                    _context.SaveChanges();
                }
            }
            else if (action == "deleteguest")
            {
                var guest = _context.GuestLists.Where(x => x.Id == guestId).SingleOrDefault();
                if (guest == null)
                {
                    return(NotFound());
                }
                else
                {
                    _context.GuestLists.Remove(guest);
                    _context.SaveChanges();
                }
            }
            guestLists      = _context.GuestLists.Where(x => x.User.Id == user.Id).OrderByDescending(x => x.Id);
            model.GuestList = guestLists;
            return(View(model));
        }
Пример #10
0
 public User(GuestStatus status)
 {
     Status = status;
 }