예제 #1
0
        public string Nuevo_cliente(ClientesEN clientes)
        {
            try
            {
                SessionInitializeTransaction ();

                session.Save (clientes);
                SessionCommit ();
            }

            catch (Exception ex) {
                SessionRollBack ();
                if (ex is VeterinaryManagerGenNHibernate.Exceptions.ModelException)
                        throw ex;
                throw new VeterinaryManagerGenNHibernate.Exceptions.DataLayerException ("Error in ClientesCAD.", ex);
            }

            finally
            {
                SessionClose ();
            }

            return clientes.Dni;
        }
예제 #2
0
 public ClientesEN(ClientesEN clientes)
 {
     this.init (clientes.Dni, clientes.Nombre, clientes.Apellido, clientes.Email, clientes.Telefono, clientes.Direccion, clientes.Citas, clientes.Fecha, clientes.Animales);
 }
예제 #3
0
        public void Modify(ClientesEN clientes)
        {
            try
            {
                SessionInitializeTransaction ();
                ClientesEN clientesEN = (ClientesEN)session.Load (typeof(ClientesEN), clientes.Dni);

                clientesEN.Nombre = clientes.Nombre;

                clientesEN.Apellido = clientes.Apellido;

                clientesEN.Email = clientes.Email;

                clientesEN.Telefono = clientes.Telefono;

                clientesEN.Direccion = clientes.Direccion;

                clientesEN.Fecha = clientes.Fecha;

                session.Update (clientesEN);
                SessionCommit ();
            }

            catch (Exception ex) {
                SessionRollBack ();
                if (ex is VeterinaryManagerGenNHibernate.Exceptions.ModelException)
                        throw ex;
                throw new VeterinaryManagerGenNHibernate.Exceptions.DataLayerException ("Error in ClientesCAD.", ex);
            }

            finally
            {
                SessionClose ();
            }
        }