Esempio n. 1
0
        public async Task <ActionResult> Put(int id, MaterialTypeUpsertDto materialTypeUpsertDto)
        {
            await _materialTypeService.UpdateMaterialType(id, materialTypeUpsertDto);

            _logger.LogInformation(LogMessages.EntityUpdated);
            return(Ok());
        }
Esempio n. 2
0
        public ActionResult AddOrUpdate(MaterialTypeViewModel entity)
        {
            if (ModelState.IsValid)
            {
                if (entity.Id.HasValue)
                {
                    TempData["result"] = materialTypeService.UpdateMaterialType(entity);
                }
                else
                {
                    TempData["result"] = materialTypeService.AddMaterialType(entity);
                }
            }

            return(View());
        }