//Insert Data Into BatchParticipant Table public PartialViewResult ParticipantASS(ParticipantCreateForView partCV) { var batchPartAss = new BatchParticipantAss(); if (_batchPartiBll.GetAll().Any(e => e.ParticipantId == partCV.Id)) { ModelState.AddModelError("Id", "Participant is Already Assign"); } else { batchPartAss.BatchId = _bId; batchPartAss.ParticipantId = partCV.Id; //courseAss.LeadTrainer = partCV.Lead; bool isAdded = _batchPartiBll.Add(batchPartAss); if (isAdded) { ViewBag.SMsg = "Saved"; } else { ViewBag.EMsg = "Failed"; ; } } // var dataList = _participantBll.GetAll().ToList(); //ViewBag.BatchAssPartDrop = dataList.Select(c => new { c.Id, c.Name }); ViewBag.Id = new SelectList(new List <Organization>(), "Id", "Name"); return(PartialView("~/Views/Shared/Batch/_batchAssignParticipant.cshtml", partCV)); }
public ActionResult CourseParticipant() { var oId = _orgId; var model = new ParticipantCreateForView(); model.ParticipantListItems = _participantBll.GetAll().Where(c => c.OrganizationId == oId).ToList(); return(View(model)); }
public ActionResult ParticipantInfoNew() { int id = cId; //jodi data redirect hoy then eta lagbe na var model = new BatchEntryCreateForView(); var modelNew = new ParticipantCreateForView(); modelNew.ParticipantListItems = _participantBll.GetAll().Where(c => c.CourseId == id).ToList(); return(View(modelNew)); }
public ActionResult ParticipantCreate() { var model = new ParticipantCreateForView { CourSelectListItems = GetDefaultSelectListItem(), OrganiSelectListItems = _organizationBll.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }) }; model.BathcSelectListItems = GetDefaultSelectListItem(); return(View(model)); }
public ActionResult ParticipantCreate(ParticipantCreateForView model, HttpPostedFileBase Img) { var participant = Mapper.Map <Participant>(model); if (ModelState.IsValid) { string fileName = Path.GetFileName(Img.FileName); string extention = Path.GetExtension(Img.FileName); fileName = fileName + DateTime.Now.ToString("yymmssfff") + extention; participant.Img = "~/Image/Participant/" + fileName; string filePath = Path.Combine(Server.MapPath("~/Image/Participant/"), fileName); Img.SaveAs(filePath); var mess = ""; //var contactNo = ""; //var email = ""; var isSave = false; var participantall = _participantBll.GetAll(); for (int i = 0; i < participantall.Count; i++) { if ((model.ContactNo == participantall[i].ContactNo) || (model.Email == participantall[i].Email)) { isSave = true; } } if (isSave == true) { ViewBag.EMsg = "Duplicate"; } else { var isAdded = _participantBll.Add(participant); if (isAdded) { ViewBag.SMsg = "Save Is Successfully"; } else { ViewBag.EMsg = "Save Is UnSuccessfully"; } } model = new ParticipantCreateForView(); model.CourSelectListItems = GetDefaultSelectListItem(); model.OrganiSelectListItems = _organizationBll.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }); model.BathcSelectListItems = GetDefaultSelectListItem(); ViewBag.SmsIs = mess; } return(View(model)); }