public void Grabar(Rol rol) { if (rol.Id == 0) new RolDA().Save(rol); else new RolDA().Update(rol); }
public frmAgregarRol() { InitializeComponent(); this.rol = new Rol(); rol.Id = 0; IND_MENSAJE = Utils.Utils.REGISTRO_OK; init(); }
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; }
public frmAgregarRol(Rol rol) { InitializeComponent(); init(); this.rol = rol; btnRegistrar.Text = "Modificar"; IND_MENSAJE = Utils.Utils.MODIFICACION_OK; this.txtRol.Text = rol.Descripcion; }
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(); } } } }
public void SaveOrUpdate(Rol instance) { NHibernateHelper.GetCurrentSession().Merge(instance); }