public ActionResult Create() { //var model=new QuestionCreateForView //{ // CourSelectListItems = GetDefaultSelectListItem(), // OrganizationSelectListItems = _organizationBll.GetAll() // .Select(c => new SelectListItem() // { // Value = c.Id.ToString(), // Text = c.Name // }) //}; var model = new QuestionCreateForView(); List <Organization> olist = _organizationBll.GetAll(); ViewBag.QuestionOrganizationList = new SelectList(olist, "Id", "Name"); ViewBag.CourseId = new SelectList(new List <Course>(), "Id", "Name"); ViewBag.ExamId = new SelectList(new List <Exam>(), "Id", "Name"); model.QuestionTypeSelectListItems = _questionTypeBll.GetAll().Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.QuestionTypes }); return(View(model)); }
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)); }
//private static int Cid; // GET: ExamAttend public ActionResult Index() { if (Session["UserData"] == null) { return(RedirectToAction("Login", "OnlineExam")); } else { var model = new QuestionCreateForView(); List <Organization> olist = _organizationBll.GetAll(); ViewBag.ExmAttendOrganizationList = new SelectList(olist, "Id", "Name"); ViewBag.CourseId = new SelectList(new List <Course>(), "Id", "Name"); ViewBag.ExamId = new SelectList(new List <Exam>(), "Id", "Name"); return(View()); } }
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 Index(OrganizationCreateForView model, HttpPostedFileBase Logo) { var organization = Mapper.Map <Organization>(model); if (_organizationBll.GetAll().Any(e => e.Name == model.Name)) { ModelState.AddModelError("Name", "This Organization Is Already Assign"); } if (ModelState.IsValid) { string fileName = Path.GetFileName(Logo.FileName); string extention = Path.GetExtension(Logo.FileName); fileName = fileName + DateTime.Now.ToString("yymmssfff") + extention; organization.Logo = "~/Image/" + fileName; string filePath = Path.Combine(Server.MapPath("~/Image/"), fileName); Logo.SaveAs(filePath); var isAdded = _organizationBll.Add(organization); return(RedirectToAction("Details", new { id = organization.Id })); } return(View(model)); }
public ActionResult Create() { var model = new ExamEntryForView(); model.OrganizationSelectListItems = _organizationBll.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }); model.ExamTypeList = _examTypeBll.GetAll() .Select(c => new SelectListItem() { Value = c.Examtype.ToString(), Text = c.ExamtypeName }).ToList(); model.CourseSelectListItems = GetDefaultSelectListItem(); return(View(model)); }
public ActionResult TrainerCreate() { // var g = _courseBll.GetAll(); var model = new TrainerCreateForPV { CourSelectListItems = GetDefaultSelectListItem(), OrganiSelectListItems = _organizationBll.GetAll() .Select(c => new SelectListItem() { Value = c.Id.ToString(), Text = c.Name }) }; //model.Courses = _courseBll.GetAll(); model.BathcSelectListItems = GetDefaultSelectListItem(); return(View(model)); }
// GET: Course public ActionResult CourseInfo(int id) { cId = id; Course course = _courseBll.GetById(id); int orgnizationId = course.Organizationid; List <Organization> orglist = _organizationBll.GetAll(); ViewBag.OrgList = new SelectList(orglist, "Id", "Name", orgnizationId); List <Course> list = _courseBll.GetAll().Where(e => e.Organizationid == orgnizationId).ToList(); ViewBag.CourseId = new SelectList(list, "Id", "Name", cId); //ViewBag.CourseId = new SelectList(new List<Course>(), "Id", "Name"); ViewBag.Examtype = _examTypeBll.GetAll() .Select(c => new SelectListItem() { Value = c.Examtype.ToString(), Text = c.ExamtypeName }).ToList(); ViewBag.Id = new SelectList(new List <Organization>(), "Id", "Name"); // .Select(c => new SelectListItem() // { // Value = c.Id.ToString(), // Text = c.Name // }).ToList(); return(View()); }
//Show All Organization public ActionResult ShowAll() { List <Organization> listOfOrganization = organizationBll.GetAll(); return(View(listOfOrganization)); }