Example #1
0
        public void UpdateDrinkCategory(DrinkCategoryDto drinkCategoryDto)
        {
            var drinkCategory = drinkCategoryRepository.GetBy(drinkCategoryDto.Id);

            drinkCategoryDto.MappingDrinkCategory(drinkCategory);
            drinkCategoryRepository.Update(drinkCategory);
        }
Example #2
0
 public static DrinkCategory MappingDrinkCategory(this DrinkCategoryDto drinkCategoryDto)
 {
     return(new DrinkCategory
     {
         Id = drinkCategoryDto.Id,
         Title = drinkCategoryDto.Title
     });
 }
Example #3
0
        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();
        }
Example #4
0
 public void Update(DrinkCategoryDto drinkCategoryDto)
 {
     drinkCategoryService.UpdateDrinkCategory(drinkCategoryDto);
 }
Example #5
0
 public void Create(DrinkCategoryDto drinkCategoryDto)
 {
     drinkCategoryService.CreateDrinkCategory(drinkCategoryDto);
 }
Example #6
0
 public static void MappingDrinkCategory(this DrinkCategoryDto drinkCategoryDto, DrinkCategory drinkCategory)
 {
     drinkCategory.Id    = drinkCategoryDto.Id;
     drinkCategory.Title = drinkCategoryDto.Title;
 }
Example #7
0
        public void CreateDrinkCategory(DrinkCategoryDto drinkCategoryDto)
        {
            var drinkCategory = drinkCategoryDto.MappingDrinkCategory();

            drinkCategoryRepository.Add(drinkCategory);
        }