public SyncItems SyncPaymentMethods() { var response = new SyncItems(); _foccoWebFormaPagamentoRepository.ExecuteSqlCommand("UPDATE FoccoWebApiFormaPagamento SET Ativo = 0;"); var apiReq = new GetPaymentConditionsCommandRequest(); var apiResp = base._foccoErpApiCommands.GetPaymentConditionsCommand(apiReq); if (apiResp.Success && apiResp.GetPaymentConditionsResponse.Rows != null) { var rows = apiResp.GetPaymentConditionsResponse.Rows.DistinctBy(x => x.ID, null); foreach (var row in rows) { InsertUpdatePaymentMethods(row); response.TotalProcessedRows += 1; } base._unitOfWork.Commit(); response.TotalRowCount = apiResp.GetPaymentConditionsResponse.Rows.Count; } response.EndOfRecords = true; return(response); }
public virtual GetPaymentConditionsCommandResponse GetPaymentConditionsCommand(GetPaymentConditionsCommandRequest request) { var response = new GetPaymentConditionsCommandResponse(); try { // Raise Initialization Event var initialization = GetPaymentConditionsCommandInitialization; if (initialization != null) { initialization(request, response); } // Raise Execute Event var execute = GetPaymentConditionsCommandExecute; if (execute != null) { response = execute(request); } // Raise Complete Event var complete = GetPaymentConditionsCommandComplete; if (complete != null) { complete(request, response); } } catch (Exception exception) { // Raise Error Event var error = GetPaymentConditionsCommandError; if (error != null) { error(request, response, exception); } } return(response); }
public override GetPaymentConditionsCommandResponse OnGetPaymentConditionsCommandExecute(GetPaymentConditionsCommandRequest request) { var response = new GetPaymentConditionsCommandResponse(); try { response.GetPaymentConditionsResponse = _apiCommands.ApiGetPaymentConditions(); } catch (Exception ex) { response.Exception = ex; response.Message = ex.Message; } return(response); }
public abstract GetPaymentConditionsCommandResponse OnGetPaymentConditionsCommandExecute(GetPaymentConditionsCommandRequest request);