BrolForm.cs

Description du code

BrolForm.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 be.gaudry.bibliobrol.model;
  9. using be.gaudry.bibliobrol.model.dao;
  10. using System.IO;
  11. using be.gaudry.bibliobrol.view.utils;
  12. using be.gaudry.bibliobrol.view.dialogs;
  13. using be.gaudry.observer;
  14. using be.gaudry.view;
  15. using be.gaudry.bibliobrol.view.controls.webInfo;
  16. using be.gaudry.view.utils;
  17.  
  18.  
  19. namespace be.gaudry.bibliobrol.view
  20. {
  21. public partial class BrolForm : MDIChildForm, IMDIChild
  22. {
  23. #region constructor and declarations
  24. /// <summary>
  25. /// if false, no updates are done on the brolInfoControl and BrolEditControl
  26. /// avoid view flickering on multiple brolsDGV_SelectionChanged call
  27. /// </summary>
  28. private bool viewUpdateAllowed = false;
  29. private BrolType brolType;
  30. private DataTable dataTable;
  31. private Brol brol;
  32. private int dGVColSerieNbr, dGVColIdNbr, dGVColTitleNbr;
  33. //private IBrolDao brolDao;
  34. private const String ALL_ACTORS = " -TOUS- ";
  35. private List<DAOUtils.BROL_FIELD> brolFields;
  36. //private List<DAOUtils.MEDIABROL_FIELD> mediabrolFields;
  37. /// <summary>
  38. /// Path of the persons images directory
  39. /// </summary>
  40.  
  41. public BrolForm()
  42. {
  43. dGVColSerieNbr = -1;
  44. InitializeComponent();
  45. this.SuspendLayout();
  46. addToolStrip(mainTS);
  47. initBrolTypeMenu();
  48. //ModelAdapter.Instance.addObserver(this);
  49. brolType = new BrolType(0, "Tous les types");
  50. brol = new Brol();
  51. brol.Id = -1;
  52. //diaSetActorRole = new DiaSetActorRole(brolType,editActorsLB.Items);
  53. //brolInfoCtl.reset();
  54. //cleanEditForm();
  55. this.ResumeLayout(true);
  56. // Activates double buffering
  57. SetStyle(ControlStyles.UserPaint, true);
  58. SetStyle(ControlStyles.AllPaintingInWmPaint, true);
  59. SetStyle(ControlStyles.DoubleBuffer, true);
  60. }
  61.  
  62.  
  63. #endregion
  64.  
  65. #region brolsDGV
  66.  
  67. #region mediabrols
  68. /*private void initMediabrolsDGV()
  69.   {
  70.   mediabrolFields = new List<DAOUtils.MEDIABROL_FIELD>();
  71.   mediabrolFields.Add(DAOUtils.MEDIABROL_FIELD.name);
  72.   mediabrolFields.Add(DAOUtils.MEDIABROL_FIELD.owner);
  73.   mediabrolFields.Add(DAOUtils.MEDIABROL_FIELD.date);
  74.   }
  75.  
  76.   private void fillMediabrolsDGV()
  77.   {
  78.   if (mediabrolFields == null) initMediabrolsDGV();
  79.   //mediabrolsDGV.Rows.Clear();
  80.   mediabrolsDGV.DataSource = DAOFactory.Instance.getMediaBrolDao().loadMediaBrols(brol, mediabrolFields);
  81.   } */
  82. #endregion
  83.  
  84. private void sortDataTable()
  85. {
  86. if (brolSortSerieTsMi.Checked && dGVColSerieNbr > 0)
  87. {
  88. brolsDGV.Sort(brolsDGV.Columns[dGVColSerieNbr], ListSortDirection.Descending);
  89. }
  90. else if (brolSortTitleTsMi.Checked)
  91. {
  92. brolsDGV.Sort(brolsDGV.Columns[dGVColTitleNbr], ListSortDirection.Ascending);
  93. }
  94. else
  95. {
  96. brolsDGV.Sort(brolsDGV.Columns[dGVColIdNbr], ListSortDirection.Descending);
  97. }
  98. }
  99.  
  100. private void fillDataTable(bool sortIds)
  101. {
  102. viewUpdateAllowed = false;
  103. //todo : fill datatable in another thread
  104. dataTable = DAOFactory.Instance.getBrolDao().loadDataTableVos(brolFields, brolType.Id);
  105. brolsDGV.DataSource = dataTable;
  106. //a type of media is selected
  107. /*foreach (Control control in editTP.Controls)
  108.   {
  109.   control.Enabled = true;
  110.   }*/
  111. foreach (ToolStripItem tsi in mainTS.Items)
  112. {
  113. tsi.Enabled = true;
  114. }
  115. //editDelBrolBtn.Enabled = false;
  116. //editDelBrolTSBtn.Enabled = false;
  117.  
  118. viewUpdateAllowed = true;
  119.  
  120. if (sortIds)
  121. {
  122. sortDataTable();
  123. }
  124. }
  125. private void initMediaTable()
  126. {
  127. this.startProgress();
  128. viewUpdateAllowed = false;
  129. brolInfoCtl.Visible = false;
  130. this.SuspendLayout();
  131. //mediaTC.SuspendLayout();
  132. //brolInfoCtl.SuspendLayout();
  133. brolsDGV.Columns.Clear();
  134. brol.BrolType = brolType;
  135. multiWebInfoControl.setBrolType(brolType);
  136. brolFields = new List<DAOUtils.BROL_FIELD>();
  137. brolFields.Add(DAOUtils.BROL_FIELD.id);
  138. brolFields.Add(DAOUtils.BROL_FIELD.title);
  139. if (brolFieldDateTsMi.Checked)
  140. {
  141. brolFields.Add(DAOUtils.BROL_FIELD.date);
  142. }
  143. if (brolFieldSerieTsMi.Checked)
  144. {
  145. brolFields.Add(DAOUtils.BROL_FIELD.serie);
  146. }
  147. fillDataTable(false);
  148. int colCounter = 0;
  149. //brolsDGV.DataSource = dataTable;
  150. if (brolsDGV.ColumnCount > 0)
  151. {
  152. dGVColIdNbr = colCounter;
  153. brolsDGV.Columns[colCounter].Width = 25;
  154. brolsDGV.Columns[colCounter++].HeaderText = "N°";
  155.  
  156. dGVColTitleNbr = colCounter;
  157. brolsDGV.Columns[colCounter].FillWeight = 0.3F;
  158. brolsDGV.Columns[colCounter].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
  159. brolsDGV.Columns[colCounter++].HeaderText = "Titre";
  160.  
  161. if (brolFieldDateTsMi.Checked)
  162. {
  163. brolsDGV.Columns[colCounter].HeaderText = "Date";
  164. brolsDGV.Columns[colCounter++].Width = 75;
  165. }
  166.  
  167. if (brolFieldSerieTsMi.Checked)
  168. {
  169. dGVColSerieNbr = colCounter;
  170. brolsDGV.Columns[colCounter].HeaderText = "Série";
  171. brolsDGV.Columns[colCounter].FillWeight = 0.2F;
  172. brolsDGV.Columns[colCounter].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
  173. brolsDGV.Columns[colCounter++].Width = 75;
  174. }
  175. else
  176. {
  177. dGVColSerieNbr = -1;
  178. }
  179. }
  180. brolsDGV.RowsDefaultCellStyle.BackColor = Color.White;
  181. brolsDGV.AlternatingRowsDefaultCellStyle.BackColor = Color.WhiteSmoke;
  182. sortDataTable();
  183. brolsDGV.Columns[dGVColIdNbr].Visible = brolFieldIdTsMi.Checked;
  184. brolsDGV.Visible = true;
  185. viewUpdateAllowed = true;
  186. loadSelectedBrol();
  187. //brolInfoCtl.ResumeLayout(true);
  188. //mediaTC.ResumeLayout(true);
  189. brolInfoCtl.Visible = brolsDGV.RowCount > 0;
  190. this.ResumeLayout(true);
  191. this.stopProgress();
  192. }
  193. private void brolsDGV_CellClick(object sender, DataGridViewCellEventArgs e)
  194. {
  195. loadSelectedBrol();
  196. }
  197. private void brolsDGV_SelectionChanged(object sender, EventArgs e)
  198. {
  199. loadSelectedBrol();
  200. }
  201.  
  202. private void loadSelectedBrol()
  203. {
  204. if (viewUpdateAllowed)
  205. {
  206. int id = (brolsDGV.RowCount > 0) ? (int)brolsDGV.CurrentRow.Cells["id"].Value : -1;
  207. //brolInfoCtl.Visible = id > 0;
  208. try
  209. {
  210. ModelAdapter.unlockBrol(brol.Id);
  211.  
  212. brol = ModelAdapter.getBrol(id, true);
  213. saveEditedBrolBtn.Text = "Sauver";
  214. editSaveTSBtn.Text = "Sauver";
  215. if (brol.BrolLocked)
  216. {
  217. editSaveTSBtn.Enabled = false;
  218. saveEditedBrolBtn.Enabled = false;
  219. StaticObservable.notify(new Notification(Notification.VERBOSE.error, "Edition d'un ouvrage", "Impossible de modifier cet ouvrage car il est verrouillé par un autre utilisateur", this));
  220. }
  221. editBrolControl.setBrol(brol, brol.BrolType);
  222. /*
  223.   if (brol.Id > 0)
  224.   {
  225.   fillMediabrolsDGV();
  226.   }
  227.   */
  228. brolInfoCtl.setBrol(brol);
  229. multiWebInfoControl.setParam(brol.Title);
  230. }
  231. catch (Exception ex)
  232. {
  233. StaticObservable.notify(new Notification(Notification.VERBOSE.lowError, "Edition d'un ouvrage", "Aucun ouvrage sélectionné", ex, this));
  234. }
  235.  
  236. #region enable modifications only if needed
  237. /*
  238.   try
  239.   {
  240.   switch (mediaTC.SelectedTab.Name)
  241.   {
  242.   case "editTP":
  243.   brol = ModelAdapter.getBrol(id, true);
  244.   saveEditedBrolBtn.Text = "Sauver";
  245.   editSaveTSBtn.Text = "Sauver";
  246.   if (brol.BrolLocked)
  247.   {
  248.   editSaveTSBtn.Enabled = false;
  249.   saveEditedBrolBtn.Enabled = false;
  250.   StaticObservable.notify(new Notification(Notification.VERBOSE.error, "Edition d'un ouvrage", "Impossible de modifier cet ouvrage car il est verrouillé par un autre utilisateur", this));
  251.   }
  252.   editBrolControl.setBrol(brol, brol.BrolType);
  253.   break;
  254.   case "biblioBrolItemTP":
  255.   ModelAdapter.unlockBrol(brol.Id);
  256.   if (brol.Id > 0)
  257.   {
  258.   fillMediabrolsDGV();
  259.   }
  260.   break;
  261.   default:
  262.   brol = ModelAdapter.getBrol(id, false);
  263.   //fillInfoTP();
  264.   brolInfoCtl.fill(brol);
  265.   break;
  266.   }
  267.   multiWebInfoControl.setParam(brol.Title);
  268.   }
  269.   catch (Exception ex)
  270.   {
  271.   StaticObservable.notify(new Notification(Notification.VERBOSE.lowError, "Edition d'un ouvrage", "Aucun ouvrage sélectionné",ex, this));
  272.   }*/
  273. #endregion
  274. }
  275. }
  276.  
  277. #endregion
  278.  
  279. #region brolsDGV sort and display options
  280. /*
  281.   private void refreshOnAddTsMi_Click(object sender, EventArgs e)
  282.   {
  283.   DialogResult r = MessageBox.Show(
  284.   this,
  285.   "Si vous sélectionnez cette option, la table des ouvrages sera mise à jour à chaque ajout d'un ouvrage," +
  286.   " mais il ne sera plus possible de modifier les images associées aux ouvrages." +
  287.   "\n\nDésirez-vous tout de même cocher cette option ?",
  288.   "Rafraîchissement de la table des ouvrages",
  289.   MessageBoxButtons.OKCancel,
  290.   MessageBoxIcon.Question,
  291.   MessageBoxDefaultButton.Button2
  292.   );
  293.   if (r == DialogResult.OK)
  294.   {
  295.   refreshOnAddTsMi.Checked = true;
  296.   editBrolControl.ImageEditable = false;
  297.   }
  298.   else
  299.   {
  300.   refreshOnAddTsMi.Checked = false;
  301.   editBrolControl.ImageEditable = true;
  302.   }
  303.   }
  304.  
  305.   private void refreshOnUpdateTsMi_Click(object sender, EventArgs e)
  306.   {
  307.   DialogResult r = MessageBox.Show(
  308.   this,
  309.   "Si vous sélectionnez cette option, la table des ouvrages sera mise à jour à chaque modification d'un ouvrage,"+
  310.   " mais il ne sera plus possible de modifier les images associées aux ouvrages."+
  311.   "\n\nDésirez-vous tout de même cocher cette option ?",
  312.   "Rafraîchissement de la table des ouvrages",
  313.   MessageBoxButtons.OKCancel,
  314.   MessageBoxIcon.Question,
  315.   MessageBoxDefaultButton.Button2
  316.   );
  317.   if (r == DialogResult.OK)
  318.   {
  319.   refreshOnUpdateTsMi.Checked = true;
  320.   editBrolControl.ImageEditable = false;
  321.   }
  322.   else
  323.   {
  324.   refreshOnUpdateTsMi.Checked = false;
  325.   editBrolControl.ImageEditable = true;
  326.   }
  327.   }*/
  328. private void brolFieldIdTsMi_Click(object sender, EventArgs e)
  329. {
  330. brolsDGV.Columns[dGVColIdNbr].Visible = brolFieldIdTsMi.Checked;
  331. }
  332. private void brolFieldDateTsMi_Click(object sender, EventArgs e)
  333. {
  334. initMediaTable();
  335. }
  336. private void brolFieldSerieTsMi_Click(object sender, EventArgs e)
  337. {
  338. initMediaTable();
  339. brolSortSerieTsMi.Visible = brolFieldSerieTsMi.Checked;
  340. if (!brolFieldSerieTsMi.Checked) brolSortSerieTsMi.Checked = false;
  341. }
  342.  
  343. private void brolSortSerieTsMi_Click(object sender, EventArgs e)
  344. {
  345. brolSortTitleTsMi.Checked = false;
  346. brolIdTsMi.Checked = false;
  347. sortDataTable();
  348. }
  349.  
  350. private void brolSortTitleTsMi_Click(object sender, EventArgs e)
  351. {
  352. brolSortSerieTsMi.Checked = false;
  353. brolIdTsMi.Checked = false;
  354. sortDataTable();
  355. }
  356.  
  357. private void brolIdTsMi_Click(object sender, EventArgs e)
  358. {
  359. brolSortSerieTsMi.Checked = false;
  360. brolSortTitleTsMi.Checked = false;
  361. sortDataTable();
  362. }
  363. #endregion
  364.  
  365. #region menu
  366. private void initBrolTypeMenu()
  367. {
  368. List<BrolType> types = ModelAdapter.getBrolTypes();
  369. types.Add(new BrolType(0,"Tous"));
  370. foreach (BrolType type in types)
  371. {
  372. /*
  373.   * We must initialize a new BrolType object to avoid than all anonym methods
  374.   * share the same local variable type.
  375.   * All instances of our anonym methods are executed by different thread than initBrolTypeMenu iterator method.
  376.   * That makes all delegates have the last brolType object return by the iterator.
  377.   */
  378. BrolType tempType = type;
  379.  
  380. //get image if exists, or default image
  381. System.Drawing.Image img = Img.getTypeImage(type.Name);
  382.  
  383. mainTS.Items.Add(
  384. type.Name.Trim(),
  385. img,
  386. delegate { brolType = tempType; initMediaTable(); }
  387. );
  388. /*
  389.   fetchTSMenuItem.DropDownItems.Add(
  390.   new ToolStripMenuItem(
  391.   type.Name,
  392.   img,
  393.   delegate { brolType = tempType; initMediaTable(); },
  394.   "dyn" + type.Name + "TSMenuItem"
  395.   )
  396.   );
  397.   */
  398. brolsTsMi.DropDownItems.Add(
  399. new ToolStripMenuItem(
  400. "Charger ("+type.Name+")",
  401. img,
  402. delegate { brolType = tempType; initMediaTable(); },
  403. "dyn" + type.Name + "TSMenuItem"
  404. )
  405. );
  406. }
  407. }
  408. #endregion
  409.  
  410. #region display media
  411. /*private void cleanInfoTP()
  412.   {
  413.   infoSynopsisRTB.Text = "";
  414.   infoTitleLbl.Text = "";
  415.   infoActorsLB.Items.Clear();
  416.   infoCategoriesLB.Items.Clear();
  417.   infoCotationLbl.Text = "Cote : ";
  418.   }
  419.   private void fillInfoTP()
  420.   {
  421.   coverPB.ImageLocation = Img.getBrolImgPath(brol);
  422.   coverPB.Size = new System.Drawing.Size(111, 149);
  423.   infoTitleLbl.Text = brol.Title;
  424.   infoSynopsisRTB.Text = brol.Synopsis;
  425.   infoCategoriesLB.Items.Clear();
  426.   infoCategoriesLB.Items.AddRange(brol.Categories.ToArray());
  427.   int i = infoCategoriesLB.Items.Count;
  428.   if (i > 0)
  429.   {
  430.   infoCategoriesLbl.Text = i + " catégorie(s) : ";
  431.   infoCategoriesLB.Visible = true;
  432.   }
  433.   else
  434.   {
  435.   infoCategoriesLbl.Text = "Aucune catégorie trouvée";
  436.   infoCategoriesLB.Visible = false;
  437.   }
  438.   infoActorsLB.Items.Clear();
  439.   infoActorsLB.Items.AddRange(brol.Actors.ToArray());
  440.   i = infoActorsLB.Items.Count;
  441.   if (i > 0)
  442.   {
  443.   infoActorsLbl.Text = i + " personne(s) / rôle(s) : ";
  444.   infoActorsLB.Visible = true;
  445.   }
  446.   else
  447.   {
  448.   infoActorsLbl.Text = "Aucune personne trouvée";
  449.   infoActorsLB.Visible = false;
  450.   }
  451.   infoCotationLbl.Text = "Cote : " + brol.Cotation + "/10";
  452.   }*/
  453. #endregion
  454.  
  455. #region edit media
  456. #region general edit page
  457. /*
  458.   /// <summary>
  459.   /// Used to reset all brol edit from fields
  460.   /// </summary>
  461.   private void cleanEditForm()
  462.   {
  463.   editSynopsisRTB.Text = "";
  464.   editTitleTB.Text = "";
  465.   editCotationCB.SelectedIndex = -1;
  466.   editCategoriesLB.Items.Clear();
  467.   editActorsLB.Items.Clear();
  468.   persImg.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolImg;
  469.   editSpCommentRTB.Text = "";
  470.   }*/
  471. private void EditTP_Leave(object sender, EventArgs e)
  472. {
  473. if (brolsDGV.RowCount > 0)
  474. {
  475. int id = (int)brolsDGV.SelectedRows[0].Cells["id"].Value;
  476. ModelAdapter.unlockBrol(id);
  477. }
  478. }
  479. /*
  480.   /// <summary>
  481.   /// Used to fill all brol values from edit from fields
  482.   /// </summary>
  483.   private void setBrolFromEditForm()
  484.   {
  485.  
  486.   }
  487.   /// <summary>
  488.   /// Used to fill all brol edit from fields from brol values
  489.   /// </summary>
  490.   private void fillEditForm(Brol brol)
  491.   {
  492.  
  493.   }
  494.   */
  495.  
  496.  
  497.  
  498. private void editTitleTB_TextChanged(object sender, EventArgs e)
  499. {
  500. //multiWebInfoControl.setParam(editTitleTB.Text);
  501. }
  502. #endregion
  503.  
  504. #endregion //end edit media
  505.  
  506. #region edit
  507.  
  508. private void editLoadBtn_Click(object sender, EventArgs e)
  509. {
  510. try
  511. {
  512. int id = (int)brolsDGV.SelectedRows[0].Cells["id"].Value;
  513. brol = ModelAdapter.getBrol(id, true);
  514. editBrolControl.setBrol(brol, brol.BrolType);
  515. mediaTC.SelectedTab = editTP;
  516. }
  517. catch (Exception ex)
  518. {
  519. StaticObservable.notify(new Notification(Notification.VERBOSE.lowError, "Impossible de charger l'élément sélectionné", ex, this));
  520. }
  521. }
  522.  
  523. #endregion
  524.  
  525. #region manage image
  526. private void deleteBrolCover()
  527. {
  528. bool deleted = false;
  529. String path = Img.getBrolImgPath(brol);
  530. try
  531. {
  532. File.Delete(path);
  533. deleted = true;
  534. }
  535. catch (Exception e)
  536. {
  537. StaticObservable.notify(new Notification(Notification.VERBOSE.lowError, "Suppression de l'affiche", e, this));
  538. deleted = false;
  539. }
  540. if (deleted) StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "Affiche supprimée : " + path, this));
  541. }
  542. private void delImageBtn_Click(object sender, EventArgs e)
  543. {
  544. deleteBrolCover();
  545. }
  546. #endregion
  547.  
  548. #region overrided methods
  549. public override String ToString()
  550. {
  551. return "BrolForm";
  552. }
  553. public override int GetHashCode()
  554. {
  555. //todo : reimplement GetHashCode
  556. return this.ToString().GetHashCode();
  557. }
  558. #endregion
  559.  
  560. #region Form
  561. private void BrolForm_Enter(object sender, EventArgs e)
  562. {
  563. this.Icon = global::be.gaudry.bibliobrol.Properties.Resources.brolIcon;
  564. }
  565. #endregion
  566.  
  567. #region edit brol actions
  568. private void saveEditedBrolBtn_Click(object sender, EventArgs e)
  569. {
  570. bool refresh;
  571. if (brol.Id >= 0)
  572. {
  573. refresh = refreshOnUpdateTsMi.Checked;
  574. }
  575. else
  576. {
  577. refresh = refreshOnAddTsMi.Checked;
  578. }
  579. brol = editBrolControl.saveBrol(!refresh);
  580. if (refresh)
  581. {
  582. fillDataTable(true);
  583. }
  584. }
  585.  
  586. private void onDeleteBrol_Click(object sender, EventArgs e)
  587. {
  588. DialogResult dr = MessageBox.Show(
  589. this,
  590. string.Format(
  591. "Désirez-vous supprimer définitivement l'ouvrage ?\n\r{0}",
  592. brol.Title
  593. ),
  594. "Suppression d'un ouvrage",
  595. MessageBoxButtons.OKCancel,
  596. MessageBoxIcon.Question
  597. );
  598. if ( dr== DialogResult.OK && ModelAdapter.deleteBrol(brol))
  599. {
  600. deleteBrolCover();
  601. if(refreshOnDeleteTsMi.Checked)fillDataTable(true);
  602. }
  603. }
  604.  
  605. private void onAddBrol_Click(object sender, EventArgs e)
  606. {
  607. brol = new Brol();
  608. brol.BrolType = brolType;
  609. editBrolControl.setBrol(brol, brol.BrolType);
  610. mediaTC.SelectedTab = editTP;
  611. }
  612.  
  613. private void onDuplicateBrol_Click(object sender, EventArgs e)
  614. {
  615. StringBuilder str = new StringBuilder("L'ouvrage \"");
  616. str.Append(brol.Title.Trim());
  617. str.Append("\" portant l'identifiant n°");
  618. str.Append(brol.Id);
  619. str.Append(" est dupliqué.\n\nTant qu'il n'est pas sauvé, son identifiant est égal à -1.");
  620. brol.Id = -1;
  621. foreach (Actor actor in brol.Actors) { actor.Status = STATUS.toAdd; }
  622. foreach (BrolCategory category in brol.Categories) { category.Status = STATUS.toAdd; }
  623. //keep only serieItems without argument (like film production, book collection, etc.).
  624. foreach (SerieItem serieItem in brol.SerieItems)
  625. {
  626. if (string.Empty.Equals(serieItem.getRank()))
  627. {
  628. serieItem.getSerie().Status = STATUS.toAdd;
  629. }
  630. }
  631. brol.SerieItems.RemoveAll(removeIfStatusIsNotToAdd);
  632. //brol.SerieItems.Clear();
  633. editBrolControl.setBrol(brol);
  634.  
  635. StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, str.ToString(), this));
  636. }
  637. private static bool removeIfStatusIsNotToAdd(SerieItem serieItem)
  638. {
  639. return (serieItem.getSerie().Status != STATUS.toAdd);
  640. }
  641.  
  642. #endregion
  643.  
  644. private void addMediabrolTSBtn_Click(object sender, EventArgs e)
  645. {
  646. editBrolControl.promptInsertMediabrol(brol);
  647. }
  648.  
  649.  
  650. #region IObserver Membres
  651. /*
  652.   public void update(Notification notification)
  653.   {
  654.   //if (notification.Level.Equals(Notification.VERBOSE.modified))
  655.   switch (notification.Msg)
  656.   {
  657.   case "insertBrol" :
  658.   if (refreshOnAddTsMi.Checked)
  659.   {
  660.   fillDataTable(true);
  661.   }
  662.   break;
  663.   case "deleteBrol":
  664.   if (refreshOnDeleteTsMi.Checked)
  665.   {
  666.   fillDataTable(true);
  667.   }
  668.   break;
  669.   case "updateBrol":
  670.   if (refreshOnUpdateTsMi.Checked)
  671.   {
  672.   fillDataTable(true);
  673.   }
  674.   break;
  675.   default:
  676.   break;
  677.   }
  678.   }
  679.   */
  680. #endregion
  681.  
  682. #region save and print DGV actions
  683. private void printDGVAction(object sender, EventArgs e)
  684. {
  685. DgvFactory.print(brolsDGV, "Ouvrages de BiblioBrol", this);
  686. }
  687.  
  688. private void saveDGVAction(object sender, EventArgs e)
  689. {
  690. DgvFactory.save(brolsDGV, "Ouvrages de BiblioBrol", this);
  691. }
  692. #endregion
  693.  
  694. #region IMDIChild Members
  695.  
  696. public MenuStrip getMainMenuStrip()
  697. {
  698. return mainMenuStrip;
  699. }
  700.  
  701. #endregion
  702.  
  703. private void showMediabrolsTsMi_Click(object sender, EventArgs e)
  704. {
  705. if (brol != null)
  706. {
  707. MediaBrolsByBrolForm form = new MediaBrolsByBrolForm();
  708. form.setBrol(brol);
  709. form.ShowDialog(this);
  710. }
  711. else
  712. {
  713. MessageBox.Show("Veuillez sélectionner un ouvrage avant de consulter les exemplaires associés");
  714. }
  715. }
  716. }
  717. }

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 octets1727451735 27/09/2024 17:42:15
| _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//BrolForm.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.