Пример #1
0
        private void m_btnSaveSession_Click(object sender, EventArgs e)
        {
            CConfigMappagesSmartImport config = null;
            DataTable      tableSource        = null;
            CResultAErreur res = PrepareImport(ref config, ref tableSource);

            if (!res)
            {
                CFormAlerte.Afficher(res.Erreur);
                return;
            }
            m_sessionImport.ConfigMappage = config;
            m_sessionImport.TableSource   = tableSource;
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = I.T("Import session(*.futimpses)|*.futimpses|All files|*.*|20148");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                m_lblImportSession.Text = dlg.FileName;
                CResultAErreur result = CSerializerObjetInFile.SaveToFile(m_sessionImport, "IMPORT_SESSION", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                    return;
                }
            }
            return;
        }
Пример #2
0
        //---------------------------------------------------------
        public CResultAErreur SaveHelp(CHelpData help)
        {
            CResultAErreur result       = CResultAErreur.True;
            string         strFileTitle = GetFileTitle(help);     // >> Créé une instance au niveau de l'index

            if (!help.HasData)
            {
                try
                {
                    if (File.Exists(RepertoireDeBase + strFileTitle))
                    {
                        File.Delete(RepertoireDeBase + strFileTitle);
                        m_tableAides.Remove(help.HelpKey);
                    }
                }
                catch
                {
                }
                return(result);
            }


            //S'assure que le chemin du fichier existe
            string strFichier = RepertoireDeBase + strFileTitle;

            m_tableAides[help.HelpKey] = help;
            SaveFichierIndex();

            return(CSerializerObjetInFile.SaveToFile(help, c_cleFichier, strFichier));
        }
Пример #3
0
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            if (m_arbre.Nodes.Count == 0)
            {
                return;
            }
            CRepertoire dossier = m_arbre.Nodes[0].Tag as CRepertoire;

            if (dossier != null)
            {
                SaveFileDialog dlg = new SaveFileDialog();
                dlg.Filter = "External explorer file|*.extExp|All files|*.*";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    CResultAErreur result = CSerializerObjetInFile.SaveToFile(dossier,
                                                                              "EXTERNAL_EXPLORER",
                                                                              dlg.FileName
                                                                              );
                    if (result)
                    {
                        MessageBox.Show("Save ok");
                    }
                    else
                    {
                        MessageBox.Show(result.Erreur.ToString());
                    }
                }
            }
        }
 private void m_btnSave_Click(object sender, EventArgs e)
 {
     if (this.ComposantPhysiqueEdite == null)
     {
         CFormAlerte.Afficher(I.T("No symbol to save|30378"));
     }
     else
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter = I.T("3D object (*.3D)|*.3D|All files (*.*)|*.*|30376");
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             string         strNomFichier = dlg.FileName;
             CResultAErreur result        = CSerializerObjetInFile.SaveToFile(ComposantPhysiqueEdite, C2iComposant3D.c_idFichier, strNomFichier);
             if (!result)
             {
                 CFormAlerte.Afficher(result);
             }
             else
             {
                 CFormAlerte.Afficher(I.T("Save successful|30377"));
             }
         }
     }
 }
Пример #5
0
        //----------------------------------------------------------------
        public static CResultAErreur SaveConfig(CMemoryDb db)
        {
            string         StrFile = GetHotelConfigPath();
            CResultAErreur result  = CSerializerObjetInFile.SaveToFile(db, "DATA_HOTEL_CONFIG", StrFile);

            return(result);
        }
Пример #6
0
        private void m_btnSaveConfig_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = I.T("Paste map file|*.2iPasteMap|20825");
            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            CMapColToColSerializable map = new CMapColToColSerializable();

            foreach (KeyValuePair <DataColumn, string> kv in m_dicMaps)
            {
                if (kv.Value != null)
                {
                    map[kv.Key.ColumnName] = kv.Value;
                }
            }
            CResultAErreur result = CSerializerObjetInFile.SaveToFile(map, CMapColToColSerializable.c_fileSgn, dlg.FileName);

            if (!result)
            {
                CFormAlerte.Afficher(result.Erreur);
            }
        }
Пример #7
0
        //-------------------------------------------------
        public CResultAErreur SaveFile(string strNomFichier)
        {
            CResultAErreur result = CResultAErreur.True;

            result = CSerializerObjetInFile.SaveToFile(this, "CONFIG_PLANNING", strNomFichier);
            if (result)
            {
                m_strNomFichier = strNomFichier;
            }
            return(result);
        }
Пример #8
0
        //------------------------------------------------------------
        private void SaveWithoutSources()
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "Easy query|*.esq|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CEasyQuery query = m_editeur.ObjetEdite as CEasyQuery;
                CSerializerObjetInFile.SaveToFile(query, "QUERY", dlg.FileName);
                m_bSaveWithSource = false;
            }
        }
Пример #9
0
        //-------------------------------------------------
        public static void SetDbInventaire(CReleveDb db)
        {
            m_dbReleve = db;
            db.AcceptChanges();
            DateTime dt = DateTime.Now;

            CSerializerObjetInFile.SaveToFile(m_dbReleve, c_cleFichierInventaire, GetNomFichierSurvey());
            //m_dbReleve.WriteXml(GetNomFichierSurvey(), System.Data.XmlWriteMode.WriteSchema);
            db.AcceptChanges();
            TimeSpan sp = DateTime.Now - dt;

            System.Console.WriteLine("Save dbSurvey : " + sp.TotalMilliseconds);
        }
Пример #10
0
        //-------------------------------------------------
        public static void SetDbTimos(CMemoryDb db)
        {
            m_dbTimos = db;
            db.AcceptChanges();
            DateTime dt = DateTime.Now;

            GetInventaireDatas().TimosDb = db;
            //m_dbTimos.WriteXml(GetNomFichierTimosData(), System.Data.XmlWriteMode.WriteSchema);
            CSerializerObjetInFile.SaveToFile(m_dbTimos, c_cleFichierTimos, GetNomFichierTimosData());
            TimeSpan sp = DateTime.Now - dt;

            System.Console.WriteLine("Save dbTimos : " + sp.TotalMilliseconds);
        }
Пример #11
0
        //------------------------------------------------------------
        private void SaveWithSources()
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "Easy query|*.esq|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CEasyQuery           query = m_editeur.ObjetEdite as CEasyQuery;
                CEasyQueryAvecSource qas   = CEasyQueryAvecSource.FromQuery(query);
                CSerializerObjetInFile.SaveToFile(qas, "QUERYWITHSOURCE", dlg.FileName);
                m_bSaveWithSource = true;
            }
        }
        //---------------------------------------------------------------------------------
        public CResultAErreur SaveConfig()
        {
            CResultAErreur result = CResultAErreur.True;

            string strFileTmp = GetConfigFileName() + ".tmp";

            result = CSerializerObjetInFile.SaveToFile(DataBase, "FUT_MEDIATION_DATA", strFileTmp);
            if (result)
            {
                File.Delete(GetConfigFileName());
                File.Move(strFileTmp, GetConfigFileName());
            }
            return(result);
        }
Пример #13
0
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "#Macro|*.FutMacro|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CResultAErreur result = CSerializerObjetInFile.SaveToFile(m_macro, "MACRO", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
            }
        }
        //---------------------------------------------------------------
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = I.T("Graphical formula|*.grafexp|All files|*.*|20004");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CResultAErreur result = CSerializerObjetInFile.SaveToFile(RepresentationEditee, C2iExpressionGraphique.c_cleFichier, dlg.FileName);
                if (!result)
                {
                    CFormAfficheErreur.Show(result.Erreur);
                }
            }
        }
        private void m_btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = I.T("Form|*.form|All files|*.*|20017");
            if (!(WndEditee is C2iWndFenetre))
            {
                CFormAlerte.Afficher(I.T("Unavailable|20018"));
                return;
            }
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CResultAErreur result = CSerializerObjetInFile.SaveToFile(WndEditee, "FORM", dlg.FileName);
            }
        }
Пример #16
0
 //---------------------------------------------------------------------------
 private void m_btnSaveConfig_Click(object sender, EventArgs e)
 {
     using (SaveFileDialog dlg = new SaveFileDialog())
     {
         dlg.Filter = I.T("Dependancies search configuration|*.depConf|All files|*.*|20011");
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             CConfigurationRechercheEntites configuration = m_configuration;
             CResultAErreur result = CSerializerObjetInFile.SaveToFile(configuration, c_cleFichier, dlg.FileName);
             if (!result)
             {
                 CFormAlerte.Afficher(result.Erreur);
             }
         }
     }
 }
Пример #17
0
 //----------------------------------------------------------------------------------
 private void m_btnSave_Click(object sender, EventArgs e)
 {
     if (m_actionFinale != null)
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter = I.T("Action (*.2iAction)|*.2iAction|All files (*.*)|*.*|20867");
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             string         strNomFichier = dlg.FileName;
             CActionSaver   saver         = new CActionSaver(m_actionFinale);
             CResultAErreur result        = CSerializerObjetInFile.SaveToFile(saver, CActionSur2iLink.c_idFichier, strNomFichier);
             if (!result)
             {
                 CFormAlerte.Afficher(result);
             }
             else
             {
                 CFormAlerte.Afficher(I.T("Save successful|20868"));
             }
         }
     }
 }
Пример #18
0
        //--------------------------------------------------------------
        private void m_btnImporter_Click(object sender, EventArgs e)
        {
            CConfigMappagesSmartImport config = null;
            DataTable      table  = null;
            CResultAErreur result = PrepareImport(ref config, ref table);

            if (!result || table == null)
            {
                CFormAlerte.Afficher(result.Erreur);
                return;
            }
            if (!CFormOptionsImport.EditeOptions(m_optionsExecution))
            {
                return;
            }

            IIndicateurProgression indicateur = null;

            indicateur = CFormProgression.GetNewIndicateurAndPopup(I.T("Importing data|20245"));
            CResultAErreurType <CSessionImport> resSession;

            resSession = config.DoImportSurServeur(CSc2iWin32DataClient.ContexteCourant.IdSession,
                                                   table,
                                                   m_optionsExecution,
                                                   indicateur);
            CFormProgression.EndIndicateur(indicateur);
            if (m_optionsExecution.NomFichierSauvegarde != null &&
                m_optionsExecution.NomFichierSauvegarde.Length > 0)
            {
                result = CSerializerObjetInFile.SaveToFile(resSession.DataType, "IMPORT_SESSION", m_optionsExecution.NomFichierSauvegarde);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
            }
            SetSessionEnCours(resSession.DataType);
            CFormEditionSessionImport.EditeSession(m_sessionImport);
        }
Пример #19
0
        //-----------------------------------------------------------------
        private bool SaveConfig()
        {
            CResultAErreurType <CConfigMappagesSmartImport> res = m_ctrlSetup.GetConfigFinale();

            if (!res || res.DataType == null)
            {
                CFormAlerte.Afficher(res.Erreur);
                return(false);
            }
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = I.T("Import structure(*.futimp)|*.futimp|All files|*.*|20122");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CResultAErreur result = CSerializerObjetInFile.SaveToFile(res.DataType, "IMPORT_STRUCT", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                    return(false);
                }
            }
            return(true);
        }
Пример #20
0
 //-------------------------------
 public static CResultAErreur Save(string strFichier)
 {
     return(CSerializerObjetInFile.SaveToFile(Instance, "MIBPRJ", strFichier));
 }
Пример #21
0
        //---------------------------------------------------------
        public CResultAErreur SaveMenu()
        {
            string strFichier = RepertoireDeBase + c_strFichiersMenu;

            return(CSerializerObjetInFile.SaveToFile(m_menu, c_cleFichiersMenu, strFichier));
        }
Пример #22
0
        //---------------------------------------------------------
        private void SaveFichierIndex()
        {
            string strFichier = RepertoireDeBase + c_strFichierIndex;

            CSerializerObjetInFile.SaveToFile(m_index, c_cleFichierIndex, strFichier);
        }
Пример #23
0
        //--------------------------------------
        public static CResultAErreur Save(string strFichier)
        {
            CResultAErreur result = CSerializerObjetInFile.SaveToFile(Instance, c_strCleFichier, strFichier);

            return(result);
        }