コード例 #1
0
        public async Task SortWidgets(int storyBoardId, IEnumerable <WidgetSortModel> widgetSorts)
        {
            var sqlParameters = _sqlEngine.AddSqlParameter("@StoryBoardID", storyBoardId);

            if (widgetSorts.Any())
            {
                var dataTable = new DataTable("TVP_WidgetSort");
                dataTable.Columns.Add("ID", typeof(int));
                dataTable.Columns.Add("Sort", typeof(int));
                dataTable.Columns.Add("WidgetType", typeof(int));

                foreach (var sort in widgetSorts)
                {
                    dataTable.Rows.Add(sort.Id, sort.Sort, sort.WidgetType);
                }
                _sqlEngine.AddSqlParameter("@WidgetSorts", dataTable, sqlParameters);
            }

            await _sqlEngine.ExecuteStoredProcedure("spUpdateWidgetSort", sqlParameters);
        }
コード例 #2
0
 public async Task DeleteStoryBoard(int id)
 {
     var sqlParameters = _sqlEngine.AddSqlParameter("@StoryBoardID", id);
     await _sqlEngine.ExecuteStoredProcedure("spDeleteStoryBoard", sqlParameters);
 }