public async Task <ActionResult> Create(CreateEventExternalExhibitorModel model) { if (ModelState.IsValid) { var response = await WepApiMethod.SendApiAsync <int>(HttpVerbs.Post, $"eEvent/EventExternalExhibitor", model); if (response.isSuccess) { TempData["SuccessMessage"] = "External Exhibitor successfully added"; return(RedirectToAction("List")); } } TempData["ErrorMessage"] = "Fail to add new External Exhibitor"; return(RedirectToAction("List")); }
public IHttpActionResult Post([FromBody] CreateEventExternalExhibitorModel model) { var exhibitor = new EventExternalExhibitor { Name = model.Name, Email = model.Email, PhoneNo = model.PhoneNo, Remark = model.Remark, CompanyName = model.CompanyName, Display = true, CreatedDate = DateTime.Now, }; db.EventExternalExhibitor.Add(exhibitor); db.SaveChanges(); return(Ok(exhibitor.Id)); }
public ActionResult Create() { var model = new CreateEventExternalExhibitorModel(); return(View(model)); }