Example #1
0
        private void m_btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "External explorer file|*.extExp|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                DateTime       dt      = DateTime.Now;
                CRepertoire    dossier = new CRepertoire();
                CResultAErreur result  = CSerializerObjetInFile.ReadFromFile(dossier,
                                                                             "EXTERNAL_EXPLORER",
                                                                             dlg.FileName);
                TimeSpan sp = DateTime.Now - dt;

                if (result)
                {
                    m_dossierRacine = dossier;
                    FillTree();
                }
                else
                {
                    MessageBox.Show(result.Erreur.ToString());
                }
            }
        }
        private void m_btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("3D objet (*.3D)|*.3D|All files (*.*)|*.*|30376");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (CFormAlerte.Afficher(I.T("The current symbol will be replaced. Continue ?|30079"),
                                         EFormAlerteType.Question) == DialogResult.No)
                {
                    return;
                }
                C2iComposant3D newComposantPhysique = new C2iComposant3DConteneurDock();

                CResultAErreur result = CSerializerObjetInFile.ReadFromFile(newComposantPhysique, C2iComposant3D.c_idFichier, dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result);
                }
                else
                {
                    ComposantPhysiqueEdite = newComposantPhysique;
                }
            }
        }
Example #3
0
        //---------------------------------------------------------------
        private void m_btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "Easy query|*.esq|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CEasyQuery     query = m_editeur.ObjetEdite as CEasyQuery;
                CResultAErreur res   = CSerializerObjetInFile.ReadFromFile(query, "QUERY", dlg.FileName);
                if (!res)
                {
                    CEasyQueryAvecSource qas  = new CEasyQueryAvecSource();
                    CResultAErreur       res2 = CSerializerObjetInFile.ReadFromFile(qas, "QUERYWITHSOURCE", dlg.FileName);
                    if (res2)
                    {
                        m_bSaveWithSource = true;
                        query             = qas.GetEasyQuerySansSource();
                        res = CResultAErreur.True;
                    }
                }
                else
                {
                    m_bSaveWithSource = false;
                }
                if (!res)
                {
                    CFormAlerte.Afficher(res.Erreur);
                }
                Init(query);
                /*m_editeur.ObjetEdite = query;*/
                m_editeur.Refresh();
            }
        }
Example #4
0
        private void CFormMain_Load(object sender, EventArgs e)
        {
            using (CMemoryDb contexteMemoire = new CMemoryDb())
            {
                CResultAErreur result = CSerializerObjetInFile.ReadFromFile(
                    contexteMemoire, "TIMOS_INVENTORY_DATA", "c:\\partage\\timos\\TimosData.dat");

                if (!result)
                {
                    return;
                }

                /*m_txtSelectTypeEquipement.InitAvecFiltreDeBase(
                 *  contexteMemoire,
                 *  typeof(CTypeEquipement),
                 *  "Libelle",
                 *  null,
                 *  new CFiltreMemoryDb(CTypeEquipement.c_champLibelle + " LIKE @1"),
                 *  true);
                 *
                 * CTypeEquipement typeEquip = new CTypeEquipement(contexteMemoire);
                 * if (typeEquip.ReadIfExist("10225"))
                 * {
                 *  string strLabel = typeEquip.Libelle;
                 *  //m_txtSelectTypeEquipement.SelectedObject = typeEquip;
                 * }*/
            }
        }
Example #5
0
        private void m_btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("Action (*.2iAction)|*.2iAction|All files (*.*)|*.*|20867");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (CFormAlerte.Afficher(I.T("Action data will be replaced, continue|20866"),
                                         EFormAlerteType.Question) == DialogResult.No)
                {
                    return;
                }
                CActionSaver   saver  = new CActionSaver();
                CResultAErreur result = CSerializerObjetInFile.ReadFromFile(saver, CActionSur2iLink.c_idFichier, dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result);
                }
                else
                {
                    m_actionFinale = saver.Action;
                    SelectTypeAction(m_actionFinale != null ?
                                     m_actionFinale.GetType() :
                                     null);
                    UpdateVisuel();
                }
            }
        }
Example #6
0
 //-------------------------------------------------
 public static CReleveDb GetInventaireDatas()
 {
     if (m_dbReleve != null)
     {
         return(m_dbReleve);
     }
     m_dbReleve = new CReleveDb(m_dbTimos);
     if (File.Exists(GetNomFichierSurvey()))
     {
         /*try
          * {
          *  m_dbReleve.ReadXml(GetNomFichierSurvey(), System.Data.XmlReadMode.Auto);
          * }
          * catch (Exception e)
          * {
          *  CResultAErreur result = CResultAErreur.True;
          *  result.EmpileErreur(new CErreurException(e));
          *  result.EmpileErreur(I.T("Can not read data|20007"));
          *  CFormAlerte.Afficher(result.Erreur);
          *  m_dbTimos = new CMemoryDb();
          * }
          */
         DateTime       dt     = DateTime.Now;
         CResultAErreur result = CSerializerObjetInFile.ReadFromFile(m_dbReleve, c_cleFichierInventaire, GetNomFichierSurvey());
         TimeSpan       sp     = DateTime.Now - dt;
         System.Console.WriteLine("Read survey : " + sp.TotalMilliseconds);
         if (!result)
         {
             result.EmpileErreur(I.T("Can not read data|20007"));
             CFormAlerte.Afficher(result.Erreur);
             m_dbReleve = new CReleveDb(m_dbTimos);
         }
     }
     return(m_dbReleve);
 }
Example #7
0
        public CHelpData GetHelp(string strCle)
        {
            CResultAErreur result = CResultAErreur.True;
            CHelpData      help   = null;

            if (m_tableAides.Contains(strCle))
            {
                return((CHelpData)m_tableAides[strCle]);
            }


            string strFile = RepertoireDeBase + GetFileTitle(strCle);

            if (!File.Exists(strFile))
            {
                return(null);
            }


            help                 = new CHelpData();
            help.HelpKey         = strCle;
            m_tableAides[strCle] = help;
            result               = CSerializerObjetInFile.ReadFromFile(help, c_cleFichier, strFile);

            return(help);
        }
        private void m_btnOpenConfig_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();
            CResultAErreur           result = CSerializerObjetInFile.ReadFromFile(map, CMapColToColSerializable.c_fileSgn, dlg.FileName);

            if (!result)
            {
                CFormAlerte.Afficher(result.Erreur);
                return;
            }
            if (m_tableToMap != null)
            {
                foreach (KeyValuePair <string, string> kv in map)
                {
                    DataColumn col = m_tableToMap.Columns[kv.Key];
                    if (col != null)
                    {
                        m_dicMaps[col] = kv.Value;
                    }
                }
            }
            UpdatePanelMappage();
        }
        //-------------------------------------------------
        public CResultAErreur ReadFile(string strNomFichier)
        {
            CResultAErreur result = CResultAErreur.True;

            result = CSerializerObjetInFile.ReadFromFile(this, "CONFIG_PLANNING", strNomFichier);
            if (result)
            {
                m_strNomFichier = strNomFichier;
            }
            return(result);
        }
Example #10
0
        //-------------------------------
        public static CResultAErreur Load(string strFichier)
        {
            CProjetMib     projet = new CProjetMib();
            CResultAErreur result = CSerializerObjetInFile.ReadFromFile(projet, "MIBPRJ", strFichier);

            if (result)
            {
                m_defaultInstance = projet;
            }
            return(result);
        }
Example #11
0
        //--------------------------------------
        public static CResultAErreur Load(string strFichier)
        {
            CBaseTypesAlarmes baseTemp = new CBaseTypesAlarmes();
            CResultAErreur    result   = CSerializerObjetInFile.ReadFromFile(baseTemp, c_strCleFichier, strFichier);

            if (result)
            {
                m_instance = baseTemp;
                CCurentBaseTypesAlarmes.SetCurrentBase(m_instance);
            }
            return(result);
        }
        //---------------------------------------------------------------------------------
        public CResultAErreur ReadConfig()
        {
            CResultAErreur result = CResultAErreur.True;
            CMemoryDb      db     = new CMemoryDb();

            result = CSerializerObjetInFile.ReadFromFile(db, "FUT_MEDIATION_DATA", GetConfigFileName());
            if (result)
            {
                m_database = db;
                RegisterAllTypesInDb();
            }
            return(result);
        }
Example #13
0
        //---------------------------------------------------
        public CSourceAideFichier(string strRepertoire)
        {
            m_strRepertoire = strRepertoire;

            if (File.Exists(RepertoireDeBase + c_strFichierIndex))
            {
                CSerializerObjetInFile.ReadFromFile(m_index, c_cleFichierIndex, RepertoireDeBase + c_strFichierIndex);
            }
            if (File.Exists(RepertoireDeBase + c_strFichiersMenu))
            {
                //CSerializerObjetInFile.ReadFromFile(m_menu, c_cleFichiersMenu, RepertoireDeBase + c_strFichiersMenu);
            }
        }
Example #14
0
        //----------------------------------------------------------------
        public static CResultAErreur ReadConfig()
        {
            string         strFile = GetHotelConfigPath();
            CResultAErreur result  = CResultAErreur.True;

            if (File.Exists(strFile))
            {
                CMemoryDb db = new CMemoryDb();
                result = CSerializerObjetInFile.ReadFromFile(db, "DATA_HOTEL_CONFIG", strFile);
                if (!result)
                {
                    return(result);
                }
                m_database = db;
                UpdateOptimizedDb();
            }
            return(result);
        }
        private void m_btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("Graphical formula|*.grafexp|All files|*.*|20004");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                C2iExpressionGraphique rep    = new C2iExpressionGraphique();
                CResultAErreur         result = CSerializerObjetInFile.ReadFromFile(rep, C2iExpressionGraphique.c_cleFichier, dlg.FileName);
                if (!result)
                {
                    CFormAfficheErreur.Show(result.Erreur);
                }
                else
                {
                    this.Init(rep, m_fournisseurProprietes, m_objetAnalyse);
                }
            }
        }
Example #16
0
        private void m_btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "#Macro|*.FutMacro|All files|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CMacro macro = new CMacro();
                macro.ContexteDonnee = CSc2iWin32DataClient.ContexteCourant;
                CResultAErreur result = CSerializerObjetInFile.ReadFromFile(macro, "MACRO", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
                else
                {
                    Init(macro);
                }
            }
        }
 //---------------------------------------------------------------------------
 private void m_btnLoadConfig_Click(object sender, EventArgs e)
 {
     using (OpenFileDialog dlg = new OpenFileDialog())
     {
         dlg.Filter = I.T("Dependancies search configuration|*.depConf|All files|*.*|20011");
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             CConfigurationRechercheEntites configuration = new CConfigurationRechercheEntites();
             CResultAErreur result = CSerializerObjetInFile.ReadFromFile(configuration, c_cleFichier, dlg.FileName);
             if (!result)
             {
                 CFormAlerte.Afficher(result.Erreur);
             }
             else
             {
                 m_configuration = configuration;
                 m_panelOptions.Init(configuration);
             }
         }
     }
 }
        private void m_btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("Form|*.form|All files|*.*|20017");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                C2iWndFenetre fenetre = new C2iWndFenetre();

                CResultAErreur result = CSerializerObjetInFile.ReadFromFile(fenetre, "FORM", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                    return;
                }
                else
                {
                    Init(TypeEdite, EntiteEditee, fenetre, FournisseurProprietes);
                }
            }
        }
Example #19
0
        private void m_btnOpenSession_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("Import session(*.futimpses)|*.futimpses|All files|*.*|20148");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CSessionImport session = new CSessionImport();
                CResultAErreur result  = CSerializerObjetInFile.ReadFromFile(session, "IMPORT_SESSION", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                    return;
                }
                else
                {
                    m_lblImportSession.Text = dlg.FileName;
                    SetSessionEnCours(session);
                }
            }
            return;
        }
Example #20
0
        //-----------------------------------------------------------
        private void m_btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = I.T("Import structure(*.futimp)|*.futimp|All files|*.*|20122");
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                CConfigMappagesSmartImport config = new CConfigMappagesSmartImport();
                CResultAErreur             result = CSerializerObjetInFile.ReadFromFile(config, "IMPORT_STRUCT", dlg.FileName);
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur);
                }
                else
                {
                    if (MessageBox.Show(I.T("Current import structure will be replaced. Continue ?|20123"),
                                        "",
                                        MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        m_ctrlSetup.Fill(m_rootValues, config, m_sourceTable);
                    }
                }
            }
        }