public async Task Should_Insert_CommissionAgent() { var id = _commissionAgentDataServices.NewId(); var commissionAgent = _commissionAgentDataServices.GetNewDo(id); var commissionAgentTypeData = new CommissionAgentTypeData(); commissionAgentTypeData.Code = "2"; commissionAgentTypeData.Name = "KARVE INFORMATICA S.L"; // commissionAgent.Type = commissionAgentTypeData; var dataCountry = new CountryData(); dataCountry.Code = "34"; dataCountry.CountryName = "Spain"; // commissionAgent.Country = dataCountry; ComisioViewObject comisio = (ComisioViewObject)commissionAgent.Value; comisio.NUM_COMI = _commissionAgentDataServices.NewId(); Assert.NotNull(comisio.NUM_COMI); comisio.TIPOCOMI = "2"; comisio.CP = "080012"; comisio.NOMBRE = "Giorgio"; comisio.DIRECCION = "Via Augusta 32"; comisio.EMAIL = "*****@*****.**"; commissionAgent.Value = comisio; bool cAgent = await _commissionAgentDataServices.SaveAsync(commissionAgent); Assert.True(cAgent); }
public CommissionAgent() { _currentComisio = new COMISIO(); _commissionAgents = new List <COMISIO>(); _nacioPer = new List <Country>(); _tipoComis = new List <TIPOCOMI>(); _provinces = new List <PROVINCIA>(); _commissionAgentType = new CommissionAgentTypeData(); _mapper = MapperField.GetMapper(); }
public CommissionAgent(ISqlExecutor executor, string commissionId) { _executor = executor; _currentComisio = new COMISIO(); _currentComisio.NUM_COMI = commissionId; _commissionAgents = new List <COMISIO>(); _nacioPer = new List <Country>(); _tipoComis = new List <TIPOCOMI>(); _provinces = new List <PROVINCIA>(); _commissionAgentType = new CommissionAgentTypeData(); _mapper = MapperField.GetMapper(); }
private ICommissionAgentTypeData GetCommissionAgentType(COMISIO data, IEnumerable <TIPOCOMI> tipocomis) { ICommissionAgentTypeData dataCommission = new CommissionAgentTypeData(); dataCommission.Code = data.TIPOCOMI; // there is a na errro we return a null AgentTypeData if (!tipocomis.Any()) { return(new NullCommissionAgentTypeData()); } var name = from countryvalue in tipocomis where countryvalue.NUM_TICOMI == data.TIPOCOMI select countryvalue.NOMBRE; dataCommission.Name = name.Distinct().First(); return(dataCommission); }