コード例 #1
0
        public List <Models.PRIOALERTAS> Catalogo()
        {
            OpenDbConn();

            DAL.PRIOALERTAS cPRIOALERTAS = new DAL.PRIOALERTAS(cDblib);
            return(cPRIOALERTAS.Catalogo());
        }
コード例 #2
0
        public int Update(Models.PRIOALERTAS oPRIOALERTAS)
        {
            Guid methodOwnerID = new Guid("1efd6df0-8ebe-42e3-a1e1-ef71b020dc68");

            OpenDbConn();

            if (cDblib.Transaction.ownerID.Equals(new Guid()))
            {
                cDblib.beginTransaction(methodOwnerID);
            }

            try
            {
                DAL.PRIOALERTAS cPRIOALERTAS = new DAL.PRIOALERTAS(cDblib);

                int result = cPRIOALERTAS.Update(oPRIOALERTAS);

                //Finalizar transacción
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.commitTransaction(methodOwnerID);
                }

                return(result);
            }
            catch (Exception ex)
            {
                //rollback
                //if (cDblib.Transaction.ownerID.Equals(new Guid())) cDblib.rollbackTransaction(methodOwnerID);
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.rollbackTransaction(methodOwnerID);
                }
                throw ex;
            }
        }
コード例 #3
0
        public int Insert(Models.PRIOALERTAS oPRIOALERTAS)
        {
            Guid methodOwnerID = new Guid("afb9ebac-943a-4752-a77c-b7d83c7eee80");

            OpenDbConn();

            if (cDblib.Transaction.ownerID.Equals(new Guid()))
            {
                cDblib.beginTransaction(methodOwnerID);
            }

            try
            {
                DAL.PRIOALERTAS cPRIOALERTAS = new DAL.PRIOALERTAS(cDblib);

                int idPRIOALERTAS = cPRIOALERTAS.Insert(oPRIOALERTAS);

                //Finalizar transacción
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.commitTransaction(methodOwnerID);
                }

                return(idPRIOALERTAS);
            }
            catch (Exception ex)
            {
                //rollback
                //if (cDblib.Transaction.ownerID.Equals(new Guid())) cDblib.rollbackTransaction(methodOwnerID);
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.rollbackTransaction(methodOwnerID);
                }
                throw ex;
            }
        }