public ActionResult DeleteConfirmed(int id) { HelpLevel1 helpLevel1 = db.HelpLevel1.Find(id); db.HelpLevel1.Remove(helpLevel1); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Title,ImageFile,Index")] HelpLevel1 helpLevel1) { if (ModelState.IsValid) { db.Entry(helpLevel1).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(helpLevel1)); }
// GET: HelpOnline/AdminLevel1/Details/5 public ActionResult Details(int id) { HelpLevel1 helpLevel1 = helpLevel1DB.GetHelpLevel1ById(id); if (helpLevel1 == null) { return(HttpNotFound()); } return(View(helpLevel1)); }
public ActionResult Create([Bind(Include = "Id,Title,ImageFile,Index")] HelpLevel1 helpLevel1) { if (ModelState.IsValid) { db.HelpLevel1.Add(helpLevel1); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(helpLevel1)); }
// GET: HelpOnline/HelpLevel1/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HelpLevel1 helpLevel1 = db.HelpLevel1.Find(id); if (helpLevel1 == null) { return(HttpNotFound()); } return(View(helpLevel1)); }
// GET: HelpOnline/AdminLevel1/Delete/5 public ActionResult Delete(int id) { if (id == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HelpLevel1 helpLevel1 = helpLevel1DB.GetHelpLevel1ById(id); if (helpLevel1 == null) { return(HttpNotFound()); } // helpLevel1DB.DeleleHelpLevel1(id); return(View(helpLevel1)); }
// GET: HelpOnline/AdminLevel2/Index/5 public ActionResult Index(int?id) { if (id == null) { TempData["parentTitle"] = "All"; return(View(helpLevel2DB.ListAll())); } HelpLevel1 parent = helpLevel1DB.GetHelpLevel1ById(id.Value); if (parent == null) { return(HttpNotFound()); } TempData["parentTitle"] = parent.Title; TempData["parentId"] = parent.Id; return(View(helpLevel2DB.LoadHelpLevel2ByParentId(id.Value))); }
public ActionResult Create(HelpLevel1 helpLevel1) { if (ModelState.IsValid) { string fileName = Path.GetFileName(helpLevel1.ImageFileObj.FileName); //string fileExtension = Path.GetExtension(helpLevel1.ImageFileObj.FileName); //Get Upload path from Web.Config file AppSettings. string uploadPath = ConfigurationManager.AppSettings["HelpOnlineImagePath"].ToString() + "HelpOnlineLevel1/"; //Its Create complete path to store in server. helpLevel1.ImageFile = fileName;//Server.MapPath(uploadPath + fileName); //To copy and save file into server. helpLevel1.ImageFileObj.SaveAs(Server.MapPath(uploadPath + fileName)); helpLevel1DB.InsertLevel1(helpLevel1); return(RedirectToAction("Index")); } return(View()); }
// GET: HelpOnline/AdminLevel2/Edit/5 public ActionResult Edit(int id) { if (id == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HelpLevel2 helpLevel2 = helpLevel2DB.GetHelpLevel2ById(id); if (helpLevel2 == null) { return(HttpNotFound()); } HelpLevel1 helpLevel1 = helpLevel1DB.GetHelpLevel1ById(helpLevel2.ParentId); if (helpLevel1 == null) { return(HttpNotFound()); } helpLevel2.ParentTopic = helpLevel1; return(View(helpLevel2)); }