public Participant Add(string eventId, string name, string email) { var dbEvent = new EventRepository(_dbContext).Single(GuidUtil.ToGuid(eventId)); var dbParticipant = _repository.Add(dbEvent.ID, name, email); return(EntityMapper.Map(dbParticipant)); }
public ActionResult Index(Participant newParticipant) { try { var repo = new ParticipantRepository(); repo.Add(newParticipant); SendEmails(newParticipant); return(RedirectToAction("Betaling")); } catch (Exception ex) { return(View("Create")); } }
public ActionResult Create(ParticipantModel ModelObject) { try { if (ModelState.IsValid) { ParticipantRepository repository = new ParticipantRepository(); repository.Add(ModelObject); return(RedirectToAction("GetAll")); } return(View()); } catch { return(View()); } }
public ActionResult AddParticipant(Participant entity) { //partRep.Add(entity); //return View(); AjaxResult result = new AjaxResult(); if (!ModelState.IsValid) { string errorMessages = ""; foreach (var item in ModelState.Values) { foreach (var er in item.Errors) { errorMessages += er.ErrorMessage + "\r\n"; } } result.Result = 0; result.Message = errorMessages; return(Json(result)); } var ctx = new OrganizationDbEntities(); Participant participant = JsonConvert.DeserializeObject <Participant>(JsonConvert.SerializeObject(entity)); partRep.Add(participant); result.Result = 1; result.Message = "işlem başarılı"; var partList = ctx.Participant.OrderByDescending(c => c.Id).ToList();//paticipant listesini büyükten küçüğe sıralıyoruz. return(Json(result)); }
//Add Participant public bool Add(Participant participant) { return(_participantRepository.Add(participant)); }
public bool Add(Participant participant) { bool IsSave = _participantRepository.Add(participant); return(IsSave); }