Ejemplo n.º 1
0
 public static FileSize MapFileSizeViewModelToFileSize(FileSizeViewModel fileSizeViewModel)
 {
     if (fileSizeViewModel != null)
     {
         return(new FileSize()
         {
             Id = fileSizeViewModel.Id,
             SizeName = fileSizeViewModel.SizeName
         });
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
    public IActionResult NetworkingFileSize(FileSizeViewModel model)
    {
        if (model == null)
        {
            throw new ArgumentNullException(nameof(model));
        }

        ViewBag.NavigationZone = NavigationZone.Tools;

        if (ModelState.IsValid)
        {
            model.Calculate();
        }
        else
        {
            model.ErrorMessage = "Please enter a valid file size";
        }

        return(View(model));
    }