public ActionResult Edit2([Bind(Include = "JobID,CompanyName,Details,Designation,LocationID,Number_of_Positions")] tbl_Student job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GraduationID = new SelectList(db.tbl_Graduation, "GraduationID", "GraduationName", job.GraduationID); return(View(job)); }
public ActionResult Create([Bind(Include = "JobID,CompanyName,Details,Designation,LocationID,Number_of_Positions")] Job job) { if (ModelState.IsValid) { db.Jobs.Add(job); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LocationID = new SelectList(db.tbl_Locations, "LocationID", "LocationName", job.LocationID); return(View(job)); }
public ActionResult Create([Bind(Include = "ApplyId,JobID,StudentID,Skills")] ApplyJob applyjob) { if (ModelState.IsValid) { db.ApplyJobs.Add(applyjob); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.JobID = new SelectList(db.Jobs, "JobID", "CompanyName", applyjob.JobID); ViewBag.StudentID = new SelectList(db.tbl_Student, "StudentID", "FirstName", applyjob.StudentID); return(View(applyjob)); }
public ActionResult Create([Bind(Include = "ApplyId,CertificationID,StudentID,Comments,StatusID")] tbl_Apply tbl_Apply) { if (ModelState.IsValid) { tbl_Apply.StatusID = 1; db.tbl_Apply.Add(tbl_Apply); db.SaveChanges(); return(Content("<html><body><script>alert('Applied successfully'); window.location.href = '/tbl_Apply/MyIndex';</script></body></html>")); } ViewBag.CertificationID = new SelectList(db.tbl_Certification, "CertificationID", "CertificationName", tbl_Apply.CertificationID); ViewBag.StatusID = new SelectList(db.tbl_Status, "StatusID", "Status", 1, tbl_Apply.tbl_Status.Status); ViewBag.StudentID = new SelectList(db.tbl_Student, "StudentID", "FirstName", tbl_Apply.StudentID); return(View(tbl_Apply)); }
public ActionResult Create(tbl_Certification tbl_Certification) { try { if (ModelState.IsValid) { db.tbl_Certification.Add(tbl_Certification); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception) { TempData["Message"] = "These details are already existed"; } return(View(tbl_Certification)); }
public ActionResult AdminEdit(tbl_Admin std) { var d = Context.tbl_Admin.Where(x => x.AdminID == std.AdminID).FirstOrDefault(); d.AdminID = std.AdminID; d.FirstName = std.FirstName; d.LastName = std.LastName; d.Password = Convert.ToString(Session["Password"]); d.Username = std.Username; d.Contact = std.Contact; d.Email = std.Email; if (TryUpdateModel(d)) { Context.SaveChanges(); ModelState.Clear(); return(RedirectToAction("AdminPersonalInfo")); } return(View()); }
public ActionResult ResetPasswordforAdmin(tbl_Student obj) { int a = Convert.ToInt32(Session["AdminID"]); using (StudentRepositoryEntities1 db = new StudentRepositoryEntities1()) { tbl_Admin u = db.tbl_Admin.Find(a); var b = db.tbl_Admin.Where(e => e.Email.Equals(obj.Email) && e.LastName.Equals(obj.LastName) && e.Contact.Equals(obj.Contact)).FirstOrDefault(); if (b != null) { b.Password = obj.Password; db.Entry(b).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(Content("<html><body><script>alert('Password Changed successfully'); window.location.href = '/Home/StudentLogin';</script></body></html>")); //return RedirectToAction("StudentLogin"); } }