public bool actualizarEstadoNivel(ClEstadoNivel estN, int idEstNivel) { ISession mySesions = SessionFactory.OpenSession; using (mySesions) { using (ITransaction transaction = mySesions.BeginTransaction()) { try { IQuery query = mySesions.CreateQuery("FROM ClEstadoNivel WHERE IdEstadoNivel=: idEstNivel").SetInt32("idEstNivel", idEstNivel); ClEstadoNivel estNiv = query.List <ClEstadoNivel>()[0]; estNiv.DescEstadoNivel = estN.DescEstadoNivel; mySesions.Update(estNiv); transaction.Commit(); return(true); } catch (Exception ex) { throw ex; } finally { mySesions.Flush(); } } } }
public void InsertarEstadoNivel(ClEstadoNivel estNiv) { ISession mySesions = SessionFactory.OpenSession; using (mySesions) { using (ITransaction transaction = mySesions.BeginTransaction()) { try { mySesions.Save(estNiv); transaction.Commit(); } catch (Exception ex) { throw ex; } } } }
public bool UpdateEstadoNivel(ClEstadoNivel estnivel, int idEstNivel)//actualizar Estados Niveles { return(serv.actualizarEstadoNivel(estnivel, idEstNivel)); }
public void PostEstadoNivel(ClEstadoNivel estnivel)//insertar Estados Niveles { serv.InsertarEstadoNivel(estnivel); }