-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyFormPersonnelSupprimer.h
180 lines (171 loc) · 6.63 KB
/
MyFormPersonnelSupprimer.h
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
#include "CLservicePersonnel.h"
#pragma once
namespace ProjectPOO {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Description résumée de PersonnelSupprimer
/// </summary>
public ref class PersonnelSupprimer : public System::Windows::Forms::Form
{
public:
PersonnelSupprimer(void)
{
InitializeComponent();
//
//TODO: ajoutez ici le code du constructeur
//
}
protected:
/// <summary>
/// Nettoyage des ressources utilisées.
/// </summary>
~PersonnelSupprimer()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ lbID;
private: System::Windows::Forms::TextBox^ txtID;
private: System::Windows::Forms::Label^ lbSupprimer;
private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel1;
private: System::Windows::Forms::Button^ btnOK;
private: System::Windows::Forms::Button^ btnAnnuler;
private: NS_Comp_Svc::CLservicesPersonnel^ oSvc;
private:
/// <summary>
/// Variable nécessaire au concepteur.
/// </summary>
System::ComponentModel::Container^ components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
void InitializeComponent(void)
{
this->lbID = (gcnew System::Windows::Forms::Label());
this->txtID = (gcnew System::Windows::Forms::TextBox());
this->lbSupprimer = (gcnew System::Windows::Forms::Label());
this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel());
this->btnOK = (gcnew System::Windows::Forms::Button());
this->btnAnnuler = (gcnew System::Windows::Forms::Button());
this->tableLayoutPanel1->SuspendLayout();
this->SuspendLayout();
//
// lbID
//
this->lbID->AutoSize = true;
this->lbID->Dock = System::Windows::Forms::DockStyle::Top;
this->lbID->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->lbID->Location = System::Drawing::Point(0, 49);
this->lbID->Name = L"lbID";
this->lbID->Size = System::Drawing::Size(36, 29);
this->lbID->TabIndex = 0;
this->lbID->Text = L"ID";
//
// txtID
//
this->txtID->BackColor = System::Drawing::SystemColors::MenuBar;
this->txtID->Dock = System::Windows::Forms::DockStyle::Top;
this->txtID->Location = System::Drawing::Point(0, 78);
this->txtID->Name = L"txtID";
this->txtID->Size = System::Drawing::Size(621, 31);
this->txtID->TabIndex = 1;
//
// lbSupprimer
//
this->lbSupprimer->Dock = System::Windows::Forms::DockStyle::Top;
this->lbSupprimer->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13.875F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->lbSupprimer->Location = System::Drawing::Point(0, 0);
this->lbSupprimer->Name = L"lbSupprimer";
this->lbSupprimer->Size = System::Drawing::Size(621, 49);
this->lbSupprimer->TabIndex = 12;
this->lbSupprimer->Text = L"Supprimer";
this->lbSupprimer->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// tableLayoutPanel1
//
this->tableLayoutPanel1->ColumnCount = 2;
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent,
50)));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent,
50)));
this->tableLayoutPanel1->Controls->Add(this->btnOK, 0, 0);
this->tableLayoutPanel1->Controls->Add(this->btnAnnuler, 1, 0);
this->tableLayoutPanel1->Dock = System::Windows::Forms::DockStyle::Bottom;
this->tableLayoutPanel1->Location = System::Drawing::Point(0, 463);
this->tableLayoutPanel1->Name = L"tableLayoutPanel1";
this->tableLayoutPanel1->RowCount = 1;
this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));
this->tableLayoutPanel1->Size = System::Drawing::Size(621, 100);
this->tableLayoutPanel1->TabIndex = 13;
//
// btnOK
//
this->btnOK->Dock = System::Windows::Forms::DockStyle::Fill;
this->btnOK->Location = System::Drawing::Point(3, 3);
this->btnOK->Name = L"btnOK";
this->btnOK->Size = System::Drawing::Size(304, 94);
this->btnOK->TabIndex = 0;
this->btnOK->Text = L"OK";
this->btnOK->UseVisualStyleBackColor = true;
this->btnOK->Click += gcnew System::EventHandler(this, &PersonnelSupprimer::btnOK_Click);
//
// btnAnnuler
//
this->btnAnnuler->Dock = System::Windows::Forms::DockStyle::Fill;
this->btnAnnuler->Location = System::Drawing::Point(313, 3);
this->btnAnnuler->Name = L"btnAnnuler";
this->btnAnnuler->Size = System::Drawing::Size(305, 94);
this->btnAnnuler->TabIndex = 1;
this->btnAnnuler->Text = L"Annuler";
this->btnAnnuler->UseVisualStyleBackColor = true;
this->btnAnnuler->Click += gcnew System::EventHandler(this, &PersonnelSupprimer::btnAnnuler_Click);
//
// PersonnelSupprimer
//
this->AutoScaleDimensions = System::Drawing::SizeF(12, 25);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::White;
this->ClientSize = System::Drawing::Size(621, 563);
this->ControlBox = false;
this->Controls->Add(this->tableLayoutPanel1);
this->Controls->Add(this->txtID);
this->Controls->Add(this->lbID);
this->Controls->Add(this->lbSupprimer);
this->Name = L"PersonnelSupprimer";
this->Text = L"PersonnelSupprimer";
this->Load += gcnew System::EventHandler(this, &PersonnelSupprimer::PersonnelSupprimer_Load_1);
this->tableLayoutPanel1->ResumeLayout(false);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void btnAnnuler_Click(System::Object^ sender, System::EventArgs^ e) {
this->txtID->Text = L"";
}
private: System::Void btnOK_Click(System::Object^ sender, System::EventArgs^ e) {
if (String::IsNullOrWhiteSpace(txtID->Text))
{
MessageBox::Show("Veuillez remplir toutes les informations.", "Erreur", MessageBoxButtons::OK, MessageBoxIcon::Error);
}
else
{
int ID = System::Convert::ToInt32(this->txtID->Text);
this->oSvc->SupprimerPersonnel(ID);
}
}
private: System::Void PersonnelSupprimer_Load_1(System::Object^ sender, System::EventArgs^ e) {
this->oSvc = gcnew NS_Comp_Svc::CLservicesPersonnel();
}
};
}