private void mnuBuscar_Click(object sender, EventArgs e) { try { DataTable oRestriccion = new DataTable(); Int16 oIndice; frmAyuda oAyuda = new frmAyuda(); string oNuip = Inputbox.Show("Buqueda Placa", "Digite la placa que desea consultar.", FormStartPosition.CenterScreen); oAyuda.Informacion = oHelper.RecuperarDatosVehiculoRestriccion(oNuip); oAyuda.ColumnReturn = 0; oAyuda.ShowDialog(); if (string.IsNullOrEmpty(oAyuda.ValorRegistroSeleccionado) == false) { Vehiculo = Int64.Parse(oAyuda.RowSelect.Cells[0].Value.ToString()); lblPlaca.Text = oAyuda.RowSelect.Cells[1].Value.ToString(); lblCliente.Text = oAyuda.RowSelect.Cells[2].Value.ToString(); TabBasica(false); TabProducto(false); TabDia(false); oRestriccion = oHelper.RecuperarRestriccionesTipo(lblPlaca.Text); if (oRestriccion.Rows.Count > 0) { oIndice = Int16.Parse(oRestriccion.Rows[0][0].ToString()); switch (oIndice) { case 0: dtgHoraDia.DataSource = oRestriccion; dtgHoraDia.Columns[0].Visible = false; break; case 2: dtgDia.DataSource = oRestriccion; break; case 1: dtgHoras.DataSource = oRestriccion; break; } } } oAyuda.Close(); oAyuda.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Restricciones - Buscar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } //Inputbox.Show( }
private void btn_editar_clave_Click(object sender, EventArgs e) { String val = text_contrasena.Text; if (!String.IsNullOrEmpty(text_contrasena.Text)) { String opcion = Inputbox.Show("Confirmacion de Acceso", "Ingrese Su Contraseña ", FormStartPosition.CenterScreen); if (!String.IsNullOrEmpty(opcion)) { if (opcion.Equals(F_Login.perfil.Contrasena)) { text_contrasena.Enabled = true; } else { MessageBox.Show("Error Acceso Denegado"); } } } else { MessageBox.Show("No Posee Contraseña"); } }
private void btnGo_Click(object sender, EventArgs e) { int casos = 0; Int32.TryParse(TxtCasos.Text, out casos); string output = string.Empty; if (casos > 0) { for (int i = 0; i < casos; i++) { string filasT = Inputbox.Show("Filas", "Ingrese el numero de Filas ", FormStartPosition.CenterScreen); string columnasT = Inputbox.Show("Columnas", "Ingrese el numero de columnas ", FormStartPosition.CenterScreen); int filas = 0; int columnas = 0; Int32.TryParse(filasT, out filas); Int32.TryParse(columnasT, out columnas); if (filas == columnas && filas > 1) { if (filas % 2 == 0) { MessageBox.Show("L"); output += "L-"; } else { MessageBox.Show("R"); output += "R-"; } } else { if (filas > columnas && columnas > 1) { if (columnas % 2 == 0) { MessageBox.Show("U"); output += "U-"; } else { MessageBox.Show("D"); output += "D-"; } } else { if (columnas > filas) { if (filas % 2 == 0) { MessageBox.Show("L"); output += "L-"; } else { MessageBox.Show("R"); output += "R-"; } } else { if (columnas == 1) { if (filas == 1) { MessageBox.Show("R"); output += "R-"; } else { MessageBox.Show("D"); output += "D-"; } } } } } } output = output.Length > 0 ? output.Substring(0, output.Length - 1) : string.Empty; label1.Text = "OUTPUT " + output; } else { MessageBox.Show("Debes escribir un número válido", "Error"); } }