public JsonResult GetColParamCatgoryList()
        {
            log = LogFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.FullName + ":" + MethodBase.GetCurrentMethod().Name);

            var bllColParam             = new MesWeb.BLL.T_CollectedParameter();
            List <VM_CscDrop> vmCatList = new List <VM_CscDrop>();
            var colParamList            = bllColParam.DataTableToList(bllColParam.GetAllList().Tables[0]);

            if (colParamList.Count > 0)
            {
                for (int i = 0; i < colParamList.Count; i++)
                {
                    var lt      = colParamList[i];
                    var cscdrop = new VM_CscDrop {
                        label = lt.CollectedParameterName, value = lt.CollectedParameterID.ToString()
                    };
                    if (i == 0)
                    {
                        cscdrop.selected = true;
                    }
                    vmCatList.Add(cscdrop);
                }
            }
            else
            {
                log.Error("还未建立布局与数据库之间的关系");
            }
            return(Json(vmCatList));
        }
Example #2
0
        public JsonResult GetMenuParentList(int Id)
        {
            var vmSystemMenu = Utils.SystemHelper.GetSystemMenu();

            List <VM_CscDrop> pms = new List <VM_CscDrop>();
            var rootPm            = new VM_CscDrop {
                value = vmSystemMenu.MenuID.ToString(), label = vmSystemMenu.MenuName, selected = true
            };

            pms.Add(rootPm);
            foreach (var m in vmSystemMenu.SubMenus)
            {
                var cscdrop = new VM_CscDrop {
                    value = m.MenuID.ToString(), label = m.MenuName
                };
                if (m.MenuID == Id)
                {
                    cscdrop.selected = true;
                    rootPm.selected  = false;
                }
                pms.Add(cscdrop);
            }

            return(Json(pms));
        }
        public JsonResult GetAreaCategoryList()
        {
            log = LogFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.FullName + ":" + MethodBase.GetCurrentMethod().Name);

            var bllLayoutType           = new MesWeb.BLL.T_LayoutType();
            List <VM_CscDrop> vmCatList = new List <VM_CscDrop>();
            var layoutTypeList          = bllLayoutType.GetModelList("Type = 'Area'");

            if (layoutTypeList.Count > 0)
            {
                for (int i = 0; i < layoutTypeList.Count; i++)
                {
                    var lt      = layoutTypeList[i];
                    var cscdrop = new VM_CscDrop {
                        label = lt.AliasName, value = lt.LayoutTtypeID.ToString()
                    };
                    if (i == 0)
                    {
                        cscdrop.selected = true;
                    }
                    vmCatList.Add(cscdrop);
                }
            }
            else
            {
                log.Error("还未建立布局与数据库之间的关系");
            }
            return(Json(vmCatList));
        }
Example #4
0
        public JsonResult GetMenuSeqList(int Id, int menuParentID)
        {
            var subMenus = Utils.SystemHelper.GetSubSystemMenuList(menuParentID);
            var cscOpts  = new List <VM_CscDrop>();
            var count    = subMenus.Count + 1;

            //for add menu
            if (Id == -1)
            {
                for (int i = 1; i <= count; i++)
                {
                    var cscdrop = new VM_CscDrop {
                        value = i.ToString(), label = i.ToString()
                    };
                    if (i == count)
                    {
                        cscdrop.label = "最后";

                        cscdrop.selected = true;
                    }
                    cscOpts.Add(cscdrop);
                }
                //for edit menu
            }
            else
            {
                for (int i = 1; i < count; i++)
                {
                    var cscdrop = new VM_CscDrop {
                        value = i.ToString(), label = i.ToString()
                    };
                    if (Id == i)
                    {
                        cscdrop.selected = true;
                    }
                    cscOpts.Add(cscdrop);
                }
            }
            return(Json(cscOpts));
        }