public ActionResult PortListExpressPartialDelete(string Id) { Id = Id.Replace("\"", ""); if (string.IsNullOrEmpty(Id)) { Id = "0"; } int id = Int32.Parse(Id); var model = new PortListPartialModel(); if (id > 0) { try { var c = dbports.Read(id); dbports.Delete(c); model.Ports = dbports.ReadAllWithFk(c.SwitchId); model.assetid = c.SwitchId; } catch (Exception e) { ViewData["EditError"] = e.Message; } } return(PartialView("~/Views/Customers/_PortListExpressPartial.cshtml", model)); }
public ActionResult PortListExpressPartial(int assetid) { var model = new PortListPartialModel() { assetid = assetid, Ports = dbports.ReadAllWithFk(assetid) }; return(PartialView("~/Views/Customers/_PortListExpressPartial.cshtml", model)); }