Ejemplo n.º 1
0
        //-------------------------------------------------
        public static string GetNomFichierSurvey()
        {
            string strPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            if (strPath[strPath.Length - 1] != '\\')
            {
                strPath += "\\";
            }
            strPath += "TimosInventory\\TimosSurvey.dat";
            CUtilRepertoire.AssureRepertoirePourFichier(strPath);
            return(strPath);
        }
Ejemplo n.º 2
0
        //----------------------------------------------------------------
        private static string GetHotelConfigPath()
        {
            string strPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);

            if (strPath[strPath.Length - 1] != '\\')
            {
                strPath += "\\";
            }
            strPath += "Futurocom.data.hotel\\";
            strPath += m_strRoomId + ".hotel.config";
            CUtilRepertoire.AssureRepertoirePourFichier(strPath);
            return(strPath);
        }
Ejemplo n.º 3
0
        //----------------------------------------------------------------------------------
        private static string GetRepertoire(string strRepertoire)
        {
            CResultAErreurType <string> res = new CResultAErreurType <string>();
            string strPath = AppDataPath;

            if (strPath[strPath.Length - 1] != '\\')
            {
                strPath += "\\";
            }
            if (!Directory.Exists(strPath + strRepertoire))
            {
                CUtilRepertoire.AssureRepertoire(strPath + strRepertoire);
            }
            return(strPath + strRepertoire);
        }
Ejemplo n.º 4
0
        //--------------------------------------------------------------------
        public CResultAErreur SetData(string strTableId, string strIdEntite, string strIdChamp, DateTime dt, double fVal)
        {
            string   strFile  = GetPathForData(strTableId, strIdEntite, strIdChamp, dt);
            DateTime dtChrono = DateTime.Now;

            m_spAssureRep += DateTime.Now - dtChrono;
            FileStream stream = null;

            dtChrono = DateTime.Now;
            if (!File.Exists(strFile))
            {
                CUtilRepertoire.AssureRepertoirePourFichier(strFile);
                stream = new FileStream(strFile, FileMode.CreateNew, FileAccess.Write);
            }
            else
            {
                stream = new FileStream(strFile, FileMode.Append, FileAccess.Write);
            }

            BinaryWriter   writer = new BinaryWriter(stream);
            CDataRoomEntry rec    = new CDataRoomEntry(dt, fVal);

            rec.Write(writer);
            writer.Close();
            writer.Dispose();
            stream.Close();
            stream.Dispose();
            m_spWrite += DateTime.Now - dtChrono;
            CPlageDates plage = GetPlageDates(strTableId);

            if (dt > plage.DateMax)
            {
                plage.DateMax = dt;
            }
            if (dt < plage.DateMin)
            {
                plage.DateMin = dt;
            }
            return(CResultAErreur.True);
        }