예제 #1
0
        public string Create(int parentId)
        {
            string SourcePath = string.Empty;

            if (parentId != 0)
            {
                SourcePath = _MenuService.Find(parentId)?.SourcePath;
            }
            var menu = new Menu()
            {
                CreatorId   = 1,
                Name        = "new",
                ParentId    = parentId,
                SourcePath  = SourcePath + "/",
                Sort        = 100,
                MenuLevel   = 1,
                Url         = string.Empty,
                State       = 1,
                Description = string.Empty
            };

            menu.CreateTime = DateTime.Now;
            int iResult = 0;

            iResult = _MenuService.AddMenuReturnId(menu);

            return(iResult.ToString());
        }