no seNo sé si es validola mejor manera, pero lo resolví creando una función que devuelve el valor dependiendo de esta maneralas condiciones:
Movimiento = new Func<string>(() =>
{
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 0)
{
return "ENTRADA";
}
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 1)
{
return "SALIDA";
}
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker2.Value.ToString("dd/MM/yyyy") && c.CheckType == 1)
{
return "SALIDA";
}
return null;
}
)
()
Movimiento = new Func<string>(() =>
{
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 0)
{
return "ENTRADA";
}
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 1)
{
return "SALIDA";
}
if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker2.Value.ToString("dd/MM/yyyy") && c.CheckType == 1)
{
return "SALIDA";
}
return null;
}
)
()