public JsonResult ServiceAction() { List <ModelBookList> list = new List <ModelBookList>(); var CategoryList = db.tbl_SubjectArea.ToList(); foreach (sp_bookList_Result result in db.sp_bookList().Where(a => a.Published == true)) { list.Add(new ModelBookList() { Id = result.Id, SubectArea_Name = SelectDropDownListManager.MultipleCategory(result.SubjectArea_CategoryId, CategoryList), Author = result.Author, Book_Title = result.Book_Title, Description = result.Description, EditionId = result.EditionId, EditionName = result.EditionName, ProgramId = result.ProgramId, ProgramName = result.ProgramName, SchoolId = result.SchoolId, SubjectArea_CategoryId = Convert.ToInt32(SelectDropDownListManager.MultipleCategory(result.SubjectArea_CategoryId)), Published = Convert.ToBoolean(result.Published) }); } return(Json(list, JsonRequestBehavior.AllowGet)); }
public ActionResult BookList() { List <ModelBookList> list = new List <ModelBookList>(); var CategoryList = dbEntities.tbl_SubjectArea.ToList(); foreach (sp_bookList_Result result in dbEntities.sp_bookList()) { list.Add(new ModelBookList() { Id = result.Id, SubectArea_Name = SelectDropDownListManager.MultipleCategory(result.SubjectArea_CategoryId, CategoryList), Author = result.Author, Book_Title = result.Book_Title, Description = result.Description, EditionId = result.EditionId, EditionName = result.EditionName, ProgramId = result.ProgramId, ProgramName = result.ProgramName, SchoolId = result.SchoolId, Published = Convert.ToBoolean(result.Published) }); } return(View(list)); }
public ActionResult Create(ModelStudent model,string CaptchaText) { if (ModelState.IsValid) { if (Session["CaptchaImageText"]!=null) { if (Session["CaptchaImageText"].ToString() == CaptchaText) { ViewBag.Message = "Catcha Validation Success!"; try { tbl_Student _student = new tbl_Student(); _student.Password = model.Password; _student.StudentId = model.StudentId; _student.Activation = false; _student.ConformPassword = model.ConformPassword; _student.FirstName = model.FirstName; _student.LastName = model.LastName; _student.email_address = model.email_address; _student.ProgramId = model.ProgramId; db.tbl_Student.Add(_student); if (db.SaveChanges() > 0) { ViewBag.Message = "We have created your account. Please contact library to activate."; ModelState.Clear(); } } catch (Exception e) { ViewBag.Message =e.Message; } //tbl_Student.Activation = false; //db.tbl_Student.Add(tbl_Student); //db.SaveChanges(); //tbl_Student=new tbl_Student(); } else { ViewBag.Message = "Catcha Validation Failed!"; } } var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; } return View("Create"); }
public ActionResult RegStudent(ModelStudent model, string CaptchaText) { if (ModelState.IsValid) { if (Session["CaptchaImageText"] != null) { if (Session["CaptchaImageText"].ToString() == CaptchaText) { ViewBag.Message = "Catcha Validation Success!"; try { tbl_Student _student = new tbl_Student(); _student.Password = model.Password; _student.StudentId = model.StudentId; _student.Activation = false; _student.ConformPassword = model.ConformPassword; _student.FirstName = model.FirstName; _student.LastName = model.LastName; _student.email_address = model.email_address; _student.ProgramId = model.ProgramId; db.tbl_Student.Add(_student); if (db.SaveChanges() > 0) { ViewBag.Message = "Your registration is successfully completed . after sometimes later you can login when activate your account "; ModelState.Clear(); } } catch (Exception e) { ViewBag.Message = e.Message; } //tbl_Student.Activation = false; //db.tbl_Student.Add(tbl_Student); //db.SaveChanges(); //tbl_Student=new tbl_Student(); } else { ViewBag.Message = "Catcha Validation Failed!"; } } var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; } return PartialView("RegStudent"); }
// GET: Fac/Create public ActionResult Create() { var DesList = new SelectDropDownListManager().GetFacDesignationList().ToList(); var Department = new SelectDropDownListManager().GetDepartment().ToList(); var School = new SelectDropDownListManager().GetSchool().ToList(); ViewBag.Designation = DesList; ViewBag.Department = Department; ViewBag.School = School; if (Session["MSG"] != null) { ViewBag.Message = Session["MSG"].ToString(); Session.Clear(); } return(View()); }
// GET: Fac/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_faculity_user modelFaculity = _dataDbEntities.tbl_faculity_user.Find(id); var DesList = new SelectDropDownListManager().GetFacDesignationList().ToList(); var Department = new SelectDropDownListManager().GetDepartment().ToList(); var School = new SelectDropDownListManager().GetSchool().ToList(); ViewBag.Designation = DesList; ViewBag.Department = Department; ViewBag.School = School; if (modelFaculity == null) { return(HttpNotFound()); } return(View(modelFaculity)); }
public ActionResult RegStudent() { var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; return PartialView("RegStudent"); }
// GET: Std/Create public ActionResult Create() { var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; return View("Create"); }