Ejemplo n.º 1
0
 public void Grabar(Rol rol)
 {
     if (rol.Id == 0)
         new RolDA().Save(rol);
     else
         new RolDA().Update(rol);
 }
Ejemplo n.º 2
0
 public frmAgregarRol()
 {
     InitializeComponent();
     this.rol = new Rol();
     rol.Id = 0;
     IND_MENSAJE = Utils.Utils.REGISTRO_OK;
     init();
 }
Ejemplo n.º 3
0
 private void frmBusquedaRol_Load(object sender, EventArgs e)
 {
     IList<Rol> roles = new RolBL().GetAll();
     Rol seleccione = new Rol();
     seleccione.Descripcion = "Seleccione";
     roles.Insert(0, seleccione);
     cboRol.DataSource = roles;
 }
Ejemplo n.º 4
0
 public frmAgregarRol(Rol rol)
 {
     InitializeComponent();
     init();
     this.rol = rol;
     btnRegistrar.Text = "Modificar";
     IND_MENSAJE = Utils.Utils.MODIFICACION_OK;
     this.txtRol.Text = rol.Descripcion;
 }
Ejemplo n.º 5
0
        public void Update(Rol instance)
        {
            ISession hisession = null;
            try
            {
                hisession = NHibernateHelper.GetCurrentSession();
                hisession.BeginTransaction();
                hisession.Merge(instance);
                hisession.Transaction.Commit();
                hisession.Close();
            }
            catch (Exception ex)
            {
                if (hisession != null)
                {
                    if (hisession.IsOpen)
                    {
                        hisession.Close();

                    }
                }

            }
        }
Ejemplo n.º 6
0
 public void SaveOrUpdate(Rol instance)
 {
     NHibernateHelper.GetCurrentSession().Merge(instance);
 }