Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Bookable != false)
            {
                hash ^= Bookable.GetHashCode();
            }
            hash ^= offers_.GetHashCode();
            if (packageId_ != null)
            {
                hash ^= PackageId.GetHashCode();
            }
            if (expiresAt_ != null)
            {
                hash ^= ExpiresAt.GetHashCode();
            }
            return(hash);
        }
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                var bookable = new Bookable();
                bookable.BookingContact = new Contact();
                bookable.Name           = collection["Name"];
                var tagstring = collection["Tags"];
                bookable.Description                = collection["Description"];
                bookable.BookingContact.Name        = collection["ContactName"];
                bookable.BookingContact.PhoneNumber = collection["ContactPhoneNumber"];
                bookable.BookingContact.Email       = collection["ContactEmail"];

                bookable.Id = Guid.NewGuid();
                BookableBroker.Save(bookable);
                BookableSearcher.AddBookableToSearcher(bookable.Name, bookable.Tags, bookable.Id);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }