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); } }
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); } }