Esempio n. 1
0
        public ActionResult Save(string verId)
        {
            string modelId = "";
            var    obj     = ProductDataVerService.Get(verId);

            if (obj != null)
            {
                ViewBag.products = ListToSelect(ProductVerService.GetList().Select(o => new SelectListItem()
                {
                    Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString()
                }), emptyTitle: "请选择", selectValue: obj.ProductId);
                ViewBag.state  = obj.VerStatusTitle + "," + obj.StatusTitle;
                ViewBag.status = obj.VerCode == 0 ? "--" : "v" + obj.VerCode.ToString("f1");
                modelId        = obj.ModuleId;
            }
            else
            {
                ViewBag.products = ListToSelect(ProductDataVerService.GetProductVers().Select(o => new SelectListItem()
                {
                    Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString()
                }), emptyTitle: "请选择");
                ViewBag.state  = "未发布,未生效";
                ViewBag.status = "--";
            }
            var pmenus = new List <DropdownItem>();

            if (!modelId.IsNullOrEmpty())
            {
                var model = ProductModelVerService.Get(modelId);
                if (model != null)
                {
                    pmenus.AddRange(model.ProductMenuLimits.Where(o => o.PMenuId <= 0).OrderBy(o => o.SortOrder).Select(o => new DropdownItem()
                    {
                        Text = o.Title, Value = o.MenuId.ToString()
                    }));
                }
            }
            ViewBag.pmenus  = pmenus.ToJson();
            ViewBag.modelId = modelId;
            return(View());
        }
        public ActionResult Menus(string modelId)
        {
            var obj = ProductModelVerService.Get(modelId);

            if (obj != null)
            {
                ViewBag.products = ListToSelect(ProductVerService.GetList().Select(o => new SelectListItem()
                {
                    Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString()
                }), emptyTitle: "请选择", selectValue: obj.ProductId);
                ViewBag.state  = obj.VerStatusTitle + "," + obj.StatusTitle;
                ViewBag.status = obj.VerCode == 0 ? "--" : "v" + obj.VerCode.ToString("f1");
            }
            else
            {
                ViewBag.products = ListToSelect(ProductModelVerService.GetProductVers().Select(o => new SelectListItem()
                {
                    Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString()
                }), emptyTitle: "请选择");
                ViewBag.state  = "未发布,未生效";
                ViewBag.status = "--";
            }
            return(View());
        }