private void Form1_Load(object sender, EventArgs e) { Herramientas.llenarComboBoxSP(cbxRol, "SARASA.cbx_rol", Herramientas.GenerarListaDeParametros("@usuario_id", 0), true); }
private void AltaCliente_Load(object sender, EventArgs e) { userId = ""; rbBuscarUser.Checked = true; gbAltaUser.Enabled = false; Herramientas.llenarComboBoxSP(cbxPais, "SARASA.cbx_pais", null, true); Herramientas.llenarComboBoxSP(cbxTipoDoc, "SARASA.cbx_tipodoc", null, true); Herramientas.llenarComboBoxSP(cbxRol, "SARASA.cbx_rol", Herramientas.GenerarListaDeParametros("@usuario_id", 0), true); //Herramientas.GenerarListaDeParametros( // //"@cliId", txtCliente.Text, // @cliId integer, // "@cliNombre", txtNombre.Text, // @cliNombre nvarchar(255), // "@cliApellido", txtApellido.Text, // @cliApellido nvarchar(255), // "@cliTipoDocId", cbxTipoDoc.SelectedItem.ToString(), // @cliTipoDocId integer, // "@cliNumDoc", txtNumDoc.Text, // @cliNumDoc numeric(18,0) // "@cliMail", txtMail.Text, // @cliMail nvarchar(255) // "@cliPaisId", cbxPais.SelectedItem.ToString(), // @cliPaisId integer, // "@cliDomCalle", txtCalle.Text, // @cliCalle nvarchar(255), // "@cliDomNumero", txtCalleNum.Text, // @cliDomNumero numeric(18,0), // "@cliDomPiso", txtPiso.Text, // @cliDomPiso numeric(18,0), // "@cliDomDpto", txtDepto.Text, // @cliDomDpto nvarchar(10), // "@cliFechaNac", dtpFechaNac, // @cliFechaNac datetime, // "@cliHabilitado", chkEstado.Checked); // @cliHabilitado bit); }
public void setClienteEncontrado(string clienteId, string nombre, string apellido, string documento) { txtCliente.Text = apellido + ", " + nombre + " (" + clienteId + ")"; this.clienteId = clienteId; this.clienteDocumento = documento; cbxCuenta.DataSource = null; Herramientas.llenarComboBoxSP(cbxCuenta, "SARASA.cbx_cuenta", Herramientas.GenerarListaDeParametros("@Cliente_Id", this.clienteId, "@Estado_Desc", "Habilitada"), true); }
private void FormBuscar_Load(object sender, EventArgs e) { btnModificar.Enabled = false; btnEliminar.Enabled = false; if (tipoFormBusqueda.Equals("ABMUsuario")) { btnAceptar.Visible = false; } else if (tipoFormBusqueda.Equals("BuscarUsuario")) { flowLayoutPanel1.Visible = false; } Herramientas.llenarComboBoxSP(cbxRol, "SARASA.cbx_rol", Herramientas.GenerarListaDeParametros("@usuario_id", 0), false); }
private void btnEliminar_Click(object sender, EventArgs e) { string msj = "Seguro que quiere ELIMINAR el CLIENTE \"" + dataGridView1.SelectedCells[4].Value.ToString() + ", " + dataGridView1.SelectedCells[3].Value.ToString() + " (" + dataGridView1.SelectedCells[0].Value.ToString() + ")\"?\n"; msj += "SE REALIZA UNA BAJA LÓGICA"; var result = MessageBox.Show(msj, "Eliminar cliente", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);//, MessageBoxDefaultButton.Button2); if (result == DialogResult.OK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cliente_id", dataGridView1.SelectedCells[0].Value.ToString()); Herramientas.EjecutarStoredProcedure("SARASA.eliminar_cliente", lista); } }
private void btnCambiar_Click(object sender, EventArgs e) { bool passActualOK = false, passValidacionOK = false; if (usuario.Password.Equals(Herramientas.sha256_hash(txtPasswordActual.Text.ToString()))) { passActualOK = true; lblPassActual.ForeColor = Color.Black; } else { passActualOK = false; lblPassActual.ForeColor = Color.Red; } if ((txtPasswordNuevo.Text != "") && (txtPasswordNuevo.Text.Equals(txtPasswordNuevoVal.Text))) { passValidacionOK = true; lblPassNuevo.ForeColor = Color.Black; lblPassNuevoVal.ForeColor = Color.Black; } else { passValidacionOK = false; lblPassNuevo.ForeColor = Color.Red; lblPassNuevoVal.ForeColor = Color.Red; } if (passActualOK && passValidacionOK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros("@usuario_id", usuario.UsuarioId, "@usuario_pass", Herramientas.sha256_hash(txtPasswordNuevo.Text.ToString())); if (Herramientas.EjecutarStoredProcedure("SARASA.modificar_pass_usuario", lista) != null) { this.Dispose(); formPadre.Show(); } } }
private void FormRetiros_Load(object sender, EventArgs e) { if (usuario.RolId == "1") { lklCliente.Enabled = true; } else { lklCliente.Enabled = false; } if (usuario.ClienteId != 0) { txtCliente.Text = usuario.Apellido + ", " + usuario.Nombre + " (" + usuario.ClienteId + ")"; Herramientas.llenarComboBoxSP(cbxCuenta, "SARASA.cbx_cuenta", Herramientas.GenerarListaDeParametros("@Cliente_Id", usuario.ClienteId, "@Estado_Desc", "Habilitada"), true); } Herramientas.llenarComboBoxSP(cbxMoneda, "SARASA.cbx_moneda", null, true); Herramientas.llenarComboBoxSP(cbxBanco, "SARASA.cbx_banco", null, true); }
private void btnRenovar_Click(object sender, EventArgs e) { string msj = "Seguro que quiere RENOVAR la CUENTA \"" + dataGridView1.SelectedCells[1].Value.ToString() + "\"\n" + "del Cliente: " + dataGridView1.SelectedCells[17].Value.ToString() + ", " + dataGridView1.SelectedCells[16].Value.ToString() + " (" + dataGridView1.SelectedCells[0].Value.ToString() + ") ?\n\n"; msj += "LA RENOVACIÓN PUEDE GENERAR UN GASTO"; var result = MessageBox.Show(msj, "Renovar cuenta", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);//, MessageBoxDefaultButton.Button2); if (result == DialogResult.OK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cuenta_numero", dataGridView1.SelectedCells[1].Value.ToString()); Herramientas.EjecutarStoredProcedure("SARASA.renovar_suscripcion", lista); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { DataTable dtable = new DataTable(); conexion cn = new conexion(); SqlCommand query = new SqlCommand("SARASA.consultar_saldos", cn.abrir_conexion()); query.CommandType = CommandType.StoredProcedure; List <SqlParameter> parametros = Herramientas.GenerarListaDeParametros("@cuenta_numero", numeroCuenta); query.Parameters.AddRange(parametros.ToArray()); SqlDataReader reader = query.ExecuteReader(); if (reader.HasRows) { DataTable dt1 = new DataTable(); dt1.Load(reader); dgvSaldo.DataSource = dt1; DataTable dt2 = new DataTable(); dt2.Load(reader); dgvDepositos.DataSource = dt2; DataTable dt3 = new DataTable(); dt3.Load(reader); dgvRetiros.DataSource = dt3; DataTable dt4 = new DataTable(); dt4.Load(reader); dgvTransferencias.DataSource = dt4; } reader.Close(); } catch (SqlException ex) { MessageBox.Show("" + ex.Message, "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
// Desasociar (LO ELIMINA DE LA BASE) private void btnDesasociar_Click(object sender, EventArgs e) { string msj = "Seguro que quiere DESASOCIAR la TARJETA " + dataGridView1.SelectedCells[4].Value.ToString() + " (" + dataGridView1.SelectedCells[5].Value.ToString() + ")\n" + "del Cliente: " + dataGridView1.SelectedCells[2].Value.ToString() + ", " + dataGridView1.SelectedCells[1].Value.ToString() + " (" + dataGridView1.SelectedCells[0].Value.ToString() + ") ?\n\n" + "SE REALIZA UNA BAJA LOGICA"; var result = MessageBox.Show(msj, "Desasociar tarjeta", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);//, MessageBoxDefaultButton.Button2); if (result == DialogResult.OK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cliente_id", dataGridView1.SelectedCells[0].Value.ToString(), "@tc_num", dataGridView1.SelectedCells[3].Value.ToString()); Herramientas.EjecutarStoredProcedure("SARASA.Desasociar_Tarjeta", lista); } }
private void btnDepositar_Click(object sender, EventArgs e) { bool importeOK = false, cuentaOK = false, tarjetaOK = false, monedaOK = false, clienteOK = false; if (Herramientas.IsDecimal(txtImporte.Text)) { importeOK = true; lblImporte.ForeColor = Color.Black; } else { importeOK = false; lblImporte.ForeColor = Color.Red; } if (cbxCuenta.DataSource != null) { cuentaOK = true; lblCuenta.ForeColor = Color.Black; } else { cuentaOK = false; lblCuenta.ForeColor = Color.Red; } if (cbxTarjeta.DataSource != null) { tarjetaOK = true; lblTarjeta.ForeColor = Color.Black; } else { tarjetaOK = false; lblTarjeta.ForeColor = Color.Red; } if (cbxMoneda.DataSource != null) { monedaOK = true; lblMoneda.ForeColor = Color.Black; } else { monedaOK = false; lblMoneda.ForeColor = Color.Red; } if (txtCliente.Text != "") { clienteOK = true; lklCliente.LinkColor = Color.Blue; } else { clienteOK = false; lklCliente.LinkColor = Color.Red; } if (clienteOK && importeOK && cuentaOK && tarjetaOK && monedaOK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cliente_id", this.clienteId, "@deposito_fecha", dtpFecha.Value.ToShortDateString(), "@deposito_importe", txtImporte.Text, "@deposito_moneda_id", ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Key, "@deposito_tarjeta_num", ((KeyValuePair <string, string>)cbxTarjeta.SelectedItem).Key, "@deposito_cuenta_num", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key); if (Herramientas.EjecutarStoredProcedure("SARASA.realizar_deposito", lista) != null) { string msj = "CLIENTE: " + usuario.Apellido + ", " + usuario.Nombre + " (" + this.clienteId + ")\n" + "CUENTA: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n" + "TARJETA: " + ((KeyValuePair <string, string>)cbxTarjeta.SelectedItem).Value + "\n" + "IMPORTE: $" + txtImporte.Text + "\n"; MessageBox.Show(msj, "DEPOSITO - COMPROBANTE", MessageBoxButtons.OK, MessageBoxIcon.Information); cbxCuenta.SelectedIndex = 0; cbxMoneda.SelectedIndex = 0; cbxTarjeta.SelectedIndex = 0; txtImporte.Text = ""; } else { MessageBox.Show("Verificar que el formulario este completo", "Depositos", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void btnModificar_Click(object sender, EventArgs e) { int hab; if (checkBox1.Checked) { hab = 1; } else { hab = 0; } bool passwordOK = false, preguntaOK = false, respuestaOK = false; if (txtPassword.Text != "") { passwordOK = true; lblPassword.ForeColor = Color.Black; } else { passwordOK = false; lblPassword.ForeColor = Color.Red; } if (txtPreguntaSec.Text != "") { preguntaOK = true; lblPregunta.ForeColor = Color.Black; } else { preguntaOK = false; lblPregunta.ForeColor = Color.Red; } if (txtRespuestaSec.Text != "") { respuestaOK = true; lblRespuesta.ForeColor = Color.Black; } else { respuestaOK = false; lblRespuesta.ForeColor = Color.Red; } if (passwordOK && preguntaOK && respuestaOK) { if (lbxRoles.SelectedItems.Count != 0) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@usuario_id", this.id, "@pass", Herramientas.sha256_hash(txtPassword.Text.ToString()), "@preg", txtPreguntaSec.Text, "@resp", Herramientas.sha256_hash(txtRespuestaSec.Text.ToString()), "@hab", hab); Herramientas.EjecutarStoredProcedure("SARASA.modificar_usuario", lista); foreach (Utils.ItemRol item in lbxRoles.SelectedItems) { lista = Herramientas.GenerarListaDeParametros( "@usuario_id", this.id, "@rol", item.Id); Herramientas.EjecutarStoredProcedure("SARASA.insertar_rol_usuario", lista); } Herramientas.msebox_informacion("Usuario modificado con éxito"); this.Dispose(); this.formPadre.Show(); } else { Herramientas.msebox_informacion("Debe seleccionar al menos un rol"); } } else { Herramientas.msebox_informacion("Completar todos los campos"); } }
private void btnRetirar_Click(object sender, EventArgs e) { bool clienteOK = false, documentoOK = false, cuentaOK = false, monedaOK = false, importeOK = false, bancoOK = false; if (txtCliente.Text != "") { clienteOK = true; lklCliente.LinkColor = Color.Blue; } else { clienteOK = false; lklCliente.LinkColor = Color.Red; } if (Herramientas.IsDecimal(txtImporte.Text)) { lblImporte.ForeColor = Color.Black; importeOK = true; } else { lblImporte.ForeColor = Color.Red; importeOK = false; } if (clienteDocumento.Equals(txtDocumento.Text)) { lblDocumento.ForeColor = Color.Black; documentoOK = true; } else { lblDocumento.ForeColor = Color.Red; documentoOK = false; } if (cbxCuenta.DataSource != null) { cuentaOK = true; lblCuenta.ForeColor = Color.Black; } else { cuentaOK = false; lblCuenta.ForeColor = Color.Red; } if (cbxBanco.DataSource != null) { bancoOK = true; lblBanco.ForeColor = Color.Black; } else { bancoOK = false; lblBanco.ForeColor = Color.Red; } if (cbxMoneda.DataSource != null) { monedaOK = true; lblMoneda.ForeColor = Color.Black; } else { monedaOK = false; lblMoneda.ForeColor = Color.Red; } if (clienteOK && documentoOK && importeOK && bancoOK && monedaOK && cuentaOK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cliente_id", clienteId, "@cliente_documento", txtDocumento.Text, "@cuenta_nro", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key, "@moneda_id", ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Key, "@importe", txtImporte.Text, "@banco_codigo", ((KeyValuePair <string, string>)cbxBanco.SelectedItem).Key); if (Herramientas.EjecutarStoredProcedure("SARASA.retirar_efectivo", lista) != null) { string boleta = "CLIENTE: " + txtCliente.Text + "\n" + "CUENTA: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n" + "IMPORTE: $" + txtImporte.Text + " (" + ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Value + ")\n" + "BANCO: " + ((KeyValuePair <string, string>)cbxBanco.SelectedItem).Value + "\n"; MessageBox.Show(boleta, "RETIRO - COMPROBANTE", MessageBoxButtons.OK, MessageBoxIcon.Information); txtDocumento.Text = ""; txtImporte.Text = ""; cbxBanco.SelectedIndex = 0; cbxCuenta.SelectedIndex = 0; cbxMoneda.SelectedIndex = 0; } } }
private void btnCrear_Click(object sender, EventArgs e) { bool usernameOK = false, passwordOK = false, preguntaOK = false, respuestaOK = false; if (txtUsuario.Text != "") { usernameOK = true; lblUsuario.ForeColor = Color.Black; } else { usernameOK = false; lblUsuario.ForeColor = Color.Red; } if (txtPassword.Text != "") { passwordOK = true; lblPassword.ForeColor = Color.Black; } else { passwordOK = false; lblPassword.ForeColor = Color.Red; } if (txtPreguntaSec.Text != "") { preguntaOK = true; lblPregunta.ForeColor = Color.Black; } else { preguntaOK = false; lblPregunta.ForeColor = Color.Red; } if (txtRespuestaSec.Text != "") { respuestaOK = true; lblRespuesta.ForeColor = Color.Black; } else { respuestaOK = false; lblRespuesta.ForeColor = Color.Red; } if (usernameOK && passwordOK && preguntaOK && respuestaOK) { string resul; try { string nombreSP = "SARASA.comprobar_usuario_existente"; List <SqlParameter> listaParametros = Herramientas.GenerarListaDeParametros( "@username", txtUsuario.Text); conexion cn = new conexion(); SqlCommand query = new SqlCommand(nombreSP, cn.abrir_conexion()); query.CommandType = CommandType.StoredProcedure; // Agregar los parametros del tipo INPUT query.Parameters.AddRange(listaParametros.ToArray()); // Definir el parametro del tipo OUTPUT SqlParameter factura = new SqlParameter("@resul", 0); factura.Direction = ParameterDirection.Output; query.Parameters.Add(factura); query.ExecuteNonQuery(); resul = (query.Parameters["@resul"].SqlValue.ToString()); if (resul == "0") { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@Usuario_Username", txtUsuario.Text, "@Usuario_Password", Herramientas.sha256_hash(txtPassword.Text.ToString()), "@Usuario_Pregunta_Sec", txtPreguntaSec.Text, "@Usuario_Respuesta_Sec", Herramientas.sha256_hash(txtRespuestaSec.Text.ToString()), "@Rol_Id", ((KeyValuePair <string, string>)cbxRol.SelectedItem).Key); if (Herramientas.EjecutarStoredProcedure("SARASA.crear_usuario", lista) == null) { } else { this.Dispose(); formPadre.Show(); } } else { lblUsuario.ForeColor = Color.Red; Herramientas.msebox_informacion("Nombre de usuario ya existente"); } } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString()); } } }
private void btnBuscar_Click(object sender, EventArgs e) { dgvListado.DataSource = null; if (Herramientas.IsNumeric(txtAño.Text)) { lblAño.ForeColor = Color.Black; string idConsulta = ((KeyValuePair <string, string>)cbxConsulta.SelectedItem).Key; string idTrimestre = ((KeyValuePair <string, string>)cbxTrimestre.SelectedItem).Key; string año = txtAño.Text; string fechaDesde = "", fechaHasta = ""; switch (idTrimestre) { case "1": // Enero, Febrero, Marzo fechaDesde = "01/01/" + año; fechaHasta = "31/03/" + año; break; case "2": // Abril, Mayo, Junio fechaDesde = "01/04/" + año; fechaHasta = "30/06/" + año; break; case "3": // Julio, Agosto, Septiembre fechaDesde = "01/07/" + año; fechaHasta = "30/09/" + año; break; case "4": // Octubre, Noviembre, Diciembre fechaDesde = "01/10/" + año; fechaHasta = "31/12/" + año; break; } List <SqlParameter> parametros = Herramientas.GenerarListaDeParametros("@fecha_desde", fechaDesde, "@fecha_hasta", fechaHasta); switch (idConsulta) { case "1": //EJECUTA EL PROCEDURE DE LA CONSULTA 1 dgvListado.DataSource = Herramientas.EjecutarStoredProcedure("SARASA.inhabilitaciones_por_cliente", parametros); break; case "2": //EJECUTA EL PROCEDURE DE LA CONSULTA 2 dgvListado.DataSource = Herramientas.EjecutarStoredProcedure("SARASA.clientes_mas_comisiones_facturadas", parametros); break; case "3": //EJECUTA EL PROCEDURE DE LA CONSULTA 3 dgvListado.DataSource = Herramientas.EjecutarStoredProcedure("SARASA.clientes_transferencias_entre_si", parametros); break; case "4": //EJECUTA EL PROCEDURE DE LA CONSULTA 4 dgvListado.DataSource = Herramientas.EjecutarStoredProcedure("SARASA.movimientos_por_paises", parametros); break; case "5": //EJECUTA EL PROCEDURE DE LA CONSULTA 5 dgvListado.DataSource = Herramientas.EjecutarStoredProcedure("SARASA.total_facturado_por_tipo_cuenta", parametros); break; } } else { lblAño.ForeColor = Color.Red; } }
private void txtCrear_Click(object sender, EventArgs e) { string resultado; string tipodoc = ((KeyValuePair <string, string>)cbxTipoDoc.SelectedItem).Key; resultado = Herramientas.comprobarDocMail(tipodoc, txtNumDoc.Text, txtMail.Text); label4.ForeColor = Color.Black; label5.ForeColor = Color.Black; label6.ForeColor = Color.Black; if (resultado == "1") { label4.ForeColor = Color.Red; label5.ForeColor = Color.Red; labelResultado.Text = "Tipo y Nro de Documento ya existentes"; labelResultado.ForeColor = Color.Red; labelResultado.Visible = true; } if (resultado == "2") { label6.ForeColor = Color.Red; labelResultado.Text = "Mail ya existente"; labelResultado.ForeColor = Color.Red; labelResultado.Visible = true; } if (resultado == "3") { label4.ForeColor = Color.Red; label5.ForeColor = Color.Red; label6.ForeColor = Color.Red; labelResultado.Text = "Tipo Doc, Nro de Documento y Mail ya existentes"; labelResultado.ForeColor = Color.Red; labelResultado.Visible = true; } if (resultado == "0") { // EJECUTA EL STORE PROCEDURE QUE GRABA LOS DATOS EN LA TABLA try { List <SqlParameter> lista; if (txtPiso.Text == "" && txtDepto.Text == "") { lista = Herramientas.GenerarListaDeParametros( "@Cliente_Nombre", txtNombre.Text, "@Cliente_Apellido", txtApellido.Text, "@Cliente_Tipodoc_Id", ((KeyValuePair <string, string>)cbxTipoDoc.SelectedItem).Key, "@Cliente_Doc_Nro", txtNumDoc.Text, "@Cliente_Dom_Calle", txtCalle.Text, "@Cliente_Dom_Numero", txtCalleNum.Text, "@Cliente_Dom_Piso", "0", "@Cliente_Dom_Depto", "0", "@Cliente_Mail", txtMail.Text, "@Cliente_Pais_Id", ((KeyValuePair <string, string>)cbxPais.SelectedItem).Key, "@Cliente_Fecha_Nacimiento", dtpFechaNac.Value.ToShortDateString(), "@Cliente_Habilitado", chkEstado.Checked, "@Usuario_Id", userId, "@Usuario_Username", txtUsuario.Text, "@Usuario_Password", Herramientas.sha256_hash(txtPassword.Text), "@Usuario_Pregunta_Sec", txtPreguntaSec.Text, "@Usuario_Respuesta_Sec", Herramientas.sha256_hash(txtRespuestaSec.Text), "@Rol_Id", ((KeyValuePair <string, string>)cbxRol.SelectedItem).Key); } else { lista = Herramientas.GenerarListaDeParametros( "@Cliente_Nombre", txtNombre.Text, "@Cliente_Apellido", txtApellido.Text, "@Cliente_Tipodoc_Id", ((KeyValuePair <string, string>)cbxTipoDoc.SelectedItem).Key, "@Cliente_Doc_Nro", txtNumDoc.Text, "@Cliente_Dom_Calle", txtCalle.Text, "@Cliente_Dom_Numero", txtCalleNum.Text, "@Cliente_Dom_Piso", txtPiso.Text, "@Cliente_Dom_Depto", txtDepto.Text, "@Cliente_Mail", txtMail.Text, "@Cliente_Pais_Id", ((KeyValuePair <string, string>)cbxPais.SelectedItem).Key, "@Cliente_Fecha_Nacimiento", dtpFechaNac.Value.ToShortDateString(), "@Cliente_Habilitado", chkEstado.Checked, "@Usuario_Id", userId, "@Usuario_Username", txtUsuario.Text, "@Usuario_Password", Herramientas.sha256_hash(txtPassword.Text), "@Usuario_Pregunta_Sec", txtPreguntaSec.Text, "@Usuario_Respuesta_Sec", Herramientas.sha256_hash(txtRespuestaSec.Text), "@Rol_Id", ((KeyValuePair <string, string>)cbxRol.SelectedItem).Key); } Herramientas.EjecutarStoredProcedure("SARASA.crear_cliente", lista); Herramientas.msebox_informacion("Cliente nueva creada (ID_USER: "******")"); this.Close(); this.formPadre.Show(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString()); } } }
private void btnTransferir_Click(object sender, EventArgs e) { bool importeOK = false, clienteOK = false, ctaOrigenOK = false, ctaDestinoOK = false; if (txtCliente.Text != "") { clienteOK = true; lklCliente.LinkColor = Color.Blue; } else { clienteOK = false; lklCliente.LinkColor = Color.Red; } if (Herramientas.IsDecimal(txtImporte.Text)) { lblImporte.ForeColor = Color.Black; importeOK = true; } else { lblImporte.ForeColor = Color.Red; importeOK = false; } if (cbxCuenta.DataSource != null) { ctaOrigenOK = true; lblCuenta.ForeColor = Color.Black; } else { ctaOrigenOK = false; lblCuenta.ForeColor = Color.Red; } if (cbxCuentaDestino.DataSource != null) { ctaDestinoOK = true; lklCuentaDestino.LinkColor = Color.Blue; } else { ctaDestinoOK = false; lklCuentaDestino.LinkColor = Color.Red; } if (clienteOK && ctaOrigenOK && ctaDestinoOK && importeOK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@cliente_id", this.clienteId, "@cuenta_origen", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key, "@cuenta_destino", numeroCuenta, "@importe", txtImporte.Text); if (Herramientas.EjecutarStoredProcedure("SARASA.realizar_transferencia", lista) != null) { string msj = "CLIENTE: " + usuario.Apellido + ", " + usuario.Nombre + " (" + usuario.ClienteId + ")\n" + "CUENTA ORIGEN: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n" + "CUENTA DESTINO: " + numeroCuenta + "\n" + "IMPORTE: $" + txtImporte.Text + "\n"; MessageBox.Show(msj, "TRANSFERENCIA - COMPROBANTE", MessageBoxButtons.OK, MessageBoxIcon.Information); cbxCuenta.SelectedIndex = 0; cbxCuentaDestino.SelectedIndex = 0; txtImporte.Text = ""; } } }
private void btnGuardar_Click(object sender, EventArgs e) { bool docNumeroOK = false, domPisoOK = false, domNumeroOK = false; string msj = "Seguro que quiere MODIFICAR la información del CLIENTE \"" + cliente.Apellido + ", " + cliente.Nombre + " (" + cliente.ClienteId + ")\"?"; if (Herramientas.IsNumericLong(txtNumDoc.Text)) { docNumeroOK = true; lblNroDocumento.ForeColor = Color.Black; } else { docNumeroOK = false; lblNroDocumento.ForeColor = Color.Red; } if (Herramientas.IsNumericLong(txtCalleNum.Text)) { domNumeroOK = true; lblDomNum.ForeColor = Color.Black; } else { domNumeroOK = false; lblDomNum.ForeColor = Color.Red; } if (Herramientas.IsNumericLong(txtPiso.Text)) { domPisoOK = true; lblDomPiso.ForeColor = Color.Black; } else { domPisoOK = false; lblDomPiso.ForeColor = Color.Red; } if (docNumeroOK && domNumeroOK && domPisoOK) { var result = MessageBox.Show(msj, "Modificar cliente", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);//, MessageBoxDefaultButton.Button2); if (result == DialogResult.OK) { List <SqlParameter> lista = Herramientas.GenerarListaDeParametros( "@Cliente_Id", cliente.ClienteId, "@Cliente_Nombre", txtNombre.Text, "@Cliente_Apellido", txtApellido.Text, "@Cliente_Tipodoc_Id", ((KeyValuePair <string, string>)cbxTipoDoc.SelectedItem).Key, "@Cliente_Doc_Nro", txtNumDoc.Text, "@Cliente_Dom_Calle", txtCalle.Text, "@Cliente_Dom_Numero", txtCalleNum.Text, "@Cliente_Dom_Piso", txtPiso.Text, "@Cliente_Dom_Depto", txtDepto.Text, "@Cliente_Mail", txtMail.Text, "@Cliente_Pais_Id", ((KeyValuePair <string, string>)cbxPais.SelectedItem).Key, "@Cliente_Fecha_Nacimiento", dtpFechaNac.Value.ToShortDateString(), "@Cliente_Habilitado", chkEstado.Checked); Herramientas.EjecutarStoredProcedure("SARASA.modificar_cliente", lista); this.Dispose(); this.formPadre.Show(); } } }