WebServiceForm.cs

Description du code

WebServiceForm.cs est un fichier du projet BiblioBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.

Projet BiblioBrol :

Gestion de media en CSharp.

Pour plus d'infos, vous pouvez consulter la brève analyse.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Deployment.Application;
  9. using be.gaudry.observer;
  10. using be.gaudry.view;
  11. using be.gaudry.bibliobrol.config;
  12.  
  13. namespace be.gaudry.bibliobrol.view
  14. {
  15. public partial class WebServiceForm : MDIChildForm
  16. {
  17.  
  18. private be.gaudry.bibliobrol.BibliobrolSrv.BibliobrolService ws;
  19.  
  20. private bool wsAvailable;
  21. public WebServiceForm()
  22. {
  23. InitializeComponent();
  24. this.SuspendLayout();
  25. wsAvailable = false;
  26. ws = new be.gaudry.bibliobrol.BibliobrolSrv.BibliobrolService();
  27. displayVersion();
  28. wsUrlTB.Text = ws.Url;
  29. this.ResumeLayout(false);
  30. }
  31.  
  32. #region version
  33. private void displayVersion()
  34. {
  35. try
  36. {
  37. lastVersionLbl.Text = String.Format("Version du service : {0}", ws.getVersion());
  38. wsAvailable = true;
  39. }
  40. catch (System.Net.WebException we)
  41. {
  42. lastVersionLbl.Text = "WebService non disponible " + we.Message;
  43. }
  44. catch (Exception e)
  45. {
  46. StaticObservable.notify(new Notification(Notification.VERBOSE.criticalError, e.Message, this));
  47. }
  48. }
  49. #endregion
  50.  
  51. #region person by name
  52. private void wsGetPersByNameBtn_Click(object sender, EventArgs e)
  53. {
  54. if(!wsAvailable)displayVersion();
  55. if (wsGetPersByNameTB.Text.Length < 1)
  56. {
  57. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "WebService", "Veuillez d'abord introduire un nom de personne dans la boîte de texte", this));
  58. return;
  59. }
  60. try
  61. {
  62. //BiblioBrol.Model.Person p = ws.TestDll();
  63. //BiblioBrol.BibliobrolSrv.Person p = ws.getPerson(57);
  64. List<be.gaudry.bibliobrol.BibliobrolSrv.Person> persons = new List<be.gaudry.bibliobrol.BibliobrolSrv.Person>();
  65. persons.AddRange(ws.getPersonsByLastName(wsGetPersByNameTB.Text));
  66. StringBuilder str = new StringBuilder(String.Format("{0} résultat(s) :\n\n", persons.Count));
  67. foreach (be.gaudry.bibliobrol.BibliobrolSrv.Person p in persons)
  68. {
  69. str.AppendLine(String.Format("{0} {1}", p.LastName, p.FirstName));
  70. }
  71. infoRTB.Text = str.ToString();
  72. }
  73. catch (System.Net.WebException we)
  74. {
  75. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "WebService non disponible", we.Message, this));
  76. }
  77. catch (System.Web.Services.Protocols.SoapException soae)
  78. {
  79. StaticObservable.notify(new Notification(Notification.VERBOSE.criticalError, "Erreur WebService", soae, this));
  80. }
  81. catch (Exception ex)
  82. {
  83. StaticObservable.notify(new Notification(Notification.VERBOSE.criticalError, ex, this));
  84. }
  85.  
  86. }
  87. #endregion
  88.  
  89. private void lastVersionAsyncBtn_Click(object sender, EventArgs e)
  90. {
  91. if (!wsAvailable) displayVersion();
  92. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "fonction non disponible", this));
  93.  
  94. }
  95.  
  96. #region roles by person
  97. private void wsGetRolesByPersBtn_Click(object sender, EventArgs e)
  98. {
  99. if (!wsAvailable) displayVersion();
  100. if (wsGetPersByNameTB.Text.Length < 1)
  101. {
  102. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "WebService", "Veuillez d'abord introduire un nom de personne dans la boîte de texte", this));
  103. return;
  104. }
  105. List<be.gaudry.bibliobrol.BibliobrolSrv.Person> persons = new List<be.gaudry.bibliobrol.BibliobrolSrv.Person>();
  106. try
  107. {
  108. persons.AddRange(ws.getPersonsByLastName(wsGetPersByNameTB.Text));
  109. StringBuilder str = new StringBuilder(String.Format("{0} résultat(s) :\n", persons.Count));
  110. foreach (be.gaudry.bibliobrol.BibliobrolSrv.Person p in persons)
  111. {
  112. List<be.gaudry.bibliobrol.BibliobrolSrv.ActorRole> roles = new List<be.gaudry.bibliobrol.BibliobrolSrv.ActorRole>();
  113. roles.AddRange(ws.getRoleByPerson(p));
  114. str.Append(String.Format("\n{0} rôle(s) pour {1} {2} :", roles.Count, p.LastName, p.FirstName));
  115. foreach (be.gaudry.bibliobrol.BibliobrolSrv.ActorRole r in roles)
  116. {
  117. str.Append(String.Format("\n\t{0} dans {1}",r.Name,r.Info));
  118. }
  119. }
  120. infoRTB.Text = str.ToString();
  121. }
  122. catch (System.Net.WebException we)
  123. {
  124. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "WebService non disponible", we.Message, this));
  125. }
  126. catch (System.Web.Services.Protocols.SoapException soae)
  127. {
  128. StaticObservable.notify(new Notification(Notification.VERBOSE.criticalError, "Erreur WebService", soae, this));
  129. }
  130. catch (Exception ex)
  131. {
  132. StaticObservable.notify(new Notification(Notification.VERBOSE.criticalError, ex, this));
  133. }
  134. }
  135. #endregion
  136.  
  137. private void WebServiceForm_Enter(object sender, EventArgs e)
  138. {
  139. this.Icon = global::be.gaudry.bibliobrol.Properties.Resources.webSrvIcon;
  140. }
  141.  
  142. private void wsUrlOkBtn_Click(object sender, EventArgs e)
  143. {
  144. ws.Url = wsUrlTB.Text;
  145. }
  146.  
  147. private void WebServiceForm_Load(object sender, EventArgs e)
  148. {
  149. awsSubscriptionTB.Text = Config.AwsSubscription;
  150. }
  151.  
  152. private void saveAwsSubscriptionBtn_Click(object sender, EventArgs e)
  153. {
  154. Config.AwsSubscription = awsSubscriptionTB.Text;
  155. Config.save();
  156. }
  157.  
  158.  
  159. }
  160. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModification
IcôneNomTailleModification
| _ Répertoire parent0 octets1714759181 03/05/2024 19:59:41
| _wizards0 octets1541007184 31/10/2018 18:33:04
| _utils0 octets1541007184 31/10/2018 18:33:04
| _controls0 octets1541007178 31/10/2018 18:32:58
| _dialogs0 octets1541007183 31/10/2018 18:33:03
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .resx|.resxMediabrolForm.resx32.55 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxAWSForm.resx188.27 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxMainForm.resx6.07 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxConsoleForm.resx256.48 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csAWSForm.Designer.cs23.45 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csActorForm.cs9.09 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.Designer.cs11.22 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csAWSForm.cs7.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBorrowsForm.cs1.66 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csCopy of MainForm.Designer.cs16.91 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.Designer.cs2.71 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.cs6.34 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .resx|.resxOldMainForm.resx58.06 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csCopy of MainForm.cs30.81 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxActorForm.resx44.98 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxBorrowsForm.resx73.4 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMainForm.cs37.45 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxWebServiceForm.resx9.71 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMainForm.Designer.cs7.16 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csBorrowsForm.Designer.cs10.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csTasksForm.cs389 octets31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBiblioBrolAboutBox.resx5.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBrolForm.cs25.87 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.Designer.cs13.12 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMediabrolForm.Designer.cs142.05 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.cs2.79 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csBrolForm.designer.cs41.73 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMediabrolForm.cs31.94 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csStatsForm.Designer.cs11.59 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csActorForm.Designer.cs28.26 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.Designer.cs83.98 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csStatsForm.cs5 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.cs5.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.cs27.08 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxTasksForm.resx187.31 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csTasksForm.Designer.cs2.26 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBrolForm.resx45.52 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxCopy of MainForm.resx7.53 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxStatsForm.resx187.5 Ko31/10/2018 18:32:28-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

Document créé le 16/10/2009, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/cs-bibliobrol-source-rf-view/WebServiceForm.cs.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.