///<inheritdoc /> public void DeleteCells(Sheet forecastSheet, IEnumerable <Period> periods, IEnumerable <ForecastColumn> columns) { forecastSheet.CheckArgumentNull(nameof(forecastSheet)); forecastSheet.Id.CheckArgumentEmpty(nameof(forecastSheet.Id)); periods.CheckArgumentNull(nameof(periods)); columns.CheckArgumentNull(nameof(columns)); var schemaName = UserConnection.EntitySchemaManager .GetItemByUId(forecastSheet.ForecastEntityInCellUId).Name; var deleteQuery = new Delete(UserConnection) .From(schemaName) .Where("SheetId").IsEqual(Column.Parameter(forecastSheet.Id)); if (columns.IsNotEmpty()) { deleteQuery .And("ForecastColumnId").In(Column.Parameters(columns.Select(c => c.Id))); } if (periods.IsNotEmpty()) { deleteQuery .And("PeriodId").In(Column.Parameters(periods.Select(p => p.Id))); } deleteQuery.Execute(); }
/// <summary> /// Removes not actual section in workplace registration for <paramref name="workplace"/>. /// </summary> /// <param name="workplace"><see cref="Workplace"/> instance.</param> private void DeleteRemovedSections(Workplace workplace) { var delete = new Delete(_userConnection) .From("SysModuleInWorkplace") .Where("SysWorkplaceId").IsEqual(Column.Parameter(workplace.Id)); if (workplace.HasSections()) { delete = delete.And("SysModuleId").Not().In(Column.Parameters(workplace.GetSectionIds())); } delete.Execute(); }
/// <summary> /// Sets request filters. /// </summary> /// <param name="deleteQuery">Delete query.</param> protected virtual void AddFilters(Delete deleteQuery) { AddRemindingFilters(deleteQuery, RemindingConsts.NotificationTypeNotificationId); deleteQuery.And("Reminding", "IsRead").IsEqual(Column.Parameter(true)); }