Exemplo n.º 1
0
        private void chM_BUTTON1_Click(object sender, EventArgs e)
        {
            if (bsListe.Current != null)
            {
                DataRowView drv = (DataRowView)bsListe.Current;
                chargerFI_EQP((decimal)drv["CODE_EQP"]);

                CHM_RPT_FICHE_SUIVEUSE_EQP rpt = new CHM_RPT_FICHE_SUIVEUSE_EQP();
                rpt.SetDataSource(dsImpressionFiche);
                CHM_ETATS f = new CHM_ETATS();
                f.CHM_Aperçu_document.ReportSource = rpt;
                f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;
                f.Show();
            }
        }
Exemplo n.º 2
0
        void PreviewCommande(object sender, EventArgs e)
        {
            try
            {
                if (bs.Current != null)
                {
                    ReportDocument rpt = new CHM_RPT_CMD_FR();
                    rpt.SetDataSource(dS_MOUV1);
                    rpt.SetParameterValue("entete", MessageBox.Show("Impression avec entête?", "Impression Commande", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes?true:false);


                    CHM_ETATS f = new CHM_ETATS();
                    f.CHM_Aperçu_document.ReportSource = rpt;
                    f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;
                    f.Show();
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, this.Text);
            }
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (_bs_liste_br_fr.Current != null)
                {
                    ReportDocument rpt = new BON_RECEPTION.RPT_BR_FR();
                    //DataTable dt = CLIENT_APP_PARAM.GEST.P_BR_FR.IMPRIMER_BRECEP_FR((decimal)(_bs_liste_br_fr.Current as DataRowView)["CODE_BRECEP"]);
                    DataTable dt = CLIENT_APP_PARAM.gcws.IMPRIMER_BRECEP_FR((decimal)(_bs_liste_br_fr.Current as DataRowView)["CODE_BRECEP"]);
                    //rpt.SetDataSource(CLIENT_APP_PARAM.GEST.P_BR_FR.IMPRIMER_BRECEP_FR((decimal)(_bs_liste_br_fr.Current as DataRowView)["CODE_BRECEP"]));
                    rpt.SetDataSource(CLIENT_APP_PARAM.gcws.IMPRIMER_BRECEP_FR((decimal)(_bs_liste_br_fr.Current as DataRowView)["CODE_BRECEP"]));

                    CHM_ETATS f = new CHM_ETATS();
                    f.CHM_Aperçu_document.ReportSource = rpt;
                    f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;
                    f.Show();
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message);
            }
        }
Exemplo n.º 4
0
        void btn_afficher_Click(object sender, EventArgs e)
        {
            try
            {
                if (bsListe.Current != null)
                {
                    DataRowView drv = (DataRowView)bsListe.Current;
                    CHM_ETATS   f   = new CHM_ETATS();
                    f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;


                    ReportDocument rpt = new CHM_RPT_DEVI_CLIENT();
                    rpt.SetDataSource(dS_MOUV1);
                    decimal netAPaye = 0;
                    foreach (DataRow dr in dS_MOUV1.V_LG_DC.Rows)
                    {
                        netAPaye += (decimal)dr["TOTAL_TTC"];
                    }
                    netAPaye += Convert.ToDecimal(CLIENT_APP_PARAM.gcws.GetParamValue("TIMBRE", 1).Replace(',', '.'));
                    rpt.SetParameterValue("montantLettre", new NUM_TO_LETTRE.NumberToLetter().ConvertirDinars(netAPaye));
                    if (MessageBox.Show("Aperçu avec entete?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        rpt.SetParameterValue("entete", true);
                    }
                    else
                    {
                        rpt.SetParameterValue("entete", false);
                    }
                    f.CHM_Aperçu_document.ReportSource = rpt;
                    f.Show();
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, this.Text);
            }
        }
Exemplo n.º 5
0
        private void buttonENREGISTRER_Click(object sender, EventArgs e)
        {
            #region Validation des champs
            errorProvider1.SetError(txt_fournisseur, "");
            {
                if (txt_fournisseur.Text.Trim() == "")
                {
                    errorProvider1.SetError(button2, "Saisir Fournisseur!");
                    button2.Focus();
                    return;
                }
            }

            errorProvider1.SetError(cbx_magazin, "");
            {
                if (cbx_magazin.SelectedValue == null)
                {
                    errorProvider1.SetError(cbx_magazin, "Sélectionner le Magasin!");
                    cbx_magazin.Focus();
                    return;
                }
            }

            errorProvider1.SetError(txt_NUM_ORDER, "");
            {
                if (txt_NUM_ORDER.Text.Trim() == "")
                {
                    errorProvider1.SetError(txt_NUM_ORDER, "N° de BL Fournisseur manquant!");
                    txt_NUM_ORDER.Focus();
                    txt_NUM_ORDER.Select();
                    return;
                }
            }

            errorProvider1.SetError(gridControl1, "");
            {
                if (dS_MOUV1.LG_BR_FR.Rows.Count == 0)
                {
                    errorProvider1.SetError(gridControl1, "Rien à enregistrer");
                    return;
                }
            }
            #endregion

            if (MessageBox.Show("Etes vous sûres d'enregistrer le bon de réception?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                _dt_details_br = new DataTable("dtDetails");
                foreach (DataColumn c in dS_MOUV1.LG_BR_FR.Columns)
                {
                    DataColumn newCol = new DataColumn();
                    newCol.ColumnName = c.ColumnName;
                    newCol.DataType   = c.DataType;

                    _dt_details_br.Columns.Add(newCol);
                }

                foreach (DataRow dr in dS_MOUV1.LG_BR_FR.Rows)
                {
                    _dt_details_br.ImportRow(dr);
                }
                if (_CODE_BRECEP == -1)
                {
                    try
                    {
                        Cursor = Cursors.WaitCursor;
                        Application.DoEvents();
                        //CHM_GESTION_COMERCIALE.RESULT_QUERY res = CLIENT_APP_PARAM.GEST.P_BR_FR.INSERT_BR_FR(txt_NUM_ORDER.Text, _code_fournisseur, (decimal)cbx_magazin.SelectedValue, dateTimePicker1.Value, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), NP.Value, nud_pourcentage_remise.Value, _dt_details_br);
                        CHMGC.RESULT_QUERY res = CLIENT_APP_PARAM.gcws.INSERT_BR_FR(txt_NUM_ORDER.Text, _code_fournisseur, (decimal)cbx_magazin.SelectedValue, dateTimePicker1.Value, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), lb_MNT_HT.Value, nud_pourcentage_remise.Value, _dt_details_br);
                        if (res.OK)
                        {
                            MessageBox.Show(res.MESSAGE, "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            buttonENREGISTRER.Enabled = false;
                            if (OnSave != null)
                            {
                                OnSave(_CODE_BRECEP);
                            }

                            if (MessageBox.Show("Vouler vous visualiser le bon de réception?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                            {
                                ReportDocument rpt = new BON_RECEPTION.RPT_BR_FR();
                                //DataTable dt = CLIENT_APP_PARAM.GEST.P_BR_FR.IMPRIMER_BRECEP_FR(Convert.ToDecimal(res.CODE));
                                DataTable dt = CLIENT_APP_PARAM.gcws.IMPRIMER_BRECEP_FR(Convert.ToDecimal(res.CODE));
                                rpt.SetDataSource(dt);

                                CHM_ETATS f = new CHM_ETATS();
                                f.CHM_Aperçu_document.ReportSource = rpt;
                                f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;
                                f.Show();
                            }


                            Close();
                        }
                        else
                        {
                            MessageBox.Show(res.MESSAGE, "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    catch (Exception er)
                    {
                        MessageBox.Show(er.Message, "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    finally
                    {
                        this.Cursor = Cursors.Default;
                    }
                }
                else
                {
                    try
                    {
                        Cursor = Cursors.WaitCursor;
                        Application.DoEvents();
                        //CHM_GESTION_COMERCIALE.RESULT_QUERY res = CLIENT_APP_PARAM.GEST.P_BR_FR.UPDATE_BR_FR(_CODE_BRECEP, txt_NUM_ORDER.Text, _code_fournisseur, (decimal)cbx_magazin.SelectedValue, dateTimePicker1.Value, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), NP.Value, nud_pourcentage_remise.Value, _dt_details_br);
                        CHMGC.RESULT_QUERY res = CLIENT_APP_PARAM.gcws.UPDATE_BR_FR(_CODE_BRECEP, txt_NUM_ORDER.Text, _code_fournisseur, (decimal)cbx_magazin.SelectedValue, dateTimePicker1.Value, Convert.ToDecimal(CLIENT_APP_PARAM.Fenetre_principale.code_user), lb_MNT_HT.Value, nud_pourcentage_remise.Value, _dt_details_br);
                        if (res.OK)
                        {
                            MessageBox.Show(res.MESSAGE, "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            buttonENREGISTRER.Enabled = false;
                            ReportDocument rpt = new BON_RECEPTION.RPT_BR_FR();
                            //DataTable dt = CLIENT_APP_PARAM.GEST.P_BR_FR.IMPRIMER_BRECEP_FR(Convert.ToDecimal(res.CODE));
                            DataTable dt = CLIENT_APP_PARAM.gcws.IMPRIMER_BRECEP_FR(Convert.ToDecimal(res.CODE));
                            rpt.SetDataSource(dt);

                            CHM_ETATS f = new CHM_ETATS();
                            f.CHM_Aperçu_document.ReportSource = rpt;
                            f.MdiParent = CLIENT_APP_PARAM.Fenetre_principale;
                            f.Show();
                            Close();
                        }
                        else
                        {
                            MessageBox.Show(res.MESSAGE, "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    catch (Exception er)
                    {
                        MessageBox.Show(er.Message, "Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    finally
                    {
                        this.Cursor = Cursors.Default;
                    }
                }
            }
        }