1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
namespace Evrh.SelUF
{
public partial class SelUFForm : Form
{
#region Attributs
private ControlEntiteStructure m_control;
private String pointGestion = "";
public String PointGestion
{
get { return pointGestion; }
set { pointGestion = value; }
}
private String axe;
public String Axe
{
get { return axe; }
}
private int niveau;
public int Niveau
{
get { return niveau; }
set { niveau = value; }
}
private String affectation;
public String Affectation
{
get { return affectation; }
set { affectation = value; }
}
private String codEntite;
public String CodEntite
{
get { return codEntite; }
set { codEntite = value; }
}
private String libEntite;
public String LibEntite
{
get { return libEntite; }
set { libEntite = value; }
}
private EntiteStructure entiteSelectionnee;
public EntiteStructure EntiteSelectionnee
{
get { return entiteSelectionnee; }
}
public TreeView StructureTreeView
{
get { return structureTreeView; }
}
private bool visibleByPTG;
private TreeNode currentNode;
#endregion Attributs
//**********************************************************************
public SelUFForm()
{
InitializeComponent();
m_control = new ControlEntiteStructure(this);
}
//**********************************************************************
private void SelUFForm_Load(object sender, EventArgs e)
{
ListeNomenclatures.chargerListControl(pointGestComboBox, "AGTPTG");
ListeNomenclatures.chargerListControl(axeComboBox, "ST_AXE");
StructureTreeView.ImageList = new ImageList();
StructureTreeView.ImageList.Images.Add(Properties.Resources.dossier_ouvert);
StructureTreeView.ImageList.Images.Add(Properties.Resources.uf);
//m_control.loadNextLevel(1, "R", null, "");
// Dans ce cas, il y a affichage
TreeNode test = new TreeNode("Noeud1");
TreeNode test1 = new TreeNode("Noued2", 0, 0);
structureTreeView.Nodes.Add(test);
structureTreeView.Nodes.Add(test1);
}
//**********************************************************************
#region Evenements
private void quitButton_Click(object sender, EventArgs e)
{
this.Close();
}
//**********************************************************************
private void validerButton_Click(object sender, EventArgs e)
{
if (structureTreeView.SelectedNode != null)
{
entiteSelectionnee = m_control.validerEntite();
this.Close();
}
else
MessageBox.Show("Aucune entité sélectionnée.", "Aucune sélection", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
//**********************************************************************
private void searchButton_Click(object sender, EventArgs e)
{
if (axeComboBox.Text != null && axeComboBox.Text != ""
&& niveauComboBox.Text != null && niveauComboBox.Text != "")
{
structureTreeView.Nodes.Clear();
m_control.chargerArbre();
}
}
//**********************************************************************
private void gommeButton_Click(object sender, EventArgs e)
{
pointGestComboBox.ResetText();
axeComboBox.ResetText();
niveauComboBox.ResetText();
codEntiteTextBox.ResetText();
libEntiteTextBox.ResetText();
structureTreeView.Nodes.Clear();
}
//**********************************************************************
private void pointGestComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (pointGestComboBox.Text != "")
pointGestion = ListeNomenclatures.getCodeElement("AGTPTG", pointGestComboBox.Text);
}
//**********************************************************************
private void axeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
niveauComboBox.Items.Clear();
niveauComboBox.ResetText();
if (axeComboBox.Text != "")
{
axe = ListeNomenclatures.getCodeElement("ST_AXE", axeComboBox.Text);
ListeNomenclatures.chargerListControlNiveau(niveauComboBox, "ST_NIS", "1", Axe, AFFICHER.CODE_LIBELLE);
}
}
//**********************************************************************
private void niveauComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
codEntiteTextBox.ResetText();
libEntiteTextBox.ResetText();
niveau = Convert.ToInt32(niveauComboBox.Text.Split(',')[0]);
if (axeComboBox.Text != null && axeComboBox.Text != "")
{
structureTreeView.Nodes.Clear();
m_control.chargerArbre();
}
}
//**********************************************************************
private void codEntiteTextBox_TextChanged(object sender, EventArgs e)
{
codEntite = codEntiteTextBox.Text;
libEntite = libEntiteTextBox.Text;
}
//**********************************************************************
private void structureTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
//String libNiveau;
//String selectNode = structureTreeView.SelectedNode.Text;
//String[] attSelectedNode = selectNode.Split(',');
//codEntite = attSelectedNode[0];
//libEntite = attSelectedNode[1].Trim();
//libNiveau = ListeNomenclatures.getLibelleElement("ST_NIS", Convert.ToString(structureTreeView.SelectedNode.Level));
//niveau = ListeNomenclatures.getCodeElement("ST_NIS", libNiveau);
}
//**********************************************************************
private void structureTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{
currentNode = ((TreeView)sender).SelectedNode;
m_control.loadNextLevel(((EntiteStructure)currentNode.Tag).Niveau, ((EntiteStructure)currentNode.Tag).Axe, currentNode, PointGestion);
}
#endregion Evenements
private void structureTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
}
}
} |
Partager