Ejemplo n.º 1
0
        public JsonResult SearchByTerm(string searchTerm)
        {
            var result = BookableSearcher.Search(searchTerm);
            var rows   = result.ToArray();

            return(Json(rows, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //var cid = Guid.Parse("52cfecbc-d154-4486-bf44-682fac2c30f2");
            //var bid = Guid.Parse("1ad4b29e-db22-4015-8c45-1e487170f78f");

            //var slot = new BookedSlot();
            //slot.Id = Guid.NewGuid();
            //slot.AdditionalNotes = "stest";
            //slot.BookableId = bid;
            //if(slot.Consumers == null)
            //{
            //    slot.Consumers = new List<string>();
            //}
            //slot.Consumers.Add(cid.ToString());
            //slot.Start = DateTimeOffset.Parse("9/24/2016 13:00:05 PM +00:00");
            //slot.End = DateTimeOffset.Parse("9/24/2016 14:00:05 PM +00:00");
            //var consumer = ConsumerBroker.GetConsumer(cid);

            //var bookable = BookableBroker.GetBookableById(bid);
            //bookable.Name = "testClass";
            //BookableBroker.Save(bookable);
            //if(consumer.Contact == null)
            //{ consumer.Contact = new Contact(); }
            //consumer.Contact.Name = "testConsumer";
            //ConsumerBroker.Save(consumer);
            //Console.WriteLine( consumer.BookSlot(slot));

            //var storage = new Storage("user");
            //storage.Delete("*****@*****.**");
            var tag = new List <string>();

            tag.Add("123");
            tag.Add("huanl");
            var bid = Guid.Parse("52cfecbc-d154-4486-bf44-682fac2c30f2");

            BookableSearcher.AddBookableToSearcher("abc", tag, bid);

            var result = BookableSearcher.Search("huanl");

            foreach (var s in result)
            {
                Console.WriteLine(s.Id);
            }
        }
Ejemplo n.º 3
0
        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());
            }
        }