Example #1
0
 public DetalleMotor(int Id)
 {
     InitializeComponent();
     try
     {
         //Motor = General.GetEntityById<Motor>("Motor", "MotorID", Id);
         Motor = Datos.GetEntity<Motor>(c => c.MotorID == Id && c.Estatus);
         if (Motor == null)
             throw new EntityNotFoundException(Id.ToString(), "Motor");
         MotorView = Datos.GetEntity<MotoresView>(m => m.MotorID == Id);
         if (Motor == null)
             throw new EntityNotFoundException(Id.ToString(), "MotoresView");
         EsNuevo = false;
     }
     catch (Exception ex)
     {
         Util.MensajeError(ex.Message, GlobalClass.NombreApp);
     }
 }
Example #2
0
 public DetalleMotor(int Id)
 {
     InitializeComponent();
     try
     {
         //Motor = General.GetEntityById<Motor>("Motor", "MotorID", Id);
         Motor = Datos.GetEntity <Motor>(c => c.MotorID == Id && c.Estatus);
         if (Motor == null)
         {
             throw new EntityNotFoundException(Id.ToString(), "Motor");
         }
         MotorView = Datos.GetEntity <MotoresView>(m => m.MotorID == Id);
         if (Motor == null)
         {
             throw new EntityNotFoundException(Id.ToString(), "MotoresView");
         }
         EsNuevo = false;
     }
     catch (Exception ex)
     {
         Util.MensajeError(ex.Message, GlobalClass.NombreApp);
     }
 }