示例#1
0
        internal bool DeleteMaterialeWithTransaction(Int32 idMateriale)
        {
            //devo inserire prima il documento se non c'è o se c'è
            IMTS_MINUTES.DataBase.IMTSDB_NEW ds1 = new IMTS_MINUTES.DataBase.IMTSDB_NEW();

            //Int32 idPasseggero = ds.Tables[0].Rows.Count + 1;

            try
            {
                IMTS_MINUTES.DataBase.IMTSDB_NEW.Materiale_ContainerDataTable waDT;

                ds1.ReadXml(Utils.getBasePathName + "Materiale_Container.xml", System.Data.XmlReadMode.ReadSchema);
                string[] involvedTable = { "Materiale_Container" };
                if (!BLTransactionManager.ClearTransaction(ds1, involvedTable))
                {
                    return(false);
                }

                waDT = ds1.Materiale_Container;



                waDT.Select("Id_Materiale=" + idMateriale).FirstOrDefault().Delete();
                if (BLTransactionManager.ExecuteTransaction(ds1, involvedTable))
                {
                    return(true);
                }
                else
                {
                    throw new Exception("Errore transazione");
                }
            }
            catch (Exception ex)
            {
                BLExceptionHandler bLException = new BLExceptionHandler();
                if (bLException.WriteLog(DateTime.Now.ToShortDateString(), DateTime.Now, ex.Message, ex.Source, ex.StackTrace, ex.TargetSite.ToString(), ""))
                {
                    return(false);
                }
                else
                {
                    throw ex;
                }
            }
        }
示例#2
0
        internal IMTS_MINUTES.DataBase.IMTSDB_NEW.Tipologia_ContainerDataTable getContainers()
        {
            try
            {
                IMTS_MINUTES.DataBase.IMTSDB_NEW dataSet = new IMTS_MINUTES.DataBase.IMTSDB_NEW();
                dataSet.ReadXml(Utils.getBasePathName + "Tipologia_Container.xml", System.Data.XmlReadMode.IgnoreSchema);
                return(dataSet.Tipologia_Container);
            }

            catch (Exception ex)
            {
                BLExceptionHandler bLException = new BLExceptionHandler();
                if (bLException.WriteLog(DateTime.Now.ToShortDateString(), DateTime.Now, ex.Message, ex.Source, ex.StackTrace, ex.TargetSite.ToString(), ""))
                {
                    throw ex;
                }
                else
                {
                    throw ex;
                }
            }
        }