// GET: eEvent/EventAttendent/Create public async Task <ActionResult> Create() { var model = new CreateEventAttendentModel() { }; model.EventList = new SelectList(await GetEvent(), "Id", "RefNo"); return(View(model)); }
public IHttpActionResult Post([FromBody] CreateEventAttendentModel model) { var attendance = new EventAttendance { AttendeeName = model.AttendeeName, UserId = model.UserId, UserType = model.UserType, CompanyName = model.CompanyName, BookingNumber = model.BookingNumber, ICNo = model.ICNo, CheckInStatus = model.CheckInStatus, EventId = model.EventId, CreatedBy = model.CreatedBy, CreatedDate = model.CreatedDate, Display = model.Display, }; db.EventAttendance.Add(attendance); db.SaveChanges(); return(Ok(attendance.Id)); }
public async Task <ActionResult> Create(CreateEventAttendentModel model) { if (ModelState.IsValid) { model.CreatedBy = CurrentUser.UserId; model.CreatedDate = DateTime.Now; model.Display = true; var response = await WepApiMethod.SendApiAsync <int>(HttpVerbs.Post, $"eEvent/EventAttendent", model); if (response.isSuccess) { await LogActivity(Modules.Event, "Add Participant", model); TempData["SuccessMessage"] = "Participant successfully added"; return(RedirectToAction("List")); } } model.EventList = new SelectList(await GetEvent(), "Id", "RefNo"); return(View(model)); }