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 PwgCmdGetSubAlbumforAlbum : AsyncCommand |
---|
13 | { |
---|
14 | public override string Text { get { return "Get sub-Albums for a Album"; } } |
---|
15 | |
---|
16 | protected override void OnExecute(object parameter) |
---|
17 | { |
---|
18 | PwgAlbumWPF catParam; |
---|
19 | try |
---|
20 | { |
---|
21 | if (parameter is PwgAlbumWPF) |
---|
22 | { |
---|
23 | PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList; |
---|
24 | catParam = (PwgAlbumWPF)parameter; |
---|
25 | |
---|
26 | SendUiInfo("Retriving Album list from server..."); |
---|
27 | List<PwgAlbum> lstCat = PwgServiceProvider.Instance.PwgAlbumsService.GetListOfAlbum(catParam.Id, null, null); |
---|
28 | if (catParam.Childrens == null) |
---|
29 | { |
---|
30 | catParam.Childrens = new PwgAlbumListWPF(); |
---|
31 | } |
---|
32 | PwgAlbumListWPF lstCatWPF = catParam.Childrens; |
---|
33 | |
---|
34 | PwgAlbumListWPFHelper.ConvertPwgAlbumListToPwgAlbumListWPF(lstCat, ref lstCatWPF); |
---|
35 | catParam.IsExpanded = true; |
---|
36 | } |
---|
37 | } |
---|
38 | catch (PwgServiceException ex) |
---|
39 | { |
---|
40 | SendUiInfo("Error " + ex.NumeroErr + " " + ex.MessageErr); |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|
44 | } |
---|