示例#1
0
        /// <summary>
        /// 메뉴 추가
        /// </summary>
        public TabModel Add(TabModel model)
        {
            string sql   = @"
                Insert Into Tabs
                (
                    [TabOrder], 
                    [ParentId], 
                    [TabName], 
                    [TabPath], 
                    [IsVisible], 
                    [CommunityId], 
                    [IsBoard], 
                    [Target],
                    [BoardAlias]
                )
                Values
                (
                    @TabOrder, 
                    @ParentId, 
                    @TabName, 
                    @TabPath, 
                    @IsVisible, 
                    @CommunityId, 
                    @IsBoard, 
                    @Target,
                    @BoardAlias
                );

                Select Cast(SCOPE_IDENTITY() As Int);
            ";
            var    TabId = db.Query <int>(sql, model).Single();

            model.TabId = TabId;
            return(model);
        }
示例#2
0
        public TabModel Update(TabModel model)
        {
            var sql =
                " Update Tabs                  " +
                " Set                            " +
                "    TabName       =       @TabName,   " +
                "    TabOrder       =       @TabOrder,   " +
                "    TabPath       =       @TabPath,   " +
                "    IsVisible       =       @IsVisible,   " +
                "    IsBoard       =       @IsBoard,   " +
                "    Target       =       @Target,   " +
                "    BoardAlias       =       @BoardAlias " +
                " Where TabId = @TabId                 ";

            db.Execute(sql, model);
            return(model);
        }