private void Txt_NumCde_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { Boolean val = CommandeDAO.Existe_Commande(Txt_NumCde.Text); if (val) { Pan_LigC.Visible = true; DataTable dtlc = LigneCommandeDAO.List_LigneCommande_ParNum(Txt_NumCde.Text); foreach (DataRow row in dtlc.Rows) { DataTable dtpr = ProduitDAO.List_Prod_Ref(row["Ref_Prod"].ToString()); Dg_Prod.Rows.Add(row["Ref_Prod"].ToString(), dtpr.Rows[0]["Desig_Prod"].ToString(), dtpr.Rows[0]["PrixV_Prod"].ToString(), row["qte"].ToString(), Convert.ToInt32(dtpr.Rows[0]["PrixV_Prod"].ToString()) * Convert.ToInt32(row["qte"].ToString())); totalCde += Convert.ToInt32(dtpr.Rows[0]["PrixV_Prod"].ToString()) * Convert.ToInt32(row["qte"].ToString()); } DataTable dtc = CommandeDAO.List_Com_Num(Txt_NumCde.Text); DataTable dt = ClientADO.Liste_Client_ParCin(Convert.ToInt64(dtc.Rows[0]["cin_cl"].ToString())); Txt_cin.Text = dt.Rows[0]["cin_cl"].ToString(); Txt_nom.Text = dt.Rows[0]["Nom_cl"].ToString(); Txt_prenom.Text = dt.Rows[0]["pren_cl"].ToString(); Txt_vil.Text = dt.Rows[0]["ville_cl"].ToString(); Txt_tel.Text = dt.Rows[0]["tel_cl"].ToString(); Txt_TotalCde.Text = totalCde.ToString(); } else { Pan_LigC.Visible = true; } } }
private void Rechercher_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Txt_Ref.Text)) { DG_Prod.DataSource = ProduitDAO.List_Prod_Ref(Txt_Ref.Text); } else if (!string.IsNullOrEmpty(Txt_Desig.Text)) { DG_Prod.DataSource = ProduitDAO.List_Prod_Des(Txt_Desig.Text); } else if (!string.IsNullOrEmpty(Cmb_Categ.Text)) { DG_Prod.DataSource = ProduitDAO.List_Prod_ParCateg(Cmb_Categ.Text); } }
private void pictureBox2_Click(object sender, EventArgs e) { FProduit f = new FProduit(); f.TypeOP = "M"; DataTable dt = new DataTable(); dt = ProduitDAO.List_Prod_Ref(Txt_Ref.Text); f.Txt_Ref.Text = dt.Rows[0]["Ref_Prod"].ToString(); f.Txt_Desig.Text = dt.Rows[0]["Desig_Prod"].ToString(); f.Cmb_Categ.Text = dt.Rows[0]["Categ_Prod"].ToString(); f.Txt_Prix.Text = dt.Rows[0]["PrixV_Prod"].ToString(); f.Txt_Qte.Text = dt.Rows[0]["Qte_prod"].ToString(); f.ShowDialog(); }