// POST: SelectedBooking/BookRoom public ActionResult BookRoom(string startDate, string endDate, int roomId) { DateTimeFormatInfo dk = new CultureInfo("da-DK", false).DateTimeFormat; var startDateConverted = Convert.ToDateTime(startDate, dk); var endDateConverted = Convert.ToDateTime(endDate, dk); //var user = _accountGateway.GetUserLoggedIn(); var booking = new Dll.Entities.Booking() { //Creator = user, Room = new Room { Id = roomId }, FromDate = startDateConverted, ToDate = endDateConverted, //Accepted = new List<User>(), //Invited = new List<User>() }; var bookingCreated = _bookingGateway.Create(booking); if (bookingCreated != null) { return(RedirectToAction("Bookings", "Profile")); } return(View(new BookRoomViewModel { Room = _roomGateway.Read(roomId), StartDate = startDate, EndDate = endDate, ErrorMessage = "Rummet er allerede booket i det valgte tidsrum" })); }
public ActionResult Create([Bind(Include = "Id,FromDate,ToDate")] Dll.Entities.Booking booking) { if (ModelState.IsValid) { _bookingGateway.Create(booking); return(RedirectToAction("Index")); } return(View(booking)); }
public ActionResult Create([Bind(Include = "Id,Name,Description")] Department department) { if (ModelState.IsValid) { _departmentGateway.Create(department); return(RedirectToAction("Index")); } return(View(department)); }
public object Create() { var source = _gateway.Create <Cycle>(); return(AutoMapper.Mapper.Map <CycleModel>(source)); }
public Int32 AddArticle(ArticleInfo entity) { return(dbService.Create(entity)); }