// // GET: /Batch/ public ActionResult Entry() { BatchEntryVm batchEntryVm = new BatchEntryVm(); batchEntryVm.OrganizationSelectListItems = GetOrganizationsSelectListItem(); batchEntryVm.CourseSelectListItems = GetCourseListItem(); return(View(batchEntryVm)); }
// GET: Entry Batch public ActionResult Entry() { var model = new BatchEntryVm(); model.OrganizationList = GetOrganizationList(); return(View(model)); }
public ActionResult UpdateBatch(BatchEntryVm batchEntryVm) { var batch = Mapper.Map <Batch>(batchEntryVm); bool isUpdated = batchManager.UpdateBatch(batch); batchEntryVm.OrganizationSelectListItems = GetOrganizationsSelectListItem(); batchEntryVm.CourseSelectListItems = GetCourseListItem(); batchEntryVm.TrainerSelectListItems = GetTrainerListItem(); batchEntryVm.StudentsSelectListItems = GetStudentsSelectListItem(); return(View(batchEntryVm)); }
public ActionResult UpdateBatch() { Batch batch = batchManager.GetLastAddedBatch(); BatchEntryVm batchEntryVm = Mapper.Map <BatchEntryVm>(batch); batchEntryVm.OrganizationSelectListItems = GetOrganizationsSelectListItem(); batchEntryVm.CourseSelectListItems = GetCourseListItem(); batchEntryVm.TrainerSelectListItems = GetTrainerListItem(); batchEntryVm.StudentsSelectListItems = GetStudentsSelectListItem(); return(View(batchEntryVm)); }
public ActionResult Entry(BatchEntryVm model) { var batch = Mapper.Map <Batch>(model); bool isAdded = _batchManager.Add(batch); if (isAdded) { return(RedirectToAction("Entry")); } return(View()); }
public ActionResult Entry(BatchEntryVm batchEntryVm) { var batch = Mapper.Map <Batch>(batchEntryVm); batch.StartDate = Convert.ToDateTime(batchEntryVm.StartDate); batch.EndDate = Convert.ToDateTime(batchEntryVm.EndDate.Date); bool isSave = batchManager.SaveBatch(batch); batchEntryVm.OrganizationSelectListItems = GetOrganizationsSelectListItem(); batchEntryVm.CourseSelectListItems = GetCourseListItem(); return(RedirectToAction("UpdateBatch")); }
public ActionResult Edit(BatchEntryVm model) { if (ModelState.IsValid) { var batch = Mapper.Map <Batch>(model); bool isUpdate = _batchManager.Update(batch); if (isUpdate) { return(RedirectToAction("Index")); } } return(View()); }
public ActionResult StudentAdded(BatchEntryVm batchEntryVm) { Batch batch = batchManager.GetBatchById(batchEntryVm.Id); batch.Students = new List <Student>(); foreach (var student in batchEntryVm.Students) { batch.Students.Add(batchManager.GetStudentById(student.Id)); } // Batch batch = Mapper.Map<Batch>(batchEntryVm); bool isUpdated = batchManager.UpdateBatch(batch); return(View("UpdateBatch", batchEntryVm)); }
public ActionResult BatchExamAssign() { BatchEntryVm batchEntryVm = new BatchEntryVm(); batchEntryVm = Mapper.Map <BatchEntryVm>(batchManager.GetLastAddedBatch()); batchEntryVm.Examses = batchManager.GetExamsByCourseId(batchEntryVm.CourseId); batchEntryVm.ExamSelectListItems = new List <SelectListItem>(); foreach (var exams in batchEntryVm.Examses) { var osli = new SelectListItem(); osli.Text = exams.ExamCode; osli.Value = exams.Id.ToString(); batchEntryVm.ExamSelectListItems.Add(osli); } return(PartialView("~\\Views\\Shared\\ExamAssignBatch.cshtml", batchEntryVm)); }
public ActionResult ExamAssign(BatchEntryVm batchEntryVm) { var batch = batchManager.GetLastAddedBatch(); batch.ExamDate = batchEntryVm.ExamDate; bool isUpdated = batchManager.UpdateBatch(batch); if (isUpdated) { batch.Examses = batchManager.GetExamById(batchEntryVm.Id); return(Json(new { batch.ExamDate, Exam = batch.Examses.Select(e => new { e.ExamType, e.Topic, e.ExamCode, e.Duration, e.FullMarks }) })); } return(null); }
public ActionResult TrainerAdded(BatchEntryVm batchEntryVm) { bool isSaved = false; var batch = Mapper.Map <Batch>(batchEntryVm); batch = batchManager.GetLastAddedBatch(); foreach (var trainer in batchEntryVm.Trainers) { //var trainerAdd = batchManager.GetTrainerByName(trainer); //if (batchEntryVm.TrainerType) //{ // batch.LeadTrainer = trainerAdd[0].Id; //} //batch.Trainers = trainerAdd; //isSaved = batchManager.UpdateBatchInfo(batch); //if (!isSaved) //{ //} } return(View("UpdateBatch")); }