//**************************************************** // INICIO METODOS PPALES ALTA, BAJA, MODIFICACION **** //**************************************************** private void addItem() { clsFunciones clsFunc = new clsFunciones(); String respuesta = String.Empty; clsSQL clsSQL = new clsSQL(); int activo = 0; if (this.chkActivo.Checked == true) { activo = 1; } respuesta = clsSQL.ejecutarSP("SP_Man_Empleados", "@opcion=1=System.Int32", "@id_key_empleado=0=System.Int32", "@NIF=" + this.txtNIF.Text.Trim() + "=System.String", "@nombre=" + this.txtNombre.Text.Trim() + "=System.String", "@apellido1=" + this.txtApellido1.Text.Trim() + "=System.String", "@apellido2=" + this.txtApellido2.Text.Trim() + "=System.String", "@num_SS=" + this.txtNumSS.Text.Trim() + "=System.String", "@fecha_alta=" + this.fechaAlta.Value + "=System.Datetime", "@fecha_baja=" + fechaBaja.Value + "=System.Datetime", "@id_key_departamento=" + this.cmbDepartamento.SelectedValue + "=System.Int32", "@id_key_puesto=" + this.cmbPuesto.SelectedValue + "=System.Int32", "@activo=" + activo.ToString() + "=System.Int32"); if (respuesta != "OK") { MessageBox.Show("Error al crear el registro.", mdPrincipal.Error_SQL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Registro añadido correctamente."); } this.Close(); }
private void addItem() { clsFunciones clsFunc = new clsFunciones(); String respuesta = String.Empty; clsSQL clsSQL = new clsSQL(); respuesta = clsSQL.ejecutarSP("SP_Man_Servicios", "@opcion=1=System.Int32", "@id_key_servicio=0=System.Int32", "@fecha=" + this.Fecha.Value + "=System.Datetime", "@hora=" + this.Hora.Value + "=System.Datetime", "@id_Key_cliente=" + this.cmbClientes.SelectedValue + "=System.Int32", "@id_key_origen=" + this.cmbDesde.SelectedValue + "=System.Int32", "@id_key_destino=" + this.cmbHasta.SelectedValue + "=System.Int32", "@id_key_empleado=" + this.cmbConductor.SelectedValue + "=System.Int32", "@id_key_vehiculo=" + this.cmbVehiculos.SelectedValue + "=System.Int32", "@Menus=" + this.txtMenus.Text.Trim() + "=System.Decimal", "@Km=" + this.txtKm.Text.Trim() + "=System.Decimal", "@id_key_estado=" + this.cmbEstado.SelectedIndex + "=System.Int32", "@notas=" + this.txtNotas.Text.Trim() + "=System.String"); if (respuesta != "OK") { MessageBox.Show("Error al crear el registro.", mdPrincipal.Error_SQL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Registro añadido correctamente."); } this.Close(); }
private void addItem() { clsFunciones clsFunc = new clsFunciones(); String respuesta = String.Empty; clsSQL clsSQL = new clsSQL(); int activo = 0; if (this.chkActivo.Checked == true) { activo = 1; } respuesta = clsSQL.ejecutarSP("SP_Man_Vehiculos", "@opcion=1=System.Int32", "@id_key_vehiculo=0=System.Int32", "@matricula=" + this.txtMatricula.Text.Trim() + "=System.String", "@num_bastidor=" + this.txtNumBastidor.Text.Trim() + "=System.String", "@id_key_tipo_vehiculo=" + this.cmbTipoVehiculo.SelectedValue + "=System.Int32", "@marca=" + this.txtMarca.Text.Trim() + "=System.String", "@modelo=" + this.txtModelo.Text.Trim() + "=System.String", "@fecha_matriculacion=" + this.fechaMatriculacion.Value + "=System.Datetime", "@id_key_tipo_ruedas=" + this.cmbTipoRuedas.SelectedValue + "=System.Int32", "@vehiculo_activo=" + activo.ToString() + "=System.Int32"); if (respuesta != "OK") { MessageBox.Show("Error al crear el registro.", mdPrincipal.Error_SQL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Registro añadido correctamente."); } this.Close(); }
private void modificarItem() { clsFunciones clsFunc = new clsFunciones(); String respuesta = String.Empty; clsSQL clsSQL = new clsSQL(); int activo = 0; if (this.chkActivo.Checked == true) { activo = 1; } respuesta = clsSQL.ejecutarSP("SP_Man_Rutas", "@opcion=3=System.Int32", "@id_key_ruta=" + this.id_key_ruta.ToString() + "=System.Int32", "@origen=" + this.txtOrigen.Text.Trim() + "=System.String", "@destino=" + this.txtDestino.Text.Trim() + "=System.String", "@km=" + this.txtKm.Text.Trim() + "=System.Int32", "@peajes=" + this.txtPeajes.Text.Trim() + "=System.String", "@precios=" + this.txtPrecio.Text.Trim() + "=System.String", "@vehiculo_activo=" + activo.ToString() + "=System.Int32"); if (respuesta != "OK") { MessageBox.Show("Error al modificar el registro.", mdPrincipal.Error_SQL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Registro modificado correctamente."); } this.Close(); }
private void addItem() { clsFunciones clsFunc = new clsFunciones(); String respuesta = String.Empty; clsSQL clsSQL = new clsSQL(); int activo = 0; if (this.chkActivo.Checked == true) { activo = 1; } respuesta = clsSQL.ejecutarSP("SP_Man_Clientes", "@opcion=1=System.Int32", "@id_key_cliente=0=System.Int32", "@CIF=" + this.txtCIF.Text.Trim() + "=System.String", "@Nombre=" + this.txtNombre.Text.Trim() + "=System.String", "@Direccion_fiscal=" + this.txtDireccion.Text.Trim() + "=System.String", "@id_key_provincia_fiscal=" + this.cmbProvincias.SelectedValue + "=System.Int32", "@pais_fiscal=spain=System.String", "@CP_fiscal=0=System.Int32", "@Direccion_postal=" + this.txtDireccion.Text.Trim() + "=System.String", "@id_key_provincia_postal=" + this.cmbProvincias.SelectedValue + "=System.Int32", "@pais_postal=spain=System.String", "@CP_postal=0=System.Int32", "@Telefono=" + this.txtTelefono.Text.Trim() + "=System.String", "@Fax=" + this.txtTelefono.Text.Trim() + "=System.String", "@Email=" + this.txtEmail.Text.Trim() + "=System.String", "@web=" + this.txtEmail.Text.Trim() + "=System.String", "@notas=" + this.txtEmail.Text.Trim() + "=System.String"); if (respuesta != "OK") { MessageBox.Show("Error al crear el registro.", mdPrincipal.Error_SQL, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Registro añadido correctamente."); } this.Close(); }