public ActionResult SoftDownList() { int UserID = int.Parse(TakeCookie.GetCookie("userId")); Tb_ApplyTable modelTable = (Tb_ApplyTable)mHelp.GetModelBy <Tb_ApplyTable>(m => m.UserID == UserID); if (modelTable != null) { List <Tb_ApplySoftList> list = mHelp.GetListBy <Tb_ApplySoftList>(m => m.ApplyID == modelTable.ApplyID); if (list != null) { List <Tb_SoftList> listSoft = new List <Tb_SoftList>(); foreach (Tb_ApplySoftList item in list) { Tb_SoftList soft = (Tb_SoftList)mHelp.GetModelBy <Tb_SoftList>(m => m.SoftID == item.SoftID); if (soft != null) { listSoft.Add(soft); } } if (listSoft != null) { ViewBag.listSoft = listSoft; return(View()); } } } return(View("index")); //List<Tb_SoftList> listSoft = mHelp.GetAll<Tb_SoftList>(); }
public ActionResult DeleteConfirmed(int id) { Tb_SoftList tb_softlist = db.Tb_SoftList.Find(id); db.Tb_SoftList.Remove(tb_softlist); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /AdminSoftManage/Delete/5 public ActionResult Delete(int id = 0) { Tb_SoftList tb_softlist = db.Tb_SoftList.Find(id); if (tb_softlist == null) { return(HttpNotFound()); } return(View(tb_softlist)); }
public ActionResult Edit(Tb_SoftList tb_softlist) { if (ModelState.IsValid) { db.Entry(tb_softlist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_softlist)); }
public ActionResult Create(Tb_SoftList tb_softlist) { if (ModelState.IsValid) { db.Tb_SoftList.Add(tb_softlist); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tb_softlist)); }