public JsonResult GetShipmentTermsByCountry(Guid countryId) { var country = _countryRepository.GetCountry(countryId); CountryViewModel convertedModel = new CountryConverter().ConvertToView(country); return(Json(convertedModel, JsonRequestBehavior.AllowGet)); }
public JsonResult EditShipmentTerms(CountryViewModel model) { var operationResult = new OperationResult(); Country country = new CountryConverter().ConvertToDomain(model); operationResult = _countryRepository.UpdateCountry(country); return(Json(operationResult, JsonRequestBehavior.AllowGet)); }
public List <Country> GetCountries() { DataTable table = _dbContext.GetDataTable(Tables.Countries.SelectAllTable, null); if (table != null) { return(CountryConverter.TableToCountries(table)); } return(new List <Country>()); }
public Country GetCountry(int id) { IList <DbParameter> parameters = new List <DbParameter>() { new MySqlParameter("@id", id) }; DataRow row = _dbContext.GetDataRow(Tables.Countries.Select, parameters); return(CountryConverter.RowToCountry(row)); }
private PortableUserDto MakePortableUserDto(User user) { var portableUserDto = _mapper.Map <PortableUserDto>(user); portableUserDto.CountryName = CountryConverter.GetCountryEnglish(user.Country); portableUserDto.SexType = SexConverter.GetSexEnglish(user.Sex); portableUserDto.ChallengeGiven = user.GivenChallenges.Count; portableUserDto.ChallengeReceived = user.ReceivedChallenges.Count; portableUserDto.RetrievalDate = DateTime.Now; portableUserDto.Workouts = MakePortableWorkoutDto(user.Workouts); portableUserDto.BirthDay = user.BirthDate; portableUserDto.CreationDate = user.CreationDate; return(portableUserDto); }