public ActionResult Edit(int id) { var model = _bll.Get(Query.EQ("Rid", id)); if (model == null) { return(HttpNotFound()); } ViewBag.ServiceList = FlowHelper.GetTypeSelectList("服务类型"); ViewBag.DeployTypeList = GetDeployTypeList(); if (model.DeployLocale.HasValue) { if (model.DeployDeviceType == (int)DeployDeviceTypeEnum.Physical) { ViewBag.DeployLocaleName = DependencyResolver.Current.GetService <PhysicalDeviceController>() .GetHostDeviceName(model.DeployLocale.Value); } else { ViewBag.DeployLocaleName = DependencyResolver.Current.GetService <VirtualDeviceController>() .GetVirtualDeviceName(model.DeployLocale.Value); } } return(View(model)); }
public string GetVirtualDeviceName(int rId) { var model = _bll.Get(Query<VirtualDevice>.EQ(t => t.Rid, rId)); if (model==null) throw new HttpException(404, "记录未找到"); return model.MachineName; }
public string GetHostDeviceName(int rId) { var model = _bll.Get(Query <PhysicalDevice> .EQ(t => t.Rid, rId)); if (model == null) { throw new HttpException(404, "记录未找到"); } return(model.MachineName); }
public ActionResult Edit(int id) { var model = _bll.Get(Query.EQ("Rid", id)); if (model == null) { return(HttpNotFound()); } ViewBag.BasicTypeList = CommonHelper.BasicTypeList; return(View(model)); }