예제 #1
0
 public static void ParseToCommand(OleDbCommand Comando, RegulacionConductor regulacion)
 {
     Comando.Parameters.AddWithValue("idconductor", regulacion.IdConductor);
     Comando.Parameters.AddWithValue("codigo", regulacion.Codigo);
     Comando.Parameters.AddWithValue("fecha", regulacion.Fecha.ToString("yyyy-MM-dd"));
     Comando.Parameters.AddWithValue("horas", regulacion.Horas.Ticks);
     Comando.Parameters.AddWithValue("descansos", regulacion.Descansos);
     Comando.Parameters.AddWithValue("motivo", regulacion.Motivo);
     Comando.Parameters.AddWithValue("id", regulacion.Id);
 }
예제 #2
0
 // ====================================================================================================
 #region MÉTODOS ESTÁTICOS
 // ====================================================================================================
 public static void ParseFromReader(OleDbDataReader lector, RegulacionConductor regulacion)
 {
     regulacion.Id          = lector.ToInt32("Id");
     regulacion.IdConductor = lector.ToInt32("IdConductor");
     regulacion.Codigo      = lector.ToInt16("Codigo");
     regulacion.Fecha       = (lector["Fecha"] is DBNull) ? new DateTime(2001, 1, 2) : (DateTime)lector["Fecha"];
     regulacion.Horas       = lector.ToTimeSpan("Horas");
     regulacion.Descansos   = lector.ToInt16("Descansos");
     regulacion.Motivo      = lector.ToString("Motivo");
 }
예제 #3
0
        // ====================================================================================================
        #region MÉTODOS SOBRECARGADOS
        // ====================================================================================================
        public override bool Equals(object obj)
        {
            if (!(obj is RegulacionConductor))
            {
                return(false);
            }
            RegulacionConductor r = obj as RegulacionConductor;

            if (r.Codigo != Codigo || r.Fecha.Ticks != Fecha.Ticks)
            {
                return(false);
            }
            if (r.Horas != Horas)
            {
                return(false);
            }
            if (r.Descansos != Descansos)
            {
                return(false);
            }
            return(true);
        }