-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyFormStockSupprimer.h
191 lines (171 loc) · 6.8 KB
/
MyFormStockSupprimer.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
181
182
183
184
185
186
187
188
189
190
191
#include "CLserviceStock.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 MyFormStockSupprimer
/// </summary>
public ref class MyFormStockSupprimer : public System::Windows::Forms::Form
{
public:
MyFormStockSupprimer(void)
{
InitializeComponent();
//
//TODO: ajoutez ici le code du constructeur
//
}
protected:
/// <summary>
/// Nettoyage des ressources utilisées.
/// </summary>
~MyFormStockSupprimer()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ lbNom;
private: System::Windows::Forms::TextBox^ txtArticleID;
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::CLservicesStock^ 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->lbNom = (gcnew System::Windows::Forms::Label());
this->txtArticleID = (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();
//
// lbNom
//
this->lbNom->AutoSize = true;
this->lbNom->Dock = System::Windows::Forms::DockStyle::Top;
this->lbNom->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->lbNom->Location = System::Drawing::Point(0, 48);
this->lbNom->Name = L"lbNom";
this->lbNom->Size = System::Drawing::Size(109, 29);
this->lbNom->TabIndex = 0;
this->lbNom->Text = L"Article ID";
//
// txtArticleID
//
this->txtArticleID->BackColor = System::Drawing::SystemColors::MenuBar;
this->txtArticleID->Dock = System::Windows::Forms::DockStyle::Top;
this->txtArticleID->Location = System::Drawing::Point(0, 77);
this->txtArticleID->Name = L"txtArticleID";
this->txtArticleID->Size = System::Drawing::Size(1041, 31);
this->txtArticleID->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(1041, 48);
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, 847);
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(1041, 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(514, 94);
this->btnOK->TabIndex = 0;
this->btnOK->Text = L"OK";
this->btnOK->UseVisualStyleBackColor = true;
this->btnOK->Click += gcnew System::EventHandler(this, &MyFormStockSupprimer::btnOK_Click_1);
//
// btnAnnuler
//
this->btnAnnuler->Dock = System::Windows::Forms::DockStyle::Fill;
this->btnAnnuler->Location = System::Drawing::Point(523, 3);
this->btnAnnuler->Name = L"btnAnnuler";
this->btnAnnuler->Size = System::Drawing::Size(515, 94);
this->btnAnnuler->TabIndex = 1;
this->btnAnnuler->Text = L"Annuler";
this->btnAnnuler->UseVisualStyleBackColor = true;
this->btnAnnuler->Click += gcnew System::EventHandler(this, &MyFormStockSupprimer::btnAnnuler_Click_1);
//
// MyFormStockSupprimer
//
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(1041, 947);
this->ControlBox = false;
this->Controls->Add(this->tableLayoutPanel1);
this->Controls->Add(this->txtArticleID);
this->Controls->Add(this->lbNom);
this->Controls->Add(this->lbSupprimer);
this->Name = L"MyFormStockSupprimer";
this->Text = L"MyFormStockSupprimer";
this->Load += gcnew System::EventHandler(this, &MyFormStockSupprimer::MyFormStockSupprimer_Load_1);
this->tableLayoutPanel1->ResumeLayout(false);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void MyFormStockSupprimer_Load_1(System::Object^ sender, System::EventArgs^ e) {
this->oSvc = gcnew NS_Comp_Svc::CLservicesStock();
}
private: System::Void btnOK_Click_1(System::Object^ sender, System::EventArgs^ e) {
if (String::IsNullOrWhiteSpace(txtArticleID->Text))
{
MessageBox::Show("Veuillez remplir toutes les informations.", "Erreur", MessageBoxButtons::OK, MessageBoxIcon::Error);
}
else
{
int ArticleID = System::Convert::ToInt32(this->txtArticleID->Text);
this->oSvc->SupprimerStock(ArticleID);
}
}
private: System::Void btnAnnuler_Click_1(System::Object^ sender, System::EventArgs^ e) {
this->txtArticleID->Text = L"";
}
};
}