// GET: /FeeStudent/Details/5 public ActionResult Details(int?id) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FeesStudent feesstudent = db.FeesStudents.Find(id); if (feesstudent == null) { return(HttpNotFound()); } return(View(feesstudent)); }
public ActionResult Edit([Bind(Include = "FeeId,StudentId,AmountPaid,SubmitDate,Id")] FeesStudent feesstudent, int?idf, string ids) { ViewBag.UserType = adtype(); if (adtype() == "Admin") { if (ModelState.IsValid) { db.Entry(feesstudent).State = EntityState.Modified; db.SaveChanges(); if (idf != null) { return(RedirectToAction("Index", new { idf = idf })); } if (ids != null) { return(RedirectToAction("Index", new { ids = ids })); } return(RedirectToAction("Index")); } ViewBag.idf = idf; ViewBag.ids = ids; if (idf != null) { ViewBag.Showf = false; ViewBag.shows = true; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } else if (ids != null) { ViewBag.Showf = true; ViewBag.shows = false; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } else { ViewBag.Showf = true; ViewBag.shows = true; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } return(View(feesstudent)); } return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); }
public ActionResult DeleteConfirmed(int id, int?idf, string ids) { ViewBag.UserType = adtype(); if (adtype() == "Admin") { FeesStudent feesstudent = db.FeesStudents.Find(id); db.FeesStudents.Remove(feesstudent); db.SaveChanges(); if (idf != null) { return(RedirectToAction("Index", new { idf = idf })); } if (ids != null) { return(RedirectToAction("Index", new { ids = ids })); } return(RedirectToAction("Index")); } return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); }
// GET: /FeeStudent/Delete/5 public ActionResult Delete(int?id, int?idf, string ids) { ViewBag.UserType = adtype(); if (adtype() == "Admin") { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FeesStudent feesstudent = db.FeesStudents.Find(id); if (feesstudent == null) { return(HttpNotFound()); } ViewBag.idf = idf; ViewBag.ids = ids; return(View(feesstudent)); } return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); }
// GET: /FeeStudent/Edit/5 public ActionResult Edit(int?id, int?idf, string ids) { ViewBag.UserType = adtype(); if (adtype() == "Admin") { ViewBag.idf = idf; ViewBag.ids = ids; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FeesStudent feesstudent = db.FeesStudents.Find(id); if (feesstudent == null) { return(HttpNotFound()); } if (idf != null) { ViewBag.Showf = false; ViewBag.shows = true; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } else if (ids != null) { ViewBag.Showf = true; ViewBag.shows = false; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } else { ViewBag.Showf = true; ViewBag.shows = true; ViewBag.FeeId = new SelectList(db.Fees, "Id", "Name", feesstudent.FeeId); ViewBag.StudentId = new SelectList(db.Students, "Id", "RegistrationNo", feesstudent.StudentId); } return(View(feesstudent)); } return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); }