private void Infofacture_Load(object sender, EventArgs e) { if (Program.menu != "facture") { string st = Factures.creercode_f(); lbltitre.Text = "FACTURE N°" + st + " " + "du"; dataGridView1.DataSource = Program.tabvet; txttypevetement.DataBindings.Add("Text", Program.tabvet, "TypeVetement"); txtquantite.DataBindings.Add("Text", Program.tabvet, "Quantite"); txtpulavage.DataBindings.Add("Text", Program.tabvet, "PU_lavage"); gbinfoclient.Enabled = false; montanttotal.Text = Program.montant.ToString(); txtmle.Text = Clients.tableauclient[1]; txtnom.Text = Clients.tableauclient[2]; txtprenom.Text = Clients.tableauclient[3]; txttel.Text = Clients.tableauclient[4]; txtquartier.Text = Clients.tableauclient[5]; } if (Program.menu == "facture") { lbltitre.Text = "FACTURE N°" + Program.code_f + " " + "du"; gbinfoclient.Enabled = false; dataGridView1.Enabled = false; string mle = Factures.mleclient(Program.code_f); string[] infoclient = Clients.infoclient(mle); txtmle.Text = infoclient[0]; txtnom.Text = infoclient[1]; txtprenom.Text = infoclient[2]; txttel.Text = infoclient[3]; txtquartier.Text = infoclient[4]; txttypevetement.Enabled = false; txtpulavage.Enabled = false; dtdatedepot.Enabled = false; dtdatefacture.Enabled = false; txtquantite.Enabled = false; dtdateretraiteff.Enabled = true; btajouter.Enabled = false; btretirer.Enabled = false; btmodifier.Enabled = false; txtmt.Hide(); //string infovetement = Vetements.infovetement() string[] infofacture = Factures.infofacture(Program.code_f); montanttotal.Text = infofacture[1]; lblmontantpayer.Text = infofacture[2]; lblmention.Text = Factures.montantapayer(Program.code_f); Vetements.tablevetementsfacture.Clear(); Vetements.affichervetementsfacture(Program.code_f); dataGridView1.DataSource = Vetements.tablevetementsfacture; } }
private void btsupprimerclient_Click(object sender, EventArgs e) { switch (btsupprimerclientele.Text) { case "Annuller": formulaireclientele_Load(null, null); btmodifierclientele.Enabled = true; btsupprimerclientele.Text = "Supprimer"; btajouterclientele.Text = "Ajouter"; btmodifierclientele.Text = "Modifier"; btajouterclientele.Enabled = true; gpmodifierclient.Enabled = false; break; case "Supprimer": switch (Program.menu) { case "client": string mle = txtmle.Text; DialogResult Confirmation = MessageBox.Show("Vous êtes sur le point de supprimer ce client", "Confirmation Supression", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (Confirmation == DialogResult.OK) { Clients.Supprimerclient(mle); MessageBox.Show("Suppression reussie"); formulaireclientele_Load(null, null); } break; case "vetement": string id = txtidvet.Text; DialogResult Confirmation1 = MessageBox.Show("Vous êtes sur le point de supprimer ce vetement", "Confirmation Supression", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (Confirmation1 == DialogResult.OK) { Vetements.Supprimervetement(id); MessageBox.Show("Suppression reussie"); formulaireclientele_Load(null, null); } break; } if (Program.menu == "vetement") { } break; } //} }
private void rdnouveautype_CheckedChanged(object sender, EventArgs e) { if (rdnouveautype.Checked == true) { v = false; txtcod.DataBindings.Clear(); cbtypevetement.Hide(); txttypevetement.Enabled = true; txtputraitementtype.Enabled = true; txtpulavage.Enabled = true; txttypevetement.Text = Vetements.creercodetypevetement(); txttypevetement.Text = ""; txtputraitementtype.Text = ""; txtpulavage.Text = ""; txtquantitevetement.Text = ""; } }
private void btvetements_Click(object sender, EventArgs e) { vider(); Program.menu = "vetement"; gpmodifierclient.Hide(); gpdatagrid1.Size = new Size(700, 307); dataGridView1.Size = new Size(690, 293); Vetements.affichervetements(); dataGridView1.DataSource = Vetements.tablevetements; btvetements.BackColor = Color.LightSteelBlue; btclients.BackColor = Color.Transparent; btfactures.BackColor = Color.Transparent; btdedomages.BackColor = Color.Transparent; radioButton1.Text = "Date de depot"; radioButton2.Text = "proprietaire"; radioButton3.Hide(); cbquartier.Hide(); bttrier.Location = new Point(451, 37); }
private void button4_Click(object sender, EventArgs e) { string code_f = Factures.creercode_f(); Factures facture = new Factures(); facture.Code_f = code_f; facture.Montant = Program.montant; facture.Mention = Program.mention; facture.Date_creation = Program.datemysql(dtdatedepot.Text); Factures.Ajouterfacture(facture); switch (Clients.tableauclient[0]) { case "E": foreach (DataRow dr in Program.tabvet.Rows) { string id = Vetements.creeridentifiant(); string mle = Convert.ToString(dr["MleClient"]); string idtypvet = Convert.ToString(dr["Idvetement"]); string libtypvet = Convert.ToString(dr["TypeVetement"]); int qte = Convert.ToInt32(dr["Quantite"]); string ddpot = Program.datemysql(dtdatedepot.Text); string ddispo = Program.datemysql(dtdatedispo.Text); int veriff = Vetements.verifiercodetypevetement(libtypvet); if (veriff == 1) { Vetements.Enregistrervetement(id, idtypvet, qte, mle, ddpot, ddispo); Factures.Ajouterlignefacture(code_f, mle, id); MessageBox.Show("Enregistrement reussie"); } if (veriff == 0) { string cod = Vetements.creercodetypevetement(); string lib = Convert.ToString(dr["TypeVetement"]); int pu_t = Convert.ToInt32(dr["PU_lavage"]); int pu_l = Convert.ToInt32(dr["PU_lavage"]); Vetements.Enregistrertypevetement(cod, lib, pu_t, pu_l); Vetements.Enregistrervetement(id, cod, qte, mle, ddpot, ddispo); Factures.Ajouterlignefacture(code_f, mle, id); MessageBox.Show("Enregistrement reussie"); } } break; case "N": Clients client = new Clients(); client.Mle = Clients.tableauclient[1]; client.Nom = Clients.tableauclient[2]; client.Prenom = Clients.tableauclient[3]; client.Tel = Convert.ToInt32(Clients.tableauclient[4]); client.Quartier = Clients.tableauclient[5]; client.Date_ajout = Program.datemysql(dtdatedepot.Text); Clients.Ajouterclient(client); foreach (DataRow dr in Program.tabvet.Rows) { string id = Vetements.creeridentifiant(); string mle = Convert.ToString(dr["MleClient"]); string idtypvet = Convert.ToString(dr["Idvetement"]); string libtypvet = Convert.ToString(dr["TypeVetement"]); int qte = Convert.ToInt32(dr["Quantite"]); string ddpot = Program.datemysql(dtdatedepot.Text); string ddispo = Program.datemysql(dtdatedispo.Text); int veriff = Vetements.verifiercodetypevetement(libtypvet); if (veriff == 1) { Vetements.Enregistrervetement(id, idtypvet, qte, mle, ddpot, ddispo); Factures.Ajouterlignefacture(code_f, mle, id); MessageBox.Show("Enregistrement reussie"); } if (veriff == 0) { string cod = Vetements.creercodetypevetement(); string lib = Convert.ToString(dr["TypeVetement"]); int pu_t = Convert.ToInt32(dr["PU_lavage"]); int pu_l = Convert.ToInt32(dr["PU_lavage"]); Vetements.Enregistrertypevetement(cod, lib, pu_t, pu_l); Vetements.Enregistrervetement(id, cod, qte, mle, ddpot, ddispo); Factures.Ajouterlignefacture(code_f, mle, id); MessageBox.Show("Enregistrement reussie"); } } break; } }