private void btnRegistrarComponente_Click(object sender, EventArgs e) { if (txtNombreComp.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar el nombre del componente", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtNombreComp.Focus(); } else if (txtCantHorasComp.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar las horas", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtCantHorasComp.Focus(); } else if (txtIdPadre.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar ID Padre", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIdPadre.Focus(); } else if (txtIdCantHrsFab.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar las hrs del fabricante", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIdCantHrsFab.Focus(); } else if (txtCantDiasFab.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar los dias", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtCantDiasFab.Focus(); } else if (txtIdTipoComp.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar el tipo de componente", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIdTipoComp.Focus(); } //else if (txtEspecialista.Text.Trim() == "") //{ // MessageBox.Show("Asegurese de ingresar el Especialista", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); // txtEspecialista.Focus(); //} else if (txtEstructura.Text.Trim() == "") { MessageBox.Show("Asegurese de ingresar la estructura", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtEstructura.Focus(); } else { ConsumeWebApi consume = new ConsumeWebApi(); Boolean nuevoComponente = consume.nuevoComponente((txtNombreComp.Text), Int32.Parse(txtCantHorasComp.Text), Int32.Parse(txtIdPadre.Text), Int32.Parse(txtIdCantHrsFab.Text), Int32.Parse(txtCantDiasFab.Text), Int32.Parse(txtIdTipoComp.Text), Int32.Parse(cmbMecanico.SelectedValue.ToString()), Int32.Parse(txtEstructura.Text)); if (nuevoComponente) { MessageBox.Show("Nuevo Componente ingresado.", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Ha ocurrido un error.", "Problemas en el ingreso", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }