public ActionResult Save(string verId) { if (!verId.IsNullOrEmpty()) { var obj = ProductRoleVerService.Get(verId); 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"); if (!obj.ModuleId.IsNullOrEmpty()) { ViewBag.usecode = "v" + ProductModelVerService.Get(obj.ModuleId).VerCode.ToString("f1"); } var model = ProductModelVerService.GetOfficialLast(obj.ProductId); ViewBag.newcode = model == null?"": "v" + model.VerCode.ToString("f1"); } else { ViewBag.products = ListToSelect(ProductRoleVerService.GetProductVers().Select(o => new SelectListItem() { Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString() }), emptyTitle: "请选择"); ViewBag.state = "未发布,未生效"; ViewBag.status = "--"; } return(View()); }
public ActionResult Index() { ViewBag.products = ListToSelect(ProductVerService.GetList(1, 2).Select(o => new SelectListItem() { Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString() }), emptyTitle: "全部"); return(View()); }
public ActionResult SaveSql(int verId) { var pmenus = new List <DropdownItem>(); var obj = ProductPublishVerService.Get(verId); var menuModelId = ""; var runSqlWay = 1; 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"); ProductModuleVer model = null; if (!obj.MenuModuleId.IsNullOrEmpty()) { model = ProductModelVerService.Get(obj.MenuModuleId); } else { model = ProductModelVerService.GetOfficialLast(obj.ProductId); } if (model != null) { menuModelId = model.ModuleId; pmenus.AddRange(model.ProductMenuLimits.Where(o => o.PMenuId <= 0).OrderBy(o => o.SortOrder).Select(o => new DropdownItem() { Text = o.Title, Value = o.MenuId.ToString() })); } if (pmenus.Any()) { pmenus[0].IsSelected = true; } runSqlWay = obj.RunSqlWay == 2?2:1; } else { ViewBag.products = ListToSelect(ProductVerService.GetList(1).Select(o => new SelectListItem() { Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString() }), emptyTitle: "请选择"); ViewBag.state = "未发布,未生效"; ViewBag.status = "--"; } ViewBag.pmenus = pmenus.ToJson(); ViewBag.menuModelId = menuModelId; ViewBag.runSqlWay = runSqlWay; return(View()); }
public ActionResult Limits(string modelId) { var obj = ProductModelVerService.Get(modelId); obj.IsNullThrow(); 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"); return(View()); }
public ActionResult Save(int?verId) { if (verId.HasValue) { ViewBag.products = ListToSelect(ProductVerService.GetList().Select(o => new SelectListItem() { Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString() }), emptyTitle: "请选择"); } else { ViewBag.products = ListToSelect(ProductPublishVerService.GetProductVers().Select(o => new SelectListItem() { Text = "(" + o.ProductId + ")" + o.SysName, Value = o.ProductId.ToString() }), emptyTitle: "请选择"); } ProductPublishVer ver = verId.HasValue ?ProductPublishVerService.Get(verId.Value):new ProductPublishVer(); return(View(ver)); }
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()); }