public ActionResult SearchNewReceptionist(string firstName, string lastName)
        {
            List <ApplicationUser> foundGuests = new List <ApplicationUser>();
            string errormessage = "";

            if ((firstName == "") && (lastName == ""))//Check typed string to be something else than void
            {
                ViewBag.Errormessage = "Please specify the guests name before searching.";
                return(PartialView("_ShowFoundGuests", foundGuests));
            }
            if ((firstName == null) || (lastName == null))
            {
                ViewBag.Errormessage = "Please specify the guests name before searching(Null).";
                return(PartialView("_ShowFoundGuests", foundGuests));
            }
            foundGuests = Camping2000Db.SearchForPeople(firstName, lastName);
            if ((firstName != "") && (foundGuests.Count < 1))
            {
                errormessage         = $"A guest with the name of {firstName} was not found. Please try again.";
                ViewBag.Errormessage = errormessage;
            }
            else if ((lastName != "") && (foundGuests.Count < 1))
            {
                errormessage         = $"A guest with the name of {lastName} was not found. Please try again.";
                ViewBag.Errormessage = errormessage;
            }
            return(PartialView("_ShowFoundCoworker", foundGuests));
        }
Пример #2
0
 public CheckInCheckOutController()
 {
     Db = new Camping2000Db();
 }
 public ReceptionistController()
 {
     Db = new Camping2000Db();
 }
Пример #4
0
 public ReservationController()
 {
     Db = new Camping2000Db();
 }