예제 #1
0
 public void Create(Usuario usuario)
 {
     try
     {
         HashedPass         = GetMD5(usuario.Contrasena);
         usuario.Contrasena = HashedPass;
         _crudFactory.Create(usuario);
         gestorAccion.Create(AccionPara);
     }
     catch (TRV_Exception ex)
     {
         throw ex;
     }
     catch (SqlException sqlEx)
     {
         if (sqlEx.Number == 2627) //2627, es para llaves duplicadas.
         {
             throw gestorEx.controlarExcepcion(new TRV_Exception(TRV_Exception.ExceptionCode.CedulaDuplicada));
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #2
0
 public void Create(TipoTiquete tipo)
 {
     try
     {
         _crudFactory.Create(tipo);
         gestorAccion.Create(AccionPara);
     }
     catch (TRV_Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public void CreateLinea(Linea linea)
 {
     try
     {
         _crudFactory.Create(linea);
         gestorAccion.Create(AccionPara);
     }
     catch (TRV_Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 public void CreateEstacion(Estacion estacion)
 {
     try
     {
         _crudFactory.Create(estacion);
         gestorAccion.Create(AccionPara);
     }
     catch (TRV_Exception ex)
     {
         throw ex;
     }
 }
예제 #5
0
 public void Create(Incidencia incidencia)
 {
     if (!string.IsNullOrEmpty(Convert.ToString(incidencia.Codigo)))
     {
         _crudFactory.Create(incidencia);
         gestorAccion.Create(AccionPara);
     }
     else
     {
         throw new Exception();
     }
 }
예제 #6
0
 public void Create(Cliente cliente)
 {
     if (!string.IsNullOrEmpty(Convert.ToString(cliente.Cedula)))
     {
         _crudFactory.Create(cliente);
         gestorAccion.Create(AccionPara);
     }
     else
     {
         throw new Exception();
     }
 }
예제 #7
0
        public void CreateVagon(Vagon vagon)
        {
            if (!string.IsNullOrEmpty(vagon.IdTren + ""))
            {
                _crudFactory.Create(vagon);
                Vagon v = obtenerUltimoVagonRegistrado();
                v.crearAsientos();

                for (int i = 0; i < vagon.CantAsientos; i++)
                {
                    _gestorAsiento.CreateAsiento(v.listaAsientos.ElementAt(i));
                }
                gestorAccion.Create(AccionPara);
            }
            else
            {
                throw new Exception();
            }
        }