public ActionResult Detail(int Id) { PersonnelMobileInspectionItem pmi = bll.PersonnelMobileInspectionItems.Find(Id); MobileInspectionDev MobileInspectionDev = bll.MobileInspectionDevs.Find(pmi.DevId); if (pmi == null || MobileInspectionDev == null) { return(HttpNotFound()); } ViewBag.Dev = MobileInspectionDev; return(View(pmi)); }
public ActionResult Detail(int id, string backTarget) { MobileInspectionItem MobileInspectionItem = bll.MobileInspectionItems.Find(id); MobileInspectionDev MobileInspectionDev = bll.MobileInspectionDevs.Find(MobileInspectionItem.DevId); if (MobileInspectionItem == null || MobileInspectionDev == null) { return(HttpNotFound()); } ViewBag.Dev = MobileInspectionDev; ViewBag.backTarget = backTarget; return(View(MobileInspectionItem)); }
public ActionResult Create(MobileInspectionDev MobileInspectionDev) { int DevID = MobileInspectionDev.Id; MobileInspectionDev MobileInspectionDev2 = bll.MobileInspectionDevs.Find(DevID); if (MobileInspectionDev2 == null) { DevInfo DevInfo = bll.DevInfos.Find(DevID); MobileInspectionDev.Name = DevInfo.Name; bll.MobileInspectionDevs.Add(MobileInspectionDev); } return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { MobileInspectionDev MobileInspectionDev = bll.MobileInspectionDevs.Find(id); List <int> lst = new List <int>(); foreach (MobileInspectionContent MobileInspectionContent in MobileInspectionDev.MobileInspectionContents) { lst.Add(MobileInspectionContent.Id); } foreach (int mId in lst) { bll.MobileInspectionContents.DeleteById(mId); } bll.MobileInspectionDevs.DeleteById(id); int ItemId = bll.MobileInspectionItems.DbSet.Where(p => p.Id == id).Select(p => p.Id).FirstOrDefault(); bll.MobileInspectionItems.DeleteById(ItemId); return(RedirectToAction("Index")); }
public ActionResult Detail(int id) { MobileInspectionDev MobileInspectionDev = bll.MobileInspectionDevs.Find(id); return(View(MobileInspectionDev)); }
public ActionResult Edit2(MobileInspectionDev MobileInspectionDev) { bll.MobileInspectionDevs.Edit(MobileInspectionDev); return(RedirectToAction("Index")); }
public ActionResult Edit(string id) { MobileInspectionDev MobileInspectionDev = bll.MobileInspectionDevs.Find(id); return(View(MobileInspectionDev)); }