예제 #1
0
        private void navBarItem12_LinkClicked_1(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            timer2.Start();
            if (SplashScreenManager.Default != null && SplashScreenManager.Default.IsSplashFormVisible)
            {
                SplashScreenManager.CloseForm();
            }
            SplashScreenManager.ShowForm(typeof(WaitForm1));
            if (cdeeee == null)
            {
                cdeeee = new cde_recu();
            }
            else
            {
                wait = 1;
            }


            cdeeee.MdiParent = Form1.ActiveForm;
            cdeeee.Show();
            cdeeee.BringToFront();
        }
예제 #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            // les icones de fichiers
            if (textEdit1.Text != "")
            {
                labelControl4.Text = "";
                byte[] extention;
                Image  word, excel, powerpoint, access, pdf, txt, pic, other;
                word       = (System.Drawing.Image)Properties.Resources.word;
                excel      = (System.Drawing.Image)Properties.Resources.excel;
                powerpoint = (System.Drawing.Image)Properties.Resources.powerpoint;
                access     = (System.Drawing.Image)Properties.Resources.access;
                pdf        = (System.Drawing.Image)Properties.Resources.pdf;
                txt        = (System.Drawing.Image)Properties.Resources.txt;
                pic        = (System.Drawing.Image)Properties.Resources.pic;
                other      = (System.Drawing.Image)Properties.Resources.format_inconnu;
                if (cde_recu.oper == "modifier")
                {
                    if (textEdit2.Text == "")
                    {
                        fun.update_contrat_ficheeeee2(textEdit1.Text, lookUpEdit1.Text, dateEdit1.Text, memoEdit1.Text, cde_recu.id_fich);
                        this.Close();
                    }
                    else
                    {
                        imgdata = ReadFile(textEdit2.Text);
                        ImageConverter converter = new ImageConverter();
                        if (ext == ".pdf")
                        {
                            extention = (byte[])converter.ConvertTo(pdf, typeof(byte[]));
                        }
                        else if (ext == ".doc" || ext == ".docx")
                        {
                            extention = (byte[])converter.ConvertTo(word, typeof(byte[]));
                        }
                        else if (ext == ".xls" || ext == ".xlsx")
                        {
                            extention = (byte[])converter.ConvertTo(excel, typeof(byte[]));
                        }
                        else if (ext == ".ppt" || ext == ".pptx")
                        {
                            extention = (byte[])converter.ConvertTo(powerpoint, typeof(byte[]));
                        }
                        else if (ext == ".mdb" || ext == ".accdb")
                        {
                            extention = (byte[])converter.ConvertTo(access, typeof(byte[]));
                        }
                        else if (ext == ".txt")
                        {
                            extention = (byte[])converter.ConvertTo(txt, typeof(byte[]));
                        }
                        else if (ext == ".gif" || ext == ".jpg" || ext == ".JPEG" || ext == ".png" || ext == ".bmp")
                        {
                            extention = (byte[])converter.ConvertTo(pic, typeof(byte[]));
                        }
                        else
                        {
                            extention = (byte[])converter.ConvertTo(other, typeof(byte[]));
                        }
                        fun.update_contrat_fich32(textEdit1.Text, lookUpEdit1.Text, dateEdit1.Text, memoEdit1.Text, extention, ext, imgdata, cde_recu.id_fich);


                        //fun.update_contrat_fich3(cde_recu.id_fich, cde_recu.cd_cont, filename, imgdata, textEdit1.Text, ext, numBytes.ToString(), extention);
                        this.Close();
                    }
                }
                if (cde_recu.oper == "ajouter")
                {
                    if (textEdit2.Text == "")
                    {
                        labelControl4.Text = "Vous n'avez pas encore ajouté un fichier!";
                    }
                    else
                    {
                        imgdata = ReadFile(textEdit2.Text);
                        ImageConverter converter = new ImageConverter();

                        if (ext == ".pdf")
                        {
                            extention = (byte[])converter.ConvertTo(pdf, typeof(byte[]));
                        }
                        else if (ext == ".doc" || ext == ".docx")
                        {
                            extention = (byte[])converter.ConvertTo(word, typeof(byte[]));
                        }
                        else if (ext == ".xls" || ext == ".xlsx")
                        {
                            extention = (byte[])converter.ConvertTo(excel, typeof(byte[]));
                        }
                        else if (ext == ".ppt" || ext == ".pptx")
                        {
                            extention = (byte[])converter.ConvertTo(powerpoint, typeof(byte[]));
                        }
                        else if (ext == ".mdb" || ext == ".accdb")
                        {
                            extention = (byte[])converter.ConvertTo(access, typeof(byte[]));
                        }
                        else if (ext == ".txt")
                        {
                            extention = (byte[])converter.ConvertTo(txt, typeof(byte[]));
                        }
                        else if (ext == ".gif" || ext == ".jpg" || ext == ".JPEG" || ext == ".png" || ext == ".bmp")
                        {
                            extention = (byte[])converter.ConvertTo(pic, typeof(byte[]));
                        }

                        else
                        {
                            extention = (byte[])converter.ConvertTo(other, typeof(byte[]));
                        }

                        fun.insert_retour2(textEdit1.Text, lookUpEdit1.Text, dateEdit1.Text, memoEdit1.Text, extention, ext, imgdata);

                        this.Close();
                    }
                }
                cde_recu cdrecu = new cde_recu();
                cdrecu.Show();
            }
            else
            {
                labelControl4.Text = "La description ne peut être vide";
            }
        }