public void UpdateDrinkCategory(DrinkCategoryDto drinkCategoryDto) { var drinkCategory = drinkCategoryRepository.GetBy(drinkCategoryDto.Id); drinkCategoryDto.MappingDrinkCategory(drinkCategory); drinkCategoryRepository.Update(drinkCategory); }
public static DrinkCategory MappingDrinkCategory(this DrinkCategoryDto drinkCategoryDto) { return(new DrinkCategory { Id = drinkCategoryDto.Id, Title = drinkCategoryDto.Title }); }
private void btnAdd_Click(object sender, EventArgs e) { var drinkCategoryDto = new DrinkCategoryDto { Title = txtName.Text }; drinkCategoryController.Create(drinkCategoryDto); MessageBox.Show("You added new category successfully", "Notification"); refresh(); }
public void Update(DrinkCategoryDto drinkCategoryDto) { drinkCategoryService.UpdateDrinkCategory(drinkCategoryDto); }
public void Create(DrinkCategoryDto drinkCategoryDto) { drinkCategoryService.CreateDrinkCategory(drinkCategoryDto); }
public static void MappingDrinkCategory(this DrinkCategoryDto drinkCategoryDto, DrinkCategory drinkCategory) { drinkCategory.Id = drinkCategoryDto.Id; drinkCategory.Title = drinkCategoryDto.Title; }
public void CreateDrinkCategory(DrinkCategoryDto drinkCategoryDto) { var drinkCategory = drinkCategoryDto.MappingDrinkCategory(); drinkCategoryRepository.Add(drinkCategory); }