private void txtTolerancia_TextChanged(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtTolerancia.Text) && Convert.ToInt32(this.txtTolerancia.Text) >= 0 && Convert.ToInt32(this.txtTolerancia.Text) <= 60) { this.horario.Tolerancia = Convert.ToInt32(this.txtTolerancia.Text); } }
private bool datosValidos() { Boolean ok = true; if (Convert.ToInt32(this.cmbEmpleados.SelectedValue) < 1) { MessageBox.Show("Debe seleccionar un empleado valido"); ok = false; this.cmbEmpleados.Focus(); } else { if (Convert.ToInt32(this.cmbNovedad.SelectedValue) < 1) { MessageBox.Show("Debe seleccionar una novedad válida"); ok = false; this.cmbNovedad.Focus(); } else { if (!Varios.IsNumeric(this.txtValor.Text) || Convert.ToDouble(this.txtValor.Text) < 0) { MessageBox.Show("Debe ingresar un valor válido"); ok = false; this.txtValor.Focus(); } } } return(ok); }
/// <summary> /// Evento que aplica los filtros y busquedas elegidas para reducir la /// informacion mostrada en la grilla /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void aplicarFiltros(object sender, EventArgs e) { string cadfitro = ""; for (int i = 0; i < filtros.Length; i++) { if (filtros[i].SelectedIndex >= 0) { //cadfitro = cadfitro + " and " + filtros[i].ValueMember + " = " + filtros[i].SelectedValue.ToString(); cadfitro = cadfitro + " and " + etiquetas[i].Text + " like '*" + filtros[i].Text + "*'"; } } if (txtBoxBuqueda.TextLength > 0) { if (Varios.IsNumeric(this.txtBoxBuqueda.Text)) { cadfitro = cadfitro + " and [" + busquedas[getBusquedaSeleccionada()].Text + "] = " + txtBoxBuqueda.Text; } else { if (getBusquedaSeleccionada() != 0) { cadfitro = cadfitro + " and [" + busquedas[getBusquedaSeleccionada()].Text + "] LIKE '*" + txtBoxBuqueda.Text + "*'"; } } } if (cadfitro.Length > 0) { cadfitro = cadfitro.Remove(0, 5); } binding.Filter = cadfitro; }
private bool datosValidos() { Boolean ok = true; if (!Varios.IsNumeric(this.txtCodigo.Text) || Convert.ToInt32(this.txtCodigo.Text) < 0) { MessageBox.Show("Debe ingresar un Codigo valido"); ok = false; this.txtCodigo.Focus(); } else { if (this.txtDescripcion.Text.Length == 0) { MessageBox.Show("Debe ingresar una descripcion valida"); ok = false; this.txtDescripcion.Focus(); } else { if (!Varios.IsNumeric(this.txtOrdPro.Text) || Convert.ToInt32(this.txtOrdPro.Text) < 0) { MessageBox.Show("Debe ingresar un Orden de Proceso valido"); ok = false; this.txtOrdPro.Focus(); } } } return(ok); }
private void txtLegajo_TextChanged(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtLegajo.Text)) { this.cmbEmpleados.SelectedValue = this.txtLegajo.Text; } }
private void actualizaValorLegajo() { string valor = ""; if (this.cmbTablasIndice.SelectedValue != null) { if (this.cmbEmpleados.SelectedValue != null) { if (Model.DB.ejecutarScalar(Model.TipoComando.SP, "empleadosSueldosConsultarValorLegajo", "legajo", Convert.ToInt32(this.cmbEmpleados.SelectedValue), "@codigo", Convert.ToInt32(this.cmbTablasIndice.SelectedValue)) == null) { valor = "-1"; } else { valor = Model.DB.ejecutarScalar(Model.TipoComando.SP, "empleadosSueldosConsultarValorLegajo", "legajo", Convert.ToInt32(this.cmbEmpleados.SelectedValue), "@codigo", Convert.ToInt32(this.cmbTablasIndice.SelectedValue)).ToString(); } //valor = valor.ToString(); if (Varios.IsNumeric(valor)) { this.cmbTablasDetalle.SelectedValue = valor; } else { this.cmbTablasDetalle.SelectedValue = 0; } } } }
private void btnModificar_Click(object sender, EventArgs e) { if (Varios.IsNumeric(Controles.consultaCampoRenglon(this.dgvFichadas, 0)) && Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvFichadas, 0)) > 0) { this.habilitaGrabar(); this.cmbMovimientos.SelectedValue = Controles.consultaCampoRenglon(this.dgvFichadas, 4); this.mTBHora.Text = Controles.consultaCampoRenglon(this.dgvFichadas, 3); } }
private void txtLegajo_TextChanged(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtLegajo.Text)) { this.cmbEmpleados.SelectedValue = this.txtLegajo.Text; } if (this.rbPorLegajo.Checked) { this.actualizarGrillaNovedadesEmpleado(); } }
private void btnActualizar_Click(object sender, EventArgs e) { DbDataReader rsCampos; //TODO: Fix Mono StreamReader sr = new StreamReader(@"E:\programas\sueldos\archivos\SIJP200809.txt"); string linea; string valorLeido; int legajo; while ((linea = sr.ReadLine()) != null) { Console.WriteLine(linea); rsCampos = Model.DB.ejecutarDataReader(Model.TipoComando.SP, "tablasConsultarFormatosExportacion", "@tabla", "sijp"); legajo = ConsultaEmpleados.consultarLegajoEmpleado(linea.Substring(0, 11)); while (rsCampos.Read()) { valorLeido = linea.Substring(Convert.ToInt32(rsCampos["posicion"]) - 1, Convert.ToInt32(rsCampos["longitud"])); Console.WriteLine(valorLeido); if (Convert.ToInt32(rsCampos["posicion"]) == 1) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 18, "@valor", valorLeido); } if (Convert.ToInt32(rsCampos["posicion"]) == 45) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 60, "@valor", Convert.ToInt32(valorLeido)); } if (Convert.ToInt32(rsCampos["posicion"]) == 47) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 61, "@valor", Convert.ToInt32(valorLeido)); } if (Convert.ToInt32(rsCampos["posicion"]) == 49) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 62, "@valor", Convert.ToInt32(valorLeido)); } if (Convert.ToInt32(rsCampos["posicion"]) == 58) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 63, "@valor", Convert.ToInt32(valorLeido)); } if (Convert.ToInt32(rsCampos["posicion"]) == 61) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 50, "@valor", Convert.ToInt32(valorLeido)); } if (Convert.ToInt32(rsCampos["posicion"]) == 209 && Varios.IsNumeric(valorLeido)) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "empleadosSueldosActualizar", "@legajo", legajo, "@codigo", 64, "@valor", Convert.ToInt32(valorLeido)); } //Console.WriteLine(linea.Substring(Convert.ToInt32(rsCampos["posicion"])-1, Convert.ToInt32(rsCampos["longitud"]))); } rsCampos.Close(); } sr.Close(); }
private void btnEliminar_Click(object sender, EventArgs e) { if (Varios.IsNumeric(Controles.consultaCampoRenglon(this.dgvFichadas, 0)) && Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvFichadas, 0)) > 0) { if (Varios.confirmaEliminarRegistro()) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "relojEliminar", "@id", Controles.consultaCampoRenglon(this.dgvFichadas, 0)); MessageBox.Show("la fichada se elimino con éxito"); this.actualizarGrilla(); } } }
private void txtLegajo_TextChanged(object sender, EventArgs e) { TextBox tb; tb = (TextBox)sender; if (tb.Text.Length > 0 && Varios.IsNumeric(tb.Text)) { this.barCode39[Convert.ToInt32(tb.Tag)].BarCode = this.txtEmpresa.Text + tb.Text.PadLeft(5, '0'); this.barCode39[Convert.ToInt32(tb.Tag)].HeaderText = Varios.Left(tb.Text.PadLeft(5, '0') + "_" + ConsultaEmpleados.consultarApellidoYnombres(Convert.ToInt32(this.txtLegajo[Convert.ToInt32(tb.Tag)].Text)), 28); } }
private void txtAnioVacaciones_TextChanged(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtAnioVacaciones.Text) && Convert.ToInt32(this.txtAnioVacaciones.Text) > 1950) { this.txtDiasVacaciones.Text = Model.DB.ejecutarScalar(Model.TipoComando.SP, "vacacionesCalculaDias", "legajo", this.vacacion.Legajo, "anioVac", this.txtAnioVacaciones.Text).ToString(); this.txtDiasALiquidar.Text = this.txtDiasVacaciones.Text; } else { this.txtDiasVacaciones.Text = ""; this.txtDiasALiquidar.Text = "0"; } }
private void txtCuota_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (Varios.IsNumeric(txtCuota.Text)) { this.btnGrabar.Focus(); } else { this.txtCuota.SelectAll(); } } }
private void btnEliminar_Click(object sender, EventArgs e) { if (dgvAnticipos.RowCount > 0) { if (Varios.IsNumeric(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) && Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) > 0) { if (Varios.confirmaEliminarRegistro()) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "anticipoEliminar", "@idAnticipo", Controles.consultaCampoRenglon(this.dgvAnticipos, 0)); this.actualizarGrilla(); } } } }
private void txtImporte_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (Varios.IsNumeric(txtImporte.Text)) { txtComentarios.SelectAll(); txtComentarios.Focus(); } else { txtImporte.SelectAll(); } } }
private void txtLegajo_TextChanged(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtLegajo.Text)) { this.cmbEmpleados.SelectedValue = this.txtLegajo.Text; this.txtNroComprobante.Text = ""; this.dtpFecha.Value = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); this.txtImporte.Text = "0.00"; this.txtCuota.Text = "1"; } else { this.cmbEmpleados.SelectedValue = 0; } }
private void btnModificar_Click(object sender, EventArgs e) { if (dgvAnticipos.RowCount > 0) { if (Varios.IsNumeric(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) && Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) > 0) { this.habilitaGrabar(); this.idAnticipo = Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)); this.cmbAnios.SelectedValue = Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 2)) / 100; this.cmbMeses.SelectedValue = Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 2)) % 100; this.cmbTipoAnticipo.SelectedValue = Controles.consultaCampoRenglon(this.dgvAnticipos, 3); this.txtNroComprobante.Text = Controles.consultaCampoRenglon(this.dgvAnticipos, 5); this.dtpFecha.Value = Convert.ToDateTime(Controles.consultaCampoRenglon(this.dgvAnticipos, 6)); this.txtImporte.Text = Controles.consultaCampoRenglon(this.dgvAnticipos, 7); this.txtCuota.Text = Controles.consultaCampoRenglon(this.dgvAnticipos, 8); } } }
public void abrirParaModificar(ref CampoEmpleadoEntity c) { this.txtCodigo.Enabled = false; this.cmbDescripcion.Enabled = false; Controles.cargaComboBox(this.cmbDescripcion, "descripcion", "indice", "tablasConsultarOtrosCamposEmpleado"); Controles.cargaComboBox(this.cmbDetalle, "detalle", "contenido", "tablasConsultarContenidoyDetalle", "@tabla", "EmpleadosSueldos", "@indice", c.Codigo); this.txtCodigo.Text = c.Codigo.ToString(); this.txtValor.Text = c.Valor; this.cmbDescripcion.SelectedValue = c.Codigo; if (Varios.IsNumeric(c.Valor)) { this.cmbDetalle.SelectedValue = Convert.ToDouble(c.Valor); } else { this.cmbDetalle.SelectedValue = null; } this.ShowDialog(); c.Valor = this.txtValor.Text; }
private void btnGrabar_Click(object sender, EventArgs e) { if (Varios.IsNumeric(this.txtValor.Text)) { int cant = 0; DbDataReader rs = Model.DB.ejecutarDataReader(Model.TipoComando.SP, "empleadosConsultarParaCargaMasiva", "@idConvenio", this.cmbConvenio.SelectedValue, "@idTipoLiquidacion", this.cmbTipoLiquidacion.SelectedValue); while (rs.Read()) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "novedadesActualizar", "@idLiquidacion", this.cmbLiquidacion.SelectedValue, "@legajo", Convert.ToInt32(rs["legajo"]), "@codigo", this.cmbNovedad.SelectedValue, "@valor", Convert.ToDouble(this.txtValor.Text)); cant++; } MessageBox.Show("Se actualizaron " + cant + " legajos."); this.btnGrabar.Enabled = false; } else { MessageBox.Show("El valor debe ser numérico !!"); this.txtValor.Focus(); } }
static void Main(string[] args) { //Seteo idReloj if (args.Length > 0 && Varios.IsNumeric(args[0].ToString())) { idReloj = Convert.ToInt32(args[0].ToString()); } else { idReloj = 0; } //Establesco la conexion defecto de la configuracion en app.config Model.DB.ConnectionName = "reloj.Properties.Settings.sueldosConnectionStringDefault"; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmReloj()); //Application.Run(new frmFingerPrintUtils()); }
private void btnAceptar_Click(object sender, EventArgs e) { //al grabar novedades a liquidar hay que poner el indice del legajo del empleado this.vacacion.Fecha = dtpFechaOtorgada.Value.Date; this.vacacion.DiasTomados = Convert.ToInt32(txtDiasATomar.Text); this.vacacion.AnioVacaciones = Convert.ToInt32(txtAnioVacaciones.Text); this.vacacion.TotalDias = Convert.ToInt32(txtDiasVacaciones.Text); if (asistencia) { if (Varios.IsNumeric(this.txtDiasATomar.Text) && Convert.ToInt32(this.txtDiasATomar.Text) > 0) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "vacacionesActualizar", "@legajo", this.vacacion.Legajo, "@fecha", this.vacacion.Fecha, "@codigo", this.vacacion.Codigo, "@diasTomados", this.txtDiasATomar.Text, "@anioVacaciones", this.txtAnioVacaciones.Text, "@totalDias", this.txtDiasVacaciones.Text); } if (Varios.IsNumeric(this.txtDiasALiquidar.Text) && Convert.ToInt32(this.txtDiasALiquidar.Text) > 0) { Model.DB.ejecutarProceso(Model.TipoComando.SP, "novedadesActualizar", "@idLiquidacion", this.cmbLiquidacion.SelectedValue, "@legajo", this.vacacion.Legajo, "@codigo", 45, "@valor", this.txtDiasALiquidar.Text); } } ok = true; this.Close(); }
private void btnImprimir_Click(object sender, EventArgs e) { if (dgvAnticipos.RowCount > 0) { if (Varios.IsNumeric(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) && Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)) > 0) { this.idAnticipo = Convert.ToInt32(Controles.consultaCampoRenglon(this.dgvAnticipos, 0)); /* Reportes.CRAnticipoVale anticipoVale = new Sueldos.View.Reportes.CRAnticipoVale(); * anticipoVale.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "anticiposConsultarParaVale", * "idAnticipo", this.idAnticipo)); * frmReportes visor = new frmReportes(anticipoVale); * visor.ShowDialog();*/ //EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1); DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "anticiposConsultarParaVale", "idAnticipo", this.idAnticipo); Sueldos.Reportes.CrystalReport.ReportesCreador.ValeAnticipo(ds); } } }