Esempio n. 1
0
        public async Task <ActionResult> UOMDetails(Guid id)
        {
            var uom = new UOMDetailsViewModel();

            try
            {
                var result = await _unitOfMeasureService.FindByIdInclusive(id, x => x.Include(p => p.UnitOfMeasureType));

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