Esempio n. 1
0
        public bool actualizarTipoNivel(ClTipoNivel tipNivel, int idTipoNivel)
        {
            ISession mySesions = SessionFactory.OpenSession;

            using (mySesions)
            {
                using (ITransaction transaction = mySesions.BeginTransaction())
                {
                    try
                    {
                        IQuery      query  = mySesions.CreateQuery("FROM ClTipoNivel WHERE idTipoNivel=: idTipoNivel").SetInt32("idTipoNivel", idTipoNivel);
                        ClTipoNivel tipNIv = query.List <ClTipoNivel>()[0];
                        tipNIv.descTipoNivel = tipNivel.descTipoNivel;
                        tipNIv.codTipoNivel  = tipNivel.codTipoNivel;
                        mySesions.Update(tipNIv);
                        transaction.Commit();
                        return(true);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                    finally
                    {
                        mySesions.Flush();
                    }
                }
            }
        }
Esempio n. 2
0
        public void InsertarTipoNivel(ClTipoNivel tipNivel)
        {
            ISession mySesions = SessionFactory.OpenSession;

            using (mySesions)
            {
                using (ITransaction transaction = mySesions.BeginTransaction())
                {
                    try
                    {
                        mySesions.Save(tipNivel);
                        transaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
        }
Esempio n. 3
0
 public bool UpdateTipoNivel(ClTipoNivel tipNIvel, int idTipoNivel)//actualizar tipo nivel
 {
     return(serv.actualizarTipoNivel(tipNIvel, idTipoNivel));
 }
Esempio n. 4
0
 public void PostInsertarTipoNivel(ClTipoNivel tipnivel)//insertar un tipo nivel
 {
     serv.InsertarTipoNivel(tipnivel);
 }