private void simpleButton2_Click(object sender, EventArgs e) { int count = gridView1.DataRowCount; DialogResult dialogResult = XtraMessageBox.Show("Sure de vouloir supprimer la commande client , les piéces rattachées seront aussi supprimées!", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { foreach (int i in gridView1.GetSelectedRows()) { try { System.Data.DataRow row = gridView1.GetDataRow(i); int code = Convert.ToInt32(row[0]); string b = ""; string a = "ajoute"; sql_gmao dd = new sql_gmao(); dd.delete_piece_from_cde_clt(code); //supprimer les pieces de commande fournisseur dd.deletecmdClt(code); //supprimer la commande fournisseur } catch (Exception ex) { } } } Listecmdclt(); } }
private void simpleButton5_Click(object sender, EventArgs e) { try{ int count = gridView1.DataRowCount; if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle); int code = Convert.ToInt32(row[0]); DialogResult dialogResult = XtraMessageBox.Show("Sure de vouloir supprimer la facture n° " + code + "", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { string b = ""; string a = "ajoute"; sql_gmao dd = new sql_gmao(); dd.delete_piece_avoir(code); //supprimer les pieces de commande fournisseur dd.delete_avoir(code); //supprimer la commande fournisseur Liste_cde_clt(); } } } catch (Exception tt) { } }
private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int count = gridView1.DataRowCount; DialogResult dialogResult = XtraMessageBox.Show("Sure de vouloir supprimer la commande , les piéces rattachées seront aussi supprimées!", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { foreach (int i in gridView1.GetSelectedRows()) { System.Data.DataRow row = gridView1.GetDataRow(i); int code = Convert.ToInt32(row[0]); string b = ""; string a = "ajoute"; sql_gmao dd = new sql_gmao(); dd.delete_piece_from_cde_fr(code); //supprimer les pieces de commande fournisseur dd.deletecmdfr(code); //supprimer la commande fournisseur } } if (type != "") { grid2(); } else { grid(); } } }
private void gridView1_DoubleClick(object sender, EventArgs e) { //recuperer les informations de commande fournisseur int id_cde; GridHitInfo celclick = gridView1.CalcHitInfo(gridControl1.PointToClient(Control.MousePosition)); if (celclick.InRow) { int count = gridView1.DataRowCount; if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle); id_cde = Convert.ToInt32(row[0]); id_commande = Convert.ToInt32(row[0]); req_non_feur = row[6].ToString(); DataTable dt = new DataTable(); sql_gmao ss = new sql_gmao(); dt = ss.get_list_cdefr(id_cde); req_code = Convert.ToInt32(dt.Rows[0]["id_commande"]); req_emetteur = dt.Rows[0]["client"].ToString(); req_code_feur = dt.Rows[0]["id_clt"].ToString(); req_date_cre = dt.Rows[0]["date"].ToString(); req_date_env = dt.Rows[0]["date"].ToString(); req_etat = dt.Rows[0]["etatcmd"].ToString(); EtatCmd report = new EtatCmd(req_code); report.ShowDialog(); //BoncmdFr al = new BoncmdFr(); //al.ShowDialog(); } } }
private void button1_Click(object sender, EventArgs e) { sql_gmao fun = new sql_gmao(); Stockart stockart = new Stockart(); IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null); try { if (isoStore.FileExists("TestStore.txt")) { using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream("TestStore.txt", FileMode.Open, isoStore)) { using (StreamReader reader = new StreamReader(isoStream)) { if (textBox1.Text == "") { XtraMessageBox.Show("insérer la quantité demandée"); } else { string a = reader.ReadLine(); string b = reader.ReadLine(); prixunit = Double.Parse(reader.ReadLine()); ptot = ptot + prixunit * Double.Parse(textBox1.Text); Double c = Convert.ToDouble(textBox1.Text); fun.setRelArt_SousArt(a, b, c, ptot); previent = previent + ptot; XtraMessageBox.Show("" + previent); this.Dispose(); } } } } } catch (Exception except) { MessageBox.Show("miss by" + except); } }
private void simpleButton2_Click(object sender, EventArgs e) { sql_gmao dd = new sql_gmao(); int count = gridView1.DataRowCount; DialogResult dialogResult = XtraMessageBox.Show("Sure de vouloir supprimer le BL ", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { foreach (int i in gridView1.GetSelectedRows()) { System.Data.DataRow row = gridView1.GetDataRow(i); int code = Convert.ToInt32(row[0]); dd.delete_BL(code);//supprimer les pieces de commande fournisseur dd.delete_piece_bl(code); } Liste_cde_clt(); } } }
private void barButtonItem3_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int count = gridView1.DataRowCount; if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle) { //requperer les information sur la piece selection System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle); req_id = Convert.ToInt32(row[0]); iddd = Convert.ToInt32(row[0]); sql_gmao ss = new sql_gmao(); DataTable nn = new DataTable(); nn = ss.get_id_piece(req_id); int k = Convert.ToInt32(nn.Rows[0]["id_piece"]); string w = ""; //supprimer la piece de commande ss.update_piece_after_delete(k, w); ss.delete_piece(iddd); //actualiser datagrid act(); } }