public List <CategoryDTO> GetListCategory() { List <CategoryDTO> LsDTO = CategoryConvert.FromDBToDTO(CategoryDB.GetParent()); foreach (CategoryDTO dto in LsDTO) { dto.ListChildCategory = GetChildCategory(int.Parse(dto.Id)); } return(LsDTO); }
public List <CategoryDTO> GetChildCategory(int Id) { return(CategoryConvert.FromDBToDTO(CategoryDB.GetChild(Id))); }
public String AddCategory(CategoryDTO DTO) { return(CategoryDB.Add(CategoryConvert.FromDTOToDB(DTO))); }