public ActionResult BatchNo(BatchEntryCreateForView batchEntryCV) { var model = Mapper.Map <Batch>(batchEntryCV); if (ModelState.IsValid) { var isSaved = _batchEntryBll.Update(model); if (isSaved) { ViewBag.Smsg = "Updated Successfully"; } else { ViewBag.Emsg = "Failed.."; } } var modelnew = Mapper.Map <BatchEntryCreateForView>(model); var course = _courseEntryBll.GetById(model.CourseId); List <Organization> list = _organizationBll.GetAll(); ViewBag.BatchOrganizationList = new SelectList(list, "Id", "Name", course.Organizationid); List <Course> clist = _courseEntryBll.GetAll(); ViewBag.BatchCourseList = new SelectList(clist, "Id", "Name", model.CourseId); return(View(modelnew)); }
public ActionResult TrainerInfoNew() { int id = cId; var model = new BatchEntryCreateForView(); var modelNew = new TrainerCreateForPV(); modelNew.TrainerList = _trainerBll.GetAll().Where(c => c.CourseId == id).ToList(); return(View(modelNew)); }
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 BatchEntry() { var batchmodel = new BatchEntryCreateForView(); batchmodel.OrganizationSelectListItem = _organizationBll .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); batchmodel.CourseSelectListItem = GetBatchSelectListItem().ToList(); return(View(batchmodel)); }
public ActionResult BatchEntry(BatchEntryCreateForView model) { var msg = "Failed"; if (ModelState.IsValid) { var course = Mapper.Map <Batch>(model); bool isAdded = _batchEntryBll.Add(course); if (isAdded) { ViewBag.SMsg = "Saved"; return(RedirectToAction("BatchInfo", new { id = course.Id })); } else { ViewBag.EMsg = "Failed";; } } else { ViewBag.EMsg = msg; } var batchmodel = new BatchEntryCreateForView(); batchmodel.OrganizationSelectListItem = _organizationBll .GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }).ToList(); batchmodel.CourseSelectListItem = GetBatchSelectListItem().ToList(); return(View(batchmodel)); }
public ActionResult BatchNo() { var model = new BatchEntryCreateForView(); if (ModelState.IsValid) { int id = _bId; Batch batch = _batchEntryBll.GetById(id); var courseId = batch.CourseId; var course = _courseEntryBll.GetById(courseId); model = Mapper.Map <BatchEntryCreateForView>(batch); var organizationId = course.Organizationid; model.OrganizationId = organizationId; List <Organization> olist = _organizationBll.GetAll(); ViewBag.BatchOrganizationList = new SelectList(olist, "Id", "Name", organizationId);//If I not Write OrganizationId It also work Bcz Model Also contain OrganizationId //var courseId = course.Id; List <Course> clist = _courseEntryBll.GetAll(); ViewBag.BatchCourseList = new SelectList(clist, "Id", "Name", courseId);//If I not Write CourseId It also work Bcz Model Also contain CourseId } return(View(model)); }