Estoy realizando una app en windows forms donde hago registros, pero validarme que algunos campos sean llenados estoy usando Error Provider, mas sin embargo cuando provoco el error me marcan todos excepto el DateTimePicker y un Textbox donde debo ingresar Int que error puede tener mi codigo?
private void btnCargar_Click(object sender, EventArgs e)
{
//Metodo para limpiar los error provider(si anteriormente ya hubieran aparecido)
LimpiarErrorICono();
if (txtSalesOrderI.Text == string.Empty || txtModelo.Text == string.Empty || txtCustomer.Text == string.Empty || txtTotalI.Text == string.Empty || cmbPriorityI.Text == string.Empty
|| cmbPriorityStatus.Text == string.Empty || dtmpDateReceived.Checked)
{
this.MensajeError("Faltan Ingresar Datos");
if (txtSalesOrderI.Text == string.Empty)
{
ErrorIcono.SetError(txtSalesOrderI, "Ingrese un SalesOrder");
}
if (txtCustomer.Text == string.Empty)
{
ErrorIcono.SetError(txtCustomer, "Ingrese un Customer");
}
if(txtModelo.Text == string.Empty)
{
ErrorIcono.SetError(txtModelo, "Ingrese un Modelo");
}
//En este campo es el text box que debe ir un int y no me aparece el error provider cuando no ingreso nada
if(txtTotalI.Text == string.Empty)
{
ErrorIcono.SetError(txtTotalI, "Ingrese un Numero");
}
if(cmbPriorityI.Text == string.Empty)
{
ErrorIcono.SetError(cmbPriorityI, "Ingrese una Prioridad");
}
if (cmbPriorityStatus.Text == string.Empty)
{
ErrorIcono.SetError(cmbPriorityStatus, "Ingrese una Estatus");
}
//DateTimePicker en el cual debo checar una fecha y si no deberia aparecer el error icon
if (dtmpDateReceived.Checked == false)
{
ErrorIcono.SetError(dtmpDateReceived, "Ingrese una Fecha");
}
}