public ICubeSummationBR ContruirCubeSummationBR() { //Se construye alguna configuracion y //se aplica inyección de dependencias ValidacionDatos validacionDatos = new ValidacionDatos(); IOperacion operacion = ConstruirOperacionBR(); return(new CubeSummationBR(validacionDatos, operacion)); }
public void textBox_Email_Validated(object sender, EventArgs e) { var txt = (TextBox)sender; if (ValidacionDatos.ValidarEmail(txt.Text, errorProvider, txt)) { _datosObligatorios = false; } }
private void button_Ingresar_Click(object sender, EventArgs e) { if (ValidacionDatos.AdminClaveValida(txt_ingresa_usuario.Text, txt_ingresa_contra.Text)) { Administrador.Frm_MantenimientoAdmin Admin = new Administrador.Frm_MantenimientoAdmin(); Admin.Show(); this.Close(); return; } MessageBox.Show("Datos Incorrectos", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
private void btnIngresar_Click(object sender, EventArgs e) { GestionamientoUsuarios gu = new GestionamientoUsuarios(); DateTime fechanac = dateFechaNacimiento.Value; try { if (checkboxnuevo.Checked) { if (CamposVacios()) { MessageBox.Show("Por favor Rellene todos los espacios", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DialogResult dialogingresar = MessageBox.Show("¿Desea Ingresar Nuevo Administrador?", "Ingresar", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogingresar == DialogResult.Yes) { gu.IngresaADMIN(txtBoxNombre.Text, fechanac, txtCorreo.Text, txtUsuario.Text, txtPassword.Text); MessageBox.Show("Datos Ingresados Existosamente", "Ingreso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } return; } else { if (CamposVacios()) { MessageBox.Show("Por favor Rellene todos los espacios", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { var id = int.Parse(txtBoxCodigo.Text); if (ValidacionDatos.ExisteCodigoAdmin(id)) { DialogResult dialogactualizar = MessageBox.Show("¿Desea Actualizar Datos del Administrador?", "Actualizar", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogactualizar == DialogResult.Yes) { gu.ActualizarAdmin(id, fechanac, txtBoxNombre.Text, txtCorreo.Text, txtUsuario.Text, txtPassword.Text); MessageBox.Show("Datos Actualizados Existosamente", "Actualizacion", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } return; } } } } catch (Exception exe) { MessageBox.Show("Ocurrio un Error. Por favor Intentelo mas tarde.\n " + exe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private string getNombre(int cedula) { string sql = "SELECT Nombre_Estudiante FROM Estudiantes WHERE PK_Cedula_Estudiante = @cedula"; using (SqlConnection conx = new SqlConnection(ValidacionDatos.RetornaDataConfig())) { SqlCommand cmd = new SqlCommand(sql, conx); try { cmd.Parameters.AddWithValue("@cedula", cedula); conx.Open(); return((string)cmd.ExecuteScalar()); }catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(""); } } }
private void btnguardar_Click(object sender, EventArgs e) { result = ""; using (nds) { nds.Id_subsidios = Convert.ToInt32(txtidsubsidio.Text.Trim()); nds.Id_empleado = UserCache.IdUser; nds.Id_mes = Convert.ToInt32(txtmes.Text.Trim()); nds.Id_periodo = UserCache.Idperiodo; nds.Dias = Convert.ToInt32(txtdias.Text.Trim()); bool valida = new ValidacionDatos(nds).Validate(); if (valida) { result = nds.GuardarCambios(); Messages.M_info(result); } } }
private void btnIngresar_Click(object sender, EventArgs e) { if (CamposVacios()) { MessageBox.Show("Por favor Rellene todos los espacios", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { GestionamientoUsuarios gu = new GestionamientoUsuarios(); DateTime fechanac = dateFechaNac.Value; var cedula = int.Parse(txtCedula.Text); Int64 tel = int.Parse(txtTel.Text); if (ValidacionDatos.ExisteCodigo(cedula)) { /*SI EXISTE EL CODIGO, SE ACTUALIZA EL ESTUDIANTE*/ DialogResult dialogactualizar = MessageBox.Show("¿Desea Actualizar Datos del Estudiante?", "Actualizar", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogactualizar == DialogResult.Yes) { gu.ActualizarESTUDIANTE(cedula, txtNombre.Text, txtApl.Text, fechanac, txtCorreo.Text, tel); MessageBox.Show("Datos Actualizados Existosamente", "Actualizacion", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } return; } /*DE LO CONTRARIO, SE INGRESA UN ESTUDIANTE NUEVO*/ DialogResult dialogingresar = MessageBox.Show("¿Desea Ingresar Nuevo Estudiante?", "Ingresar", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogingresar == DialogResult.Yes) { gu.IngresaESTUDIANTE(cedula, txtNombre.Text, txtApl.Text, fechanac, txtCorreo.Text, tel); MessageBox.Show("Datos Ingresados Existosamente", "Ingreso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } return; } catch (Exception exe) { MessageBox.Show("Ocurrio un Error. Por favor Intentelo mas tarde.\n " + exe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private int ultimafactura() { int facturaid = 0; string sql = "SELECT MAX(PK_ID_Factura) FROM Facturas"; using (SqlConnection conn = new SqlConnection(ValidacionDatos.RetornaDataConfig())) { SqlCommand cmd = new SqlCommand(sql, conn); try { conn.Open(); facturaid = (int)cmd.ExecuteScalar(); return(facturaid); } catch (Exception ex) { Console.WriteLine(ex.Message); return(0); } } }
private void btnguardar_Click(object sender, EventArgs e) { result = ""; using (ns) { //ns.Id_subsidios = Convert.ToInt32(tx.Text.Trim()); ns.Cod_subsidios = txtcodigosuspension.Text.Trim(); ns.Tipo_suspension = cbxsuspension.SelectedItem.ToString(); ns.Descripcion_corta = txtdescCorta.Text.Trim(); ns.Descripcion_subsidio = txtdescSubsi.Text.Trim(); ns.Tipo_subsidio = txtdescSubsi.Text.Trim(); ns.Descuento = Convert.ToBoolean(checkDescuento.Text.Trim()); bool valida = new ValidacionDatos(ns).Validate(); if (valida) { //result = ns.GuardarCambios(); Messages.M_info(result); } } }
public void textBoxMail_KeyPress(object sender, KeyPressEventArgs e) { ValidacionDatos.ValidarEmail(sender, e); }
public void textBoxLetrasNumeros_KeyPress(object sender, KeyPressEventArgs e) { ValidacionDatos.NoSimbolos(sender, e); }