Esempio n. 1
0
        public ActionResult Edit(Guid?id)
        {
            var back = new Back();

            ViewBag.tag = "参数新增";
            if (id.HasValue)
            {
                back        = _ibackService.GetById(id.Value);
                ViewBag.tag = "参数编辑";
            }

            //模块
            var ListModual = _imodularService.GetAll().Select(t => new {
                t.Id,
                t.ModularName
            }).ToList();

            ViewBag.Mo = new SelectList(ListModual, "Id", "ModularName", back.ModularID);
            //接口
            Guid modualid = Guid.Empty;

            if (ListModual.Count != 0 && (back.ModularID == Guid.Empty || back.ModularID == null))
            {
                modualid = ListModual.FirstOrDefault().Id;
            }
            var Listport = _iportsService.GetAll().Where(t => t.ModularID == modualid).Select(t => new {
                t.Id,
                t.PortsName
            }).ToList();

            ViewBag.po = new SelectList(Listport, "Id", "PortsName", back.PortsID);


            return(View(back));
        }
Esempio n. 2
0
        public string GetPost(string modualID)
        {
            Guid id = Guid.Parse(modualID);

            var Listport = _iportsService.GetAll().Where(t => t.ModularID == id).Select(t => new {
                t.Id,
                t.PortsName
            }).ToList();

            return(JsonConvert.SerializeObject(Listport));
        }
Esempio n. 3
0
        // GET: Admin/Ports
        public ActionResult Index(string keyword, string ordering, int pageIndex = 1)
        {
            ViewBag.tag = "接口管理";

            var list = _iportsService.GetAll().Select(t => new {
                t.Modular.ModularName,
                t.PortsName,
                t.PortsIp,
                t.PortsAddress,
                t.PortsType,
                t.IsPag,
                t.Remark,
                t.IsTure,
                t.Id
            });

            return(View(list.ToPagedList(pageIndex)));
        }