Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }