Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | |
---|
6 | using Com.Piwigo.Lib.IService; |
---|
7 | using Com.Piwigo.Lib.DTO; |
---|
8 | |
---|
9 | using Com.Piwigo.Uploader.DTO; |
---|
10 | |
---|
11 | namespace Com.Piwigo.Uploader.Service |
---|
12 | { |
---|
13 | public class Connect: IService |
---|
14 | { |
---|
15 | public void runService() |
---|
16 | { |
---|
17 | PwgServiceProvider.Instance.PwgSetupService.Setup("UploadToPiwigo", null, ModelManager.Instance.serveurName); |
---|
18 | |
---|
19 | System.Diagnostics.Debug.WriteLine(ModelManager.Instance.serveurName.AbsoluteUri); |
---|
20 | |
---|
21 | try |
---|
22 | { |
---|
23 | ModelManager.Instance.sess = PwgServiceProvider.Instance.PwgSessionService.Login( ModelManager.Instance.userName, ModelManager.Instance.password); |
---|
24 | System.Diagnostics.Debug.WriteLine("user : " + ModelManager.Instance.sess.UserName + " " + ModelManager.Instance.sess.Status); |
---|
25 | |
---|
26 | if (ModelManager.Instance.sess.Status == PwgSessionStatusEnum.WebMaster) |
---|
27 | { |
---|
28 | ModelManager.Instance.lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); |
---|
29 | } |
---|
30 | else |
---|
31 | { |
---|
32 | ModelManager.Instance.lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(PwgCategory.RootCategoryId, true, false); |
---|
33 | } |
---|
34 | |
---|
35 | } |
---|
36 | catch (PwgServiceException ex) |
---|
37 | { |
---|
38 | System.Diagnostics.Debug.WriteLine(ex.Message); |
---|
39 | throw new ApplicationException ("Erreur " + ex.NumeroErr + " " + ex.MessageErr); |
---|
40 | } |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.