1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Com.Piwigo.Lib.IService; |
---|
4 | using Com.Piwigo.Wpf.DTO; |
---|
5 | using Com.Piwigo.Lib.DTO; |
---|
6 | using Com.Piwigo.Wpf.DTO.Helper; |
---|
7 | using Com.Piwigo.Wpf.Helper; |
---|
8 | using Com.Piwigo.Wpf.Service; |
---|
9 | |
---|
10 | namespace Com.Piwigo.Wpf.Command |
---|
11 | { |
---|
12 | public sealed class PwgCmdGetImageforCategory : PwgCmdBase |
---|
13 | { |
---|
14 | public override void Execute(object parameter) |
---|
15 | { |
---|
16 | PwgCategoryWPF catParam; |
---|
17 | Int32 aPage = 0; |
---|
18 | Int32 aPerPage = 0; |
---|
19 | Int32 acount = 0; |
---|
20 | |
---|
21 | try { |
---|
22 | Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName); |
---|
23 | if (parameter is PwgCategoryWPF) |
---|
24 | { |
---|
25 | catParam = (PwgCategoryWPF)parameter; |
---|
26 | ImageCacheManager.Instance.SetCurrentCategory(catParam.Id.ToString()); |
---|
27 | |
---|
28 | List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(catParam.Id, false, null, null, null, null, null, null, null, null, null, null, null, null, null, true, ref aPage, ref aPerPage, ref acount); |
---|
29 | PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList; |
---|
30 | |
---|
31 | PwgImageListWPFHelper.ConvertPwgImageListToPwgImageListWPF(lstImg, ref lstImgWPF); |
---|
32 | } |
---|
33 | |
---|
34 | } |
---|
35 | catch (PwgServiceException ex) |
---|
36 | { |
---|
37 | Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr); |
---|
38 | Console.WriteLine(ex.Message); |
---|
39 | } |
---|
40 | |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|