Exemple #1
0
        internal static bool ExecuteTransaction(IMTS_MINUTES.DataBase.IMTSDB_NEW ds, string[] tableName)
        {
            try
            {
                foreach (string tbName in tableName)
                {
                    ds.Tables[tbName].WriteXml(Utils.getBasePathName + tbName + ".xml", XmlWriteMode.WriteSchema);
                }



                return(true);
            }
            catch
            {
                //inchioda il programma
                WriteAppStartToKO();
                return(false);
            }
        }
Exemple #2
0
        internal static bool ClearTransaction(IMTS_MINUTES.DataBase.IMTSDB_NEW ds, string[] tableName)
        {
            try
            {
                string[] filePaths = Directory.GetFiles(Utils.getBasePathName + "BackUp\\");
                foreach (string filePath in filePaths)
                {
                    File.Delete(filePath);
                }

                foreach (string tbName in tableName)
                {
                    ds.Tables[tbName].WriteXml(Utils.getBasePathName + "BackUp\\" + tbName + ".xmlBAK", XmlWriteMode.WriteSchema);
                }

                return(true);
            }
            catch
            {
                //inchioda il programma
                WriteAppStartToKO();
                return(false);
            }
        }