Example #1
0
        public ISGSideBarUIService AddMenu(int groupId, int Id, LSIDEBAR categoryId, string name, string icon, string path,
                                           string badgeType = "", string badgeValue = "", string tooltip = "",
                                           bool actived     = false, bool expanded  = false, bool bUse   = true)
        {
            if (!bUse)
            {
                return(this);
            }
            ISGSideBarUI menuItem = new SGSideBarUI
            {
                GroupId    = groupId,
                Idx        = Id,
                ParentId   = Id,
                CategoryId = categoryId,
                Parent     = MenuList[groupId],
                FromName   = "",
                ToName     = name,
                Icon       = icon,
                Path       = path,
                ToolTip    = tooltip,
                BadgeType  = badgeType,
                BadgeValue = badgeValue,
                Actived    = actived,
                Expanded   = expanded,
                IsSubMenu  = true,
                Child      = null
            };

            // Same: MenuList[groupId].Child.add(menuItem);

            (MenuList[groupId] as SGSideBarUI).Child ??= new List <ISGSideBarUI>();
            MenuList[groupId].Child?.Add(menuItem);

            return(this);
        }
Example #2
0
        public ISGSideBarUIService AddRoot(int groupId, LSIDEBAR categoryId, string fromName, string toName, string icon, string path,
                                           string badgeType = "", string badgeValue = "", string tooltip = "",
                                           bool actived     = false, bool expanded  = false)
        {
            ISGSideBarUI menuItem = new SGSideBarUI
            {
                GroupId    = groupId,
                Idx        = -1,
                ParentId   = -1,
                CategoryId = categoryId,
                Parent     = null,
                FromName   = fromName,
                ToName     = toName,
                Icon       = icon,
                Path       = path,
                ToolTip    = tooltip,
                BadgeType  = badgeType,
                BadgeValue = badgeValue,
                Actived    = actived,
                Expanded   = expanded,
                IsSubMenu  = false,
                Child      = null
            };

            // Same: MenuList.add(menuItem);
            MenuList.Add(menuItem);

            return(this);
        }
Example #3
0
 /* Insert to SGAlarmInfo */
 public bool InsertAlarmInfo(int groupId, LSIDEBAR categoryId, string path, string iconImage, string head, string body)
 {
     // Create
     Log.Information("Inserting a AlarmInfo, {AlarmHead}, {AlarmBody}", head, body);
     DBCtx.Add(new SGAlarmData
     {
         Id         = 0,
         GroupId    = groupId,
         CategoryId = categoryId,
         Path       = path,
         IconImage  = iconImage,
         Head       = head,
         Body       = body,
         Time       = DateTime.Now
     }
               );
     DBCtx.SaveChanges();
     return(true);
 }
Example #4
0
 /* Insert to SGNotiInfo */
 public bool InsertNotiInfo(NOTI_TYPE type, int groupId, string userSeq, string seq, LSIDEBAR categoryId, string path, string iconImage, string head, string body)
 {
     // Create
     mut.WaitOne();
     Log.Information("Inserting a NotiInfo, {NotiHead}, {NotiBody}", head, body);
     DBCtx.Add(new SGNotiData
     {
         Id         = 0,
         Type       = type,
         GroupId    = groupId,
         UserSeq    = userSeq,
         Seq        = seq,
         CategoryId = categoryId,
         Path       = path,
         IconImage  = iconImage,
         Head       = head,
         Body       = body,
         Time       = DateTime.Now
     }
               );
     DBCtx.SaveChanges();
     mut.ReleaseMutex();
     return(true);
 }