/// <summary> /// Get person by id Dto /// </summary> /// <param name="id">Id person to search</param> /// <returns>Return object person</returns> public static PersonDto GetDto(long id, ModelUnibookContainer objContex) { PersonDto personDto = null; try { Person person = PersonDal.Get(id, objContex); personDto = new PersonDto(); personDto.PersonId = person.PersonId; personDto.Name = person.Name; personDto.LastName = person.LastName; personDto.BirthDay = person.Birthday; personDto.Deleted = person.Deleted; personDto.Gender = GenderBrl.GetDto(person.Gender.GenderId, objContex); } catch (DbEntityValidationException ex) { throw ex; } catch (Exception ex) { throw ex; } return(personDto); }
/// <summary> /// Get list gender /// </summary> /// <param name="objContex">Get table to object</param> /// <returns></returns> public static List <GenderDto> GetAll(ModelUnibookContainer objContex) { try { List <GenderDto> genderList = new List <GenderDto>(); foreach (var item in GenderDal.GetAll(objContex)) { genderList.Add(GenderBrl.GetDto(item.GenderId, objContex)); } return(genderList); } catch (DbEntityValidationException ex) { throw ex; } catch (Exception ex) { throw ex; } }