private void btn_VALIDER_BRC_Click(object sender, EventArgs e) { //CHM_GESTION_COMERCIALE.RESULT_QUERY res = new CHM_GESTION_COMERCIALE.RESULT_QUERY(); CHMGC.RESULT_QUERY res = new CHM_CLIENT_APP.CHMGC.RESULT_QUERY(); try { if (dt_br.Rows.Count > 0) { decimal mnt = Convert.ToDecimal(lb_mnt_retour.Text); decimal mag = Convert.ToDecimal(dt_facture.Rows[0]["MAGASIN"].ToString()); //res = CLIENT_APP_PARAM.GEST.P_BRETOUR_CL.INSERT_BRETOUR_CLIENT(DateTime.Now, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), mnt, CODE_Facture.Text, mag, dt_br); res = CLIENT_APP_PARAM.gcws.INSERT_BRETOUR_CLIENT(DateTime.Now, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), mnt, CODE_Facture.Text, mag, dt_br); if (res.OK) { MessageBox.Show(res.MESSAGE, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); ReportDocument rpt = new BON_RETOUR_CLIENT.CHM_TICKET_BON_RETOUR_CLIENT(); //rpt.SetDataSource(CLIENT_APP_PARAM.GEST.P_BRETOUR_CL.IMPRIMER_BRETOUR_CLIENT(res.CODE)); rpt.SetDataSource(CLIENT_APP_PARAM.gcws.IMPRIMER_BRETOUR_CLIENT(res.CODE)); rpt.PrintOptions.PrinterName = CLIENT_APP_PARAM.TicketPrinter; rpt.PrintToPrinter(1, true, 0, 0); Close(); } } else { MessageBox.Show("Veuillez sélectionner les articles tout d'abord.", this.Text); } } catch (Exception er) { MessageBox.Show(res.MESSAGE, this.Text); } }
private void BTN_APERçU_Click(object sender, EventArgs e) { try { if (bs_liste_br_cl.Current != null) { ReportDocument rpt = new BON_RETOUR_CLIENT.CHM_TICKET_BON_RETOUR_CLIENT(); //rpt.SetDataSource(CLIENT_APP_PARAM.GEST.P_BRETOUR_CL.IMPRIMER_BRETOUR_CLIENT((bs_liste_br_cl.Current as DataRowView)["CODE_BRETOUR_CLIENT"].ToString())); rpt.SetDataSource(CLIENT_APP_PARAM.gcws.IMPRIMER_BRETOUR_CLIENT((bs_liste_br_cl.Current as DataRowView)["CODE_BRETOUR_CLIENT"].ToString())); CHM_ETATS f = new CHM_ETATS(); f.CHM_Aperçu_document.ReportSource = rpt; f.ShowDialog(); } } catch (Exception er) { MessageBox.Show(er.Message, this.Text); } }