コード例 #1
0
        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"));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public ActionResult Create()
        {
            var model = new CreateEventExternalExhibitorModel();

            return(View(model));
        }