private void btnAddnewPurchase_Click(object sender, EventArgs e) { try { DataTable dt = new DataTable(); dt.Columns.Add("REF"); dt.Columns.Add("QUT_CD"); foreach (DataGridViewRow dr in dgvFacture.Rows) { dt.Rows.Add(dr.Cells[0].Value, dr.Cells[3].Value); } CLASS_FACTURE.PS_INSERTFACTURE(dateTimePicker1.Value, Convert.ToDecimal(txttotal.Text), Convert.ToDecimal(txtrest.Text), txtCodeclient.Text, dt); MessageBox.Show("Ajoute reussit."); PrintPurchase.Enabled = true; } catch (SqlException ex) { MessageBox.Show(ex.Message + ex.Number.ToString()); } }
private void PrintPurchase_Click(object sender, EventArgs e) { RPT.RPT_FORM frm = new RPT.RPT_FORM(); string I = CLASS_FACTURE.MAXFACTURE(); RPT.Facture raport = new RPT.Facture(); raport.SetParameterValue("@NO_FACTURE", I); frm.crystalReportViewer1.ReportSource = raport; frm.ShowDialog(); txtQtevendu.Clear(); txtarticle.Clear(); txtdesigniation.Clear(); txtprice.Clear(); txtQteStock.Clear(); txtCodeclient.Clear(); txtname.Clear(); txtfirstname.Clear(); txtsold.Clear(); dgvFacture.Rows.Clear(); }
public Facturation() { InitializeComponent(); txtCodevent.Text = CLASS_FACTURE.PS_MAXFACTURE(); }