public static List <CopyViewModel> CopiesParser(List <Copy> copies)
        {
            List <CopyViewModel> copyList = new List <CopyViewModel>();

            foreach (var copy in copies)
            {
                CopyViewModel copyVM = new CopyViewModel();
                copyVM.Status   = new StatusViewModel();
                copyVM.Location = new LocationViewModel();
                copyVM.Book     = new BookViewModel();

                copyVM.CopyId              = copy.CopyId;
                copyVM.RFID                = copy.RFID;
                copyVM.Status.StatusId     = copy.Status.StatusId;
                copyVM.Status.Name         = copy.Status.Name;
                copyVM.Location.LocationId = copy.Location.LocationId;
                copyVM.Location.Shelf      = copy.Location.Shelf;
                copyVM.Location.ShelfRow   = copy.Location.ShelfRow;
                copyVM.Location.ShelfCol   = copy.Location.ShelfCol;
                copyVM.Book.BookId         = copy.Book.BookId;
                copyVM.Book.ImagePath      = copy.Book.ImagePath;
                copyList.Add(copyVM);
            }

            return(copyList);
        }
Exemple #2
0
        public async Task <ActionResult> Index()
        {
            var model = new CopyViewModel
            {
                CopyList = await _copyService.GetAsync()
            };

            return(View(model));
        }
Exemple #3
0
        public ActionResult Index()
        {
            var model = new CopyViewModel()
            {
                CopyList = _copyService.Get()
            };

            return(View(model));
        }
Exemple #4
0
 public CopyWindow()
 {
     InitializeComponent();
     DataContext   = new CopyViewModel();
     this.Closing += CopyWindow_Closing;
 }