public ActionResult Edit(int?Id) { ClsStatic.ValidateReferral(); sPlsParticipants_Result rslt = con.sPlsParticipants("s", Id, null, null, null, null, null, null, null, null, User.Identity.Name).ToList().FirstOrDefault(); ParticipantsModels model = new ParticipantsModels(); model.Id = rslt.Id; model.Participant_Id = rslt.ParticipantId; model.First_Name = rslt.First_Name; model.Last_Name = rslt.Last_Name; model.Address = rslt.Address; model.Ward_No = rslt.Ward_No; model.Contact_Number = rslt.Contact_Number; model.Consent_Obtained = rslt.Consent_Obtained; model.Interview_Language = rslt.Interview_Language; return(View(model)); }
// GET: Participants public ActionResult Index() { var participants = participantsService.GetMany(); List <ParticipantsModels> pVM = new List <ParticipantsModels>(); foreach (var item in participants) { ParticipantsModels t = new ParticipantsModels { idEvent = item.idEvent, idParticipant = item.idParticipant, date_limite = item.date_limite, idTournament = item.idTournament, tournament = item.tournament, user = item.user }; pVM.Add(t); } return(View(pVM)); }
public ActionResult Edit(ParticipantsModels m) { try { uPlsParticipants_Result rslt = con.uPlsParticipants("u", m.Id, m.Participant_Id, m.First_Name, m.Last_Name, m.Ward_No, m.Address, m.Contact_Number, m.Interview_Language, m.Consent_Obtained, User.Identity.Name).FirstOrDefault(); if (rslt.Code == "000") { TempData["Message"] = rslt.Message; TempData["IsPopup"] = "y"; return(RedirectToAction("Index", "Participants")); } else { ModelState.AddModelError("", "Error! Code[" + rslt.Code + "]: " + rslt.Message); } } catch { ModelState.AddModelError("", "Techinical Error Occurred While Processing Your Request"); } return(View(m)); }