private async Task DeleteUser(IDestination destination, UserDestinationModel userDestination, string[] args)
        {
            if (args.Contains("--force"))
            {
                await destination.Delete(userDestination);

                _logger.LogInformation($"{destination.GetType().Name}: User with name of '{userDestination.FullName}' was deleted");
            }
            else
            {
                _logger.LogWarning($"The user to be deleted: {userDestination.Login}");
            }
        }
예제 #2
0
        /// <summary>
        /// Executa ação definida para o registro no objeto de destino
        /// </summary>
        /// <param name="rowOp">Operação que deverás er executada</param>
        /// <param name="transformedRow">Linha que foi transformada</param>
        public void ProcessTransformedRow(RowOperation rowOp, DictionaryRow transformedRow)
        {
            if (this.RowBeforeProcess != null)
            {
                this.RowBeforeProcess(transformedRow, rowOp);
            }

            try
            {
                switch (rowOp)
                {
                case RowOperation.Process:
                    _dest.Process(transformedRow);
                    break;

                case RowOperation.Insert:
                    _dest.Insert(transformedRow);
                    break;

                case RowOperation.Update:
                    _dest.Update(transformedRow);
                    break;

                case RowOperation.Delete:
                    _dest.Delete(transformedRow);
                    break;
                }

                if (this.RowSuccess != null && rowOp != RowOperation.Ignore)
                {
                    this.RowSuccess(transformedRow, rowOp);
                }
            }
            catch (Exception exRow)
            {
                if (this.RowError != null)
                {
                    this.RowError(transformedRow, rowOp, exRow);
                }
                else
                {
                    throw exRow;
                }
            }

            if (this.RowAfterProcess != null)
            {
                this.RowAfterProcess(transformedRow, rowOp);
            }
        }
예제 #3
0
 /// <summary>
 /// 删除该目的地及所有属下分类数据
 /// </summary>
 public void Delete(int Id)
 {
     DestDAL.Delete(Id);
 }