private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if ((lblIdMercado.Text != Convert.ToString(0)) && (tabControl1.SelectedTab == tabPage2) && (lbTipo.SelectedIndex == 1)) { tabControl1.SelectedTab = tabPage2; } else if ((tabControl1.SelectedTab == tabPage2) && (lblIdMercado.Text == Convert.ToString(0)) | ((lbTipo.SelectedIndex == 0) | (lbTipo.SelectedIndex == -1))) { tabControl1.SelectedTab = tabPage1; string error = "No se ha selecionado Proveedor."; string img = "attention"; ErrorDialogGenerico errorDialogGenerico = new ErrorDialogGenerico(error, img); errorDialogGenerico.ShowDialog(); } }
private void btnAgregar_Click(object sender, EventArgs e) { if (lblMercadoId.Text != "0" & txtPrecio.Text != "") { oPreciosMercadosDAL.agregar(recuperarInformacionMercadoPieza()); int mercadoId = Convert.ToInt32(lblMercadoId.Text); obj.llenarGridMercadosPrecios(mercadoId); } else { string error = "El campo Precio esta vacío."; string imagen = "attention"; ErrorDialogGenerico errorDialogGenerico = new ErrorDialogGenerico(error, imagen); errorDialogGenerico.ShowDialog(); } }