Example #1
0
        // GET: Packagings/Details/5
        public async Task <ActionResult> Details(Guid id)
        {
            var packaging = new PackagingDetailsViewModel();

            try
            {
                var result = await _packagingService.FindById(id);

                if (!result.Success)
                {
                    Alert($"Error! {result.Message}", NotificationType.info, Int32.Parse(_appConfig.Value.NotificationDisplayTime));
                    return(View(packaging));
                }
                packaging.Code            = result.Data.Code;
                packaging.Id              = result.Data.Id;
                packaging.Name            = result.Data.Name;
                packaging.Description     = result.Data.Description;
                packaging.DateCreated     = result.Data.CreatedAt;
                packaging.DateLastUpdated = result.Data.LastUpdated;
                return(View(packaging));
            }
            catch (Exception ex)
            {
                Alert($"Error! {ex.Message}", NotificationType.error, Int32.Parse(_appConfig.Value.NotificationDisplayTime));
                return(View(packaging));
            }
        }