예제 #1
0
        public void SaveOrUpdate(Area instance)
        {
            ISession hisession = null;
            try
            {
                hisession = NHibernateHelper.GetCurrentSession();
                hisession.BeginTransaction();
                if (instance.Id == 0)
                {
                    hisession.Save(instance);
                }
                else {
                    hisession.Update(instance);
                }
                hisession.Transaction.Commit();
                hisession.Close();
            }
            catch (Exception ex)
            {
                if (hisession != null)
                {
                    if (hisession.IsOpen)
                    {
                        hisession.Close();

                    }
                }

            }
        }
예제 #2
0
 private void frmBuscarEmpleado_Load(object sender, EventArgs e)
 {
     IList<Area> areas = new AreaBL().GetAll();
     Area todos = new Area();
     todos.Descripcion = "Todos";
     areas.Insert(0, todos);
     cboArea.DataSource = areas;
     btnSeleccionar.Visible = !(this.Owner is frmVentanaHome);
 }
예제 #3
0
 public void Grabar(Area instance)
 {
     new AreaDA().SaveOrUpdate(instance);
 }