public ActionResult DeleteConfirmed(int id) { if (Session["adminID"] == null) { return(RedirectToAction("loginadmin")); } result_uploader result_uploader = db.result_uploader.Find(id); db.result_uploader.Remove(result_uploader); db.SaveChanges(); return(RedirectToAction("viewuploader")); }
public ActionResult createuploader([Bind(Include = "Id,UID,name,branch,pssd")] result_uploader result_uploader) { if (Session["adminID"] == null) { return(RedirectToAction("loginadmin")); } if (ModelState.IsValid) { db.result_uploader.Add(result_uploader); db.SaveChanges(); return(RedirectToAction("viewuploader")); } return(View(result_uploader)); }
// GET: result_uploader/Delete/5 public ActionResult deleteuploader(int?id) { if (Session["adminID"] == null) { return(RedirectToAction("loginadmin")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } result_uploader result_uploader = db.result_uploader.Find(id); if (result_uploader == null) { return(HttpNotFound()); } return(View(result_uploader)); }
public ActionResult uploaderlogin(result_uploader rp) { if (ModelState.IsValid) { var result = db.result_uploader.Where(a => a.UID == rp.UID & a.pssd == rp.pssd).FirstOrDefault(); if (result != null) { Session["UID"] = result.UID; Session["ID"] = result.Id; Session["ub"] = result.branch; return(RedirectToAction("Index")); } else { ViewBag.message = "Wrong Credentials"; } } return(View()); }