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(); } } } }
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; } } } }
public bool UpdateTipoNivel(ClTipoNivel tipNIvel, int idTipoNivel)//actualizar tipo nivel { return(serv.actualizarTipoNivel(tipNIvel, idTipoNivel)); }
public void PostInsertarTipoNivel(ClTipoNivel tipnivel)//insertar un tipo nivel { serv.InsertarTipoNivel(tipnivel); }