示例#1
0
        /// <summary>
        /// When the select csv is pressed
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arg</param>
        private void SelectCsvBtn_Click(object sender, EventArgs e)
        {
            // change initial directory
            SaveDialog.InitialDirectory = LastPath;
            SaveDialog.FileName         = CsvName.Text;
            if (SaveDialog.ShowDialog() == DialogResult.OK)
            {
                CsvName.Text = SaveDialog.FileName;

                InitProgressBar();
                ExportLab.Text    = "Exportation de la base de données en cours...";
                ExportLab.Visible = true;
                if (FileControl.ExportFile(CsvName.Text, ExportProgress))
                {
                    MessageBoxes.DispInfo("L'export est terminé");
                    this.Close();
                }
                else
                {
                    MessageBoxes.DispError("Une erreur est survenue lors de l'exportation");
                    ExportLab.Text = "L'opération a été intérompu, veuillez réessayer";
                }

                // save the path
                LastPath = SaveDialog.FileName;
                SaveLastPath();
            }
        }
示例#2
0
        /// <summary>
        /// Check if the fields are ok
        /// </summary>
        /// <returns>True if ok</returns>
        public bool AreInputOK()
        {
            SousFamille Used = SFCont.GetByName(new SousFamille(NameBox.Text));

            if (Used != null && Used.Nom != InitialName)
            {
                MessageBoxes.DispError("Le nom est déjà utilisé.");
                return(false);
            }
            if (NameBox.Text.Replace(" ", "") == "" ||
                FamBox.SelectedItem == null)
            {
                MessageBoxes.DispError("Au moins un champs est vide");
                return(false);
            }
            return(true);
        }
示例#3
0
        /// <summary>
        /// Check if the fields are OK
        /// </summary>
        /// <returns>true if ok</returns>
        public bool AreInputOK()
        {
            Article Used = ACont.GetByName(new Article(RefBox.Text, null, 0, 0, null, null));

            if (Used != null && Used.RefArticle != InitialRef)
            {
                MessageBoxes.DispError("La référence est déjà utilisée.");
                return(false);
            }
            if (DescriptionBox.Text.Replace(" ", "") == "" ||
                RefBox.Text.Replace(" ", "") == "" ||
                BrandBox.SelectedItem == null ||
                ChildFamilyBox.SelectedItem == null)
            {
                MessageBoxes.DispError("Au moins un champs est vide");
                return(false);
            }
            return(true);
        }