Example #1
0
 public void Grabar(Rol rol)
 {
     if (rol.Id == 0)
         new RolDA().Save(rol);
     else
         new RolDA().Update(rol);
 }
Example #2
0
 public frmAgregarRol()
 {
     InitializeComponent();
     this.rol = new Rol();
     rol.Id = 0;
     IND_MENSAJE = Utils.Utils.REGISTRO_OK;
     init();
 }
Example #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;
 }
Example #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;
 }
Example #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();

                    }
                }

            }
        }
Example #6
0
 public void SaveOrUpdate(Rol instance)
 {
     NHibernateHelper.GetCurrentSession().Merge(instance);
 }