Example #1
0
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int count = gridView1.DataRowCount;

            if (count != 0 && gridView1.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle)
            {
                System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
                id_fact = Convert.ToInt32(row[0]);

                facture fact = new facture();
                fact.ShowDialog();
            }
        }
Example #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (cbTypePaie.Text == "Liquide")
            {
                typepair           = "Liquide";
                txtCreditBoss.Text = "";
            }
            else if (cbTypePaie.Text == "Credit")
            {
                typepair           = "Credit";
                txtCreditBoss.Text = "";
            }
            else if (cbTypePaie.Text == "Liquide avec credit Boss")
            {
                typepair = "Liquide avec credit Boss";
            }
            if (comboBox1.Text == "En gros")
            {
                typemvt      = "En gros";
                lbtotal.Text = "" + float.Parse(txtnbpiece.Text) * float.Parse(lbprixg.Text);
            }
            else if (comboBox1.Text == "Detail")
            {
                typemvt      = "Detail";
                lbtotal.Text = "" + float.Parse(txtnbpiece.Text) * float.Parse(lbprixd.Text);
            }
            else
            {
                MessageBox.Show("Completer tous les champs!!");
            }

            if (int.Parse(lbqte.Text) < int.Parse(txtnbpiece.Text) || cbTypePaie.Text == "")
            {
                MessageBox.Show("Impossible de continuer cette operation \n stock insuffisant pour cet article!! \n verifier type de paiement \n ou type de mouvement");
            }
            else
            {
                if (lbcode.Text == "" || lbdesign.Text == "" || lbprixd.Text == "" || lbprixd.Text == "" || lbprixg.Text == "" || lbtotal.Text == "" || txtnbpiece.Text == "")
                {
                    MessageBox.Show("Operation impossible les champs sont vides");
                }
                else
                {
                    clsmvt mvt = new clsmvt();
                    mvt.Ref_art   = lbcode.Text;
                    mvt.Ref_cl    = txtcodecl.Text;
                    mvt.Lblmvt    = lbdesign.Text;
                    mvt.Nbpieces  = txtnbpiece.Text;
                    mvt.Prix_gro  = lbprixg.Text;
                    mvt.Prix_U    = lbprixd.Text;
                    mvt.Totalpaie = lbtotal.Text;
                    mvt.Typemvt   = typemvt;
                    mvt.Typepaie  = typepair;
                    mvt.Ref_agent = label17.Text;
                    mvt.VoirBoss  = txtCreditBoss.Text;

                    if (glos.InsertMvt(mvt) == true)
                    {
                        try
                        {
                            facture j = new facture();
                            j.DataSource = glossaire.Instance.sortieFacture(mvt.Ref_art);
                            ReportPrintTool printTool = new ReportPrintTool(j);
                            printTool.ShowPreviewDialog();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    glos.GetDatas(gridControl1, "code_art,designation,nbpieces,fss,provenance,prix_u,prix_gros", "article");
                    lbtotal.Text      = "00.0";
                    lbcode.Text       = "";
                    lbdesign.Text     = "";
                    lbprixd.Text      = "";
                    lbprixg.Text      = "";
                    lbqte.Text        = "";
                    txtnbpiece.Text   = "";
                    txtcodecl.Enabled = true;
                }
            }
        }