public void GuardarProducto() { try { clsDatos = new ClsDatos(); SqlParameter[] parameters = new SqlParameter[2]; parameters[0] = new SqlParameter(); parameters[0].ParameterName = "@nombre"; parameters[0].SqlDbType = SqlDbType.VarChar; parameters[0].Size = 50; parameters[0].Value = categoriaDTO.nombre; parameters[1] = new SqlParameter(); parameters[1].ParameterName = "@descripcion"; parameters[1].SqlDbType = SqlDbType.VarChar; parameters[1].Size = 200; parameters[1].Value = categoriaDTO.descripcion; clsDatos.EjecutarSP(parameters, "SPGuardarCategoria"); } catch (Exception e) { Exception exception = new Exception(e.Message); throw exception; } }
public void GuardarCambiosParticipantesConPais() { try { clsDatos = new ClsDatos(); SqlParameter[] parametro = new SqlParameter[4]; parametro[0] = new SqlParameter(); parametro[0].ParameterName = "@cedula"; parametro[0].SqlDbType = SqlDbType.Int; parametro[0].SqlValue = participantesDTO.getCedula(); parametro[1] = new SqlParameter(); parametro[1].ParameterName = "@nombre"; parametro[1].SqlDbType = SqlDbType.VarChar; parametro[1].Size = 100; parametro[1].SqlValue = participantesDTO.getNombre(); parametro[2] = new SqlParameter(); parametro[2].ParameterName = "@pais"; parametro[2].SqlDbType = SqlDbType.Int; parametro[2].SqlValue = participantesDTO.getPais(); parametro[3] = new SqlParameter(); parametro[3].ParameterName = "@edad"; parametro[3].SqlDbType = SqlDbType.TinyInt; parametro[3].SqlValue = participantesDTO.getEdad(); clsDatos.EjecutarSP(parametro, "spGuardarCambiosParticipantesCONPais"); } catch (Exception exception) { throw new Exception(exception.Message); } }
public void GuardarDatos() { try { cnGeneral = new ClsDatos(); SqlParameter[] parParameter = new SqlParameter[4]; parParameter[0] = new SqlParameter(); parParameter[0].ParameterName = "@opc"; parParameter[0].SqlDbType = SqlDbType.Int; parParameter[0].SqlValue = objContacto.opc; parParameter[1] = new SqlParameter(); parParameter[1].ParameterName = "@Id"; parParameter[1].SqlDbType = SqlDbType.Int; parParameter[1].SqlValue = objContacto.Id; parParameter[2] = new SqlParameter(); parParameter[2].ParameterName = "@Nombre"; parParameter[2].SqlDbType = SqlDbType.VarChar; parParameter[2].Size = 50; parParameter[2].SqlValue = objContacto.nombre; parParameter[3] = new SqlParameter(); parParameter[3].ParameterName = "@Telefono"; parParameter[3].SqlDbType = SqlDbType.VarChar; parParameter[3].Size = 20; parParameter[3].SqlValue = objContacto.Telefono; cnGeneral.EjecutarSP(parParameter, "SPContacto"); } catch (Exception e) { throw new Exception(e.Message); } }
public void GuardarCambios() { try { clsDatos = new ClsDatos(); SqlParameter[] parametro = new SqlParameter[2]; parametro[0] = new SqlParameter(); parametro[0].ParameterName = "@idpais"; parametro[0].SqlDbType = SqlDbType.Int; parametro[0].SqlValue = paisesDTO.getIdpais(); parametro[1] = new SqlParameter(); parametro[1].ParameterName = "@nombrepais"; parametro[1].SqlDbType = SqlDbType.VarChar; parametro[1].Size = 50; parametro[1].SqlValue = paisesDTO.getNombrepais(); clsDatos.EjecutarSP(parametro, "spGuardarCambios"); } catch (Exception exception) { throw new Exception(exception.Message); } }
public DataTable ListarPaises() { listaDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parametros; if (this.paisesDTO == null) { parametros = new SqlParameter[2]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@idpais"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = paisesDTO.getIdpais(); parametros[1] = new SqlParameter(); parametros[1].ParameterName = "@nombrepais"; parametros[1].SqlDbType = SqlDbType.VarChar; parametros[1].Size = 50; //Tamaño del Varchar asignado en la DB. parametros[1].SqlValue = paisesDTO.getNombrepais(); } else { parametros = null; } listaDatos = clsDatos.RetornaTable(parametros, "spConsultaPaises"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listaDatos); }
public void ValidarUsuario() { try { clsDatos = new ClsDatos(); MySqlParameter[] parameters = new MySqlParameter[2]; parameters[0] = new MySqlParameter(); parameters[0].ParameterName = "_usuario"; parameters[0].MySqlDbType = MySqlDbType.VarChar; parameters[0].Size = 30; parameters[0].Value = Logueo.getUsuario(); parameters[1] = new MySqlParameter(); parameters[1].ParameterName = "_pass"; parameters[1].MySqlDbType = MySqlDbType.VarChar; parameters[1].Size = 100; parameters[1].Value = Logueo.getPassword(); clsDatos.EjecutarSP(parameters, "SPLoguin"); } catch (Exception e) { Exception exception = new Exception(e.Message); throw exception; } }
private void btn_ejecutar_Click(object sender, EventArgs e) { if (conectarBd(this.cmb_base_datos.SelectedItem.Tostring())) {//DATOS DE LOS ESQUEMA DE LA BD ClsDatos.run_script(txt_estructura.Text.Trim()); //BLOQUEO OPCIONES DE CONEXION grbCadenaConec.Enabled = false; } abrirCerrarFormulario(false); }
public DataTable ListarProductos() { listaDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parametros = null; if (this.productosDTO == null) { parametros = new SqlParameter[5]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@Id"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = productosDTO.getId(); parametros[1] = new SqlParameter(); parametros[1].ParameterName = "@Nombre"; parametros[1].SqlDbType = SqlDbType.VarChar; parametros[1].Size = 100; parametros[1].SqlValue = productosDTO.getNombre(); parametros[2] = new SqlParameter(); parametros[2].ParameterName = "@Descripcion"; parametros[2].SqlDbType = SqlDbType.VarChar; parametros[2].Size = 100; parametros[2].SqlValue = productosDTO.getDescripcion(); parametros[3] = new SqlParameter(); parametros[3].ParameterName = "@Precio"; parametros[3].SqlDbType = SqlDbType.Int; parametros[3].SqlValue = productosDTO.getPrecio(); parametros[4] = new SqlParameter(); parametros[4].ParameterName = "@Stock"; parametros[4].SqlDbType = SqlDbType.Int; parametros[4].SqlValue = productosDTO.getStock(); } else { parametros = null; } listaDatos = clsDatos.RetornaTabla(parametros, "spConsultaProductos"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listaDatos); }
public DataTable ListarPaciente() { listaDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parametros = null; if (this.pacienteDTO == null) { parametros = new SqlParameter[5]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@id"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = pacienteDTO.getId(); parametros[1] = new SqlParameter(); parametros[1].ParameterName = "@Nombre"; parametros[1].SqlDbType = SqlDbType.VarChar; parametros[1].Size = 50; parametros[1].SqlValue = pacienteDTO.getNombre(); parametros[2] = new SqlParameter(); parametros[2].ParameterName = "@Apellido"; parametros[2].SqlDbType = SqlDbType.VarChar; parametros[2].Size = 50; parametros[2].SqlValue = pacienteDTO.getApellido(); parametros[3] = new SqlParameter(); parametros[3].ParameterName = "@FechaNacimiento"; parametros[3].SqlDbType = SqlDbType.DateTime; parametros[3].SqlValue = pacienteDTO.getFechaNacimiento(); parametros[4] = new SqlParameter(); parametros[4].ParameterName = "@Sexo"; parametros[4].SqlDbType = SqlDbType.VarChar; parametros[4].Size = 50; parametros[1].SqlValue = pacienteDTO.getSexo(); } else { parametros = null; } listaDatos = clsDatos.RetornarTabla(parametros, "spConsultaPaises"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listaDatos); }
private void cargar_bd() {//Array para los registros ArrayList xLista; //Cadena de Consulta string cadena = "select datname from pg_database where datname not in ('template1','template0') order by datname asc"; //CARGAMOS LOS DATOS DE LOS ESQUEMA xLista = ClsDatos.ListaDatos(cadena); Utiles.CargarCombo(this.cmb_base_datos, xLista); //Utiles.cargarLista(this.lst_esquemas, xLista); }
private void btn_desc_Click(object sender, EventArgs e) { //DESCONECTAR ClsDatos.Desconectar(); //CONECTAR conectarBd(this.cmb_base_datos.SelectedItem.Tostring()); //ELIMINAR LOS DATOS ClsDatos.run_script(Retornar_lectura_script("limpiar_funciones.sql")); //DESCONECTAR Y DAR TAMAÑO A EL FORMULARIO ClsDatos.Desconectar(); grbCadenaConec.Enabled = true; Size = new System.Drawing.Size(590, 170); }
//CARGAR LOS ESQUEMAS DE LA BD public void consultarEsquemas() { //Array para los registros ArrayList xLista; //Cadena de Consulta string cadena = "select nspname::varchar as nombre_del_los_esquema_listados from pg_namespace " + "where substring(nspname from 1 for 3) != 'pg_' and nspname not in ('information_schema','public') order by nspname "; //CARGAMOS LOS DATOS DE LOS ESQUEMA xLista = ClsDatos.ListaDatos(cadena); Utiles.CargarCombo(this.cmb_esquemas, xLista); }
//CARGAR LOS DATOS DE LA FUNCION public void consultarDatosFuncion(string squema) { //Array para los registros ArrayList xLista; //Cadena de Consulta string cadena = "select * from public.bd_buscar_funciones_por_palabra('" + squema + "'," + (rb_trigger.Checked ? true : false) + (txt_nom_func.Text.Length > 0 ? ",'" + txt_nom_func.Text + "'" : "") + ") as (nombre_de_la_funcion text)"; //CARGAMOS LOS DATOS DE LOS ESQUEMA xLista = ClsDatos.ListaDatos(cadena); Utiles.CargarCombo(this.cmb_funcion, xLista); }
//SALIR private void btn_salir_Click(object sender, EventArgs e) { //DESCONECTAR ClsDatos.Desconectar(); if (this.cmb_base_datos.Items.Count > 0) { //CONECTAR conectarBd(this.cmb_base_datos.SelectedItem.ToString()); //ELIMINAR LOS DATOS ClsDatos.run_script(Retornar_lectura_script("limpiar_funciones.sql")); //CERRAR CONEXION Y CERRAR FORMULARIO ClsDatos.Desconectar(); } this.Close(); }
public ProductosController() { ClsDatos obj = new ClsDatos(); obj.descripcion = "Manzana"; obj.cantidad = 10; obj.precio = 0.50m; producto.Add(obj); ClsDatos obj1 = new ClsDatos(); obj1.descripcion = "Banana"; obj1.cantidad = 15; obj1.precio = 0.80m; producto.Add(obj1); }
//CONECTAR BD public bool conectarBd(string baseDatos) { bool v = false; //Alamcenamos en variables "LUEGO SE VALIDA SU VALOR VACIO" string cuser = this.txtUser.Text, cpass = this.txtPass.Text, cport = this.txtPuerto.Text, cdata = baseDatos, chost = this.txtServidor.Text; //Conexion if (ClsDatos.Conectar(cuser, cpass, chost, cport, cdata)) { v = true; } return(v); }
public DataTable ListarParticipantes() { listaDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parametros = null; listaDatos = clsDatos.RetornaTabla(parametros, "spConsultaParticipantes"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listaDatos); }
public DataTable ListarParking() { listaDatos = new DataTable(); try { ClsDatos = new ClsDatos(); SqlParameter[] parametros = null; if (this.parkingDTO == null) { parametros = new SqlParameter[4]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@idpark"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = parkingDTO.getIdpark(); parametros[1] = new SqlParameter(); parametros[1].ParameterName = "@Nombre"; parametros[1].SqlDbType = SqlDbType.VarChar; parametros[1].Size = 50; parametros[1].SqlValue = parkingDTO.getNombre(); parametros[2] = new SqlParameter(); parametros[2].ParameterName = "@Placa"; parametros[2].SqlDbType = SqlDbType.Int; parametros[2].SqlValue = parkingDTO.getPlaca(); parametros[3] = new SqlParameter(); parametros[3].ParameterName = "@Tipov"; parametros[3].SqlDbType = SqlDbType.VarChar; parametros[3].Size = 50; parametros[3].SqlValue = parkingDTO.getTipov(); } else { parametros = null; } listaDatos = ClsDatos.RetornaTabla(parametros, "spConsulta"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listaDatos); }
public void GuardarDatos() { try { cnGeneral = new ClsDatos(); SqlParameter[] parameters = new SqlParameter[6]; parameters[0] = new SqlParameter(); parameters[0].ParameterName = "@opc"; parameters[0].SqlDbType = SqlDbType.Int; parameters[0].SqlValue = objContacto.opc; parameters[1] = new SqlParameter(); parameters[1].ParameterName = "@Cedula"; parameters[1].SqlDbType = SqlDbType.Int; parameters[1].SqlValue = objContacto.Cedula; parameters[2] = new SqlParameter(); parameters[2].ParameterName = "@Nombre"; parameters[2].SqlDbType = SqlDbType.VarChar; parameters[2].Size = 50; parameters[2].SqlValue = objContacto.Nombre; parameters[3] = new SqlParameter(); parameters[3].ParameterName = "@Apellido"; parameters[3].SqlDbType = SqlDbType.VarChar; parameters[3].Size = 50; parameters[3].SqlValue = objContacto.Apellido; parameters[4] = new SqlParameter(); parameters[4].ParameterName = "@Fecha_nacimiento"; parameters[4].SqlDbType = SqlDbType.Date; // parameters[4].Size = 20; parameters[4].SqlValue = objContacto.FechaNacimiento; parameters[5] = new SqlParameter(); parameters[5].ParameterName = "@Cargo"; parameters[5].SqlDbType = SqlDbType.TinyInt; // parameters[5].Size = 20; parameters[5].SqlValue = objContacto.Cargo; cnGeneral.EjecutarSP(parameters, "SPContacto"); } catch (Exception e) { throw new Exception(e.Message); } }
private void txt_nom_func_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar == (int)Keys.Enter) {//SI NO EXISTE NINGUN ESQUEMA BLOQUEAR this.Size = new System.Drawing.Size(590, 374); if (this.cmb_esquemas.Items.Count < 1) {//MENSAJE MessageBox.Show("No Hay Esquemas"); return; } //MENSAJE Frmmensaje.Text = "Realizando Analisis. Espere..."; //METODO MUESTRA MENSAJE abrirCerrarFormulario(true); //ATRAPAMOS LOS VALORES DE LOS ESQUEMAS string squemaModelo = cmb_esquemas.SelectedItem.Tostring(); //CONEXION A BASE DATOS if (conectarBd(this.cmb_base_datos.SelectedItem.Tostring())) { //MOSTRAMOS EN FORMULARIO EL VALOR ENVIADO DE LA BASE DE DATOS Frmmensaje.Text = "Estructurando Esquema. Espere..."; tabControl1.TabPages.Remove(tabPage1); tabControl1.TabPages.Remove(tabPage2); tabControl1.TabPages.Insert(0, (chk_busqueda.Checked ? tabPage2 : tabPage1)); if (chk_busqueda.Checked) { //cargar los datos de listview consultarDatosFuncion(squemaModelo); //tamaño x defecto this.Size = new System.Drawing.Size(590, 804); //datos reinicio btn_guardar_opt2.Visible = txt_estructura_opt2.Visible = btn_copiar_opt2.Visible = btn_ejecutar_opt2.Visible = false; ClsDatos.Desconectar(); } else {//ENVIAMOS EL VALOR RETORNADO AL OTRO FORMULARIO string Cadena = ClsDatos.CadenaDatos(TipFuncion(squemaModelo, true)); txt_estructura.Text = Cadena; if (Cadena.Length > 0) { this.Size = new System.Drawing.Size(590, 804); } } //CERRAMOS FORMULARIO DE MENSAJE abrirCerrarFormulario(false); } //CERRAMOS FORMULARIO DE MENSAJE abrirCerrarFormulario(false); } }
public DataTable Listar() { tblDatos = new DataTable(); try { cnGeneral = new ClsDatos(); SqlParameter[] parParameter = new SqlParameter[1]; parParameter[0] = new SqlParameter(); parParameter[0].ParameterName = "@opc"; parParameter[0].SqlDbType = SqlDbType.Int; parParameter[0].SqlValue = objContacto.opc; tblDatos = cnGeneral.RetornaTabla(parParameter, "SPContacto"); } catch (Exception e) { throw new Exception(e.Message); } return(tblDatos); }
public DataTable ListarProductos() { listaDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parameters = null; listaDatos = clsDatos.RetornaTabla(parameters, "SPListarProductos"); } catch (Exception e) { Exception exception = new Exception(e.Message); throw exception; } return(listaDatos); }
public void EliminarRegistro() { try { clsDatos = new ClsDatos(); SqlParameter[] parametros = new SqlParameter[1]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@idproducto"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = clsControladorDTO.getIdproducto(); clsDatos.EjecutarSP(parametros, "spEliminar"); } catch (Exception exception) { throw new Exception(exception.Message); } }
private void BtnReportes_Click(object sender, EventArgs e) { FrmReporteActivos rpt = new FrmReporteActivos(); for (int i = 0; i < DgvActivos.Rows.Count - 1; i++) { ClsDatos data = new ClsDatos { ActId = Convert.ToInt32(DgvActivos.Rows[i].Cells[1].Value), ActCodBarra = Convert.ToString(DgvActivos.Rows[i].Cells[2].Value), ActArchivo = Convert.ToString(DgvActivos.Rows[i].Cells[3].Value), ActNombre = Convert.ToString(DgvActivos.Rows[i].Cells[4].Value), ActReferencia = Convert.ToString(DgvActivos.Rows[i].Cells[5].Value), ActObservaciones = Convert.ToString(DgvActivos.Rows[i].Cells[6].Value), AreId = Convert.ToInt32(DgvActivos.Rows[i].Cells[7].Value), AreNombre = Convert.ToString(DgvActivos.Rows[i].Cells[8].Value), PctCuenta = Convert.ToString(DgvActivos.Rows[i].Cells[9].Value), PctNombre = Convert.ToString(DgvActivos.Rows[i].Cells[10].Value), CusCedula = Convert.ToString(DgvActivos.Rows[i].Cells[11].Value), CusNombre = Convert.ToString(DgvActivos.Rows[i].Cells[12].Value), ActFactura = Convert.ToString(DgvActivos.Rows[i].Cells[13].Value), ActFechaCompra = Convert.ToString(DgvActivos.Rows[i].Cells[14].Value), ProRuc = Convert.ToString(DgvActivos.Rows[i].Cells[15].Value), ProNombre = Convert.ToString(DgvActivos.Rows[i].Cells[16].Value), ActValorBase0 = Convert.ToDouble(DgvActivos.Rows[i].Cells[17].Value), ActValorBaseIva = Convert.ToDouble(DgvActivos.Rows[i].Cells[18].Value), ActPctjeIva = Convert.ToDouble(DgvActivos.Rows[i].Cells[19].Value), ActValorIva = Convert.ToDouble(DgvActivos.Rows[i].Cells[20].Value), ActValorTotal = Convert.ToDouble(DgvActivos.Rows[i].Cells[21].Value), ActDepreDiaria = Convert.ToDouble(DgvActivos.Rows[i].Cells[22].Value), ActDepreAcumulada = Convert.ToDouble(DgvActivos.Rows[i].Cells[23].Value), ActValorActual = Convert.ToDouble(DgvActivos.Rows[i].Cells[24].Value), ActFinVidaUtil = Convert.ToString(DgvActivos.Rows[i].Cells[25].Value), ActFechaCorteDepre = Convert.ToString(DgvActivos.Rows[i].Cells[26].Value), ActDepreciable = Convert.ToString(DgvActivos.Rows[i].Cells[27].Value), ActEstado = Convert.ToString(DgvActivos.Rows[i].Cells[28].Value), EmpId = Convert.ToInt32(DgvActivos.Rows[i].Cells[29].Value), EmpNombre = Convert.ToString(DgvActivos.Rows[i].Cells[30].Value) }; rpt.Datos.Add(data); } rpt.ShowDialog(); }
public void registrarAdministrador() { try { clsDatos = new ClsDatos(); MySqlParameter[] parameters = new MySqlParameter[5]; parameters[0] = new MySqlParameter(); parameters[0].ParameterName = "_usuario"; parameters[0].MySqlDbType = MySqlDbType.VarChar; parameters[0].Size = 30; parameters[0].Value = uAdministrador.usuario; parameters[1] = new MySqlParameter(); parameters[1].ParameterName = "_contra"; parameters[1].MySqlDbType = MySqlDbType.VarChar; parameters[1].Size = 100; parameters[1].Value = uAdministrador.contra; parameters[2] = new MySqlParameter(); parameters[2].ParameterName = "_pregunta"; parameters[2].MySqlDbType = MySqlDbType.VarChar; parameters[2].Size = 50; parameters[2].Value = uAdministrador.pregunta; parameters[3] = new MySqlParameter(); parameters[3].ParameterName = "_respuesta"; parameters[3].MySqlDbType = MySqlDbType.VarChar; parameters[3].Size = 50; parameters[3].Value = uAdministrador.respuesta; parameters[4] = new MySqlParameter(); parameters[4].ParameterName = "_tusuario"; parameters[4].MySqlDbType = MySqlDbType.Int16; parameters[4].Value = uAdministrador.getTipousuario(); clsDatos.EjecutarSP(parameters, "SPRegistrarAdmin"); }catch (Exception e) { Exception exception = new Exception(e.Message); throw exception; } }
public void EliminarPais() { try { clsDatos = new ClsDatos(); SqlParameter[] parametro = new SqlParameter[1]; parametro[0] = new SqlParameter(); parametro[0].ParameterName = "@idpais"; parametro[0].SqlDbType = SqlDbType.Int; parametro[0].SqlValue = paisesDTO.getIdpais(); clsDatos.EjecutaSP(parametro, "spEliminarPais"); } catch (Exception exception) { throw new Exception(exception.Message); } }
public void GuardarModalidad() { try { clsDatos = new ClsDatos(); SqlParameter[] parametros = new SqlParameter[1]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@nombre"; parametros[0].SqlDbType = SqlDbType.VarChar; parametros[0].SqlValue = modalidadesDTO.nombre; clsDatos.EjecutarSP(parametros, "SPGuardarModalidades"); } catch (Exception exception) { throw new Exception(exception.Message); } }
public DataTable MostrarInventario() { listarDatos = new DataTable(); try { clsDatos = new ClsDatos(); SqlParameter[] parametros; if (this.clsControladorDTO == null) { parametros = new SqlParameter[4]; parametros[0] = new SqlParameter(); parametros[0].ParameterName = "@idproducto"; parametros[0].SqlDbType = SqlDbType.Int; parametros[0].SqlValue = clsControladorDTO.getIdproducto(); parametros[1] = new SqlParameter(); parametros[1].ParameterName = "@nombreproducto"; parametros[1].SqlDbType = SqlDbType.VarChar; parametros[1].Size = 50; parametros[1].SqlValue = clsControladorDTO.getNombreproducto(); parametros[2] = new SqlParameter(); parametros[2].ParameterName = "@precio"; parametros[2].SqlDbType = SqlDbType.Int; parametros[2].SqlValue = clsControladorDTO.getPrecio(); parametros[3] = new SqlParameter(); parametros[3].ParameterName = "@departamento"; parametros[3].SqlDbType = SqlDbType.VarChar; parametros[3].Size = 50; parametros[3].SqlValue = clsControladorDTO.getDepartamento(); } else { parametros = null; } listarDatos = clsDatos.RetornaTable(parametros, "spMostrarInventario"); } catch (Exception exception) { throw new Exception(exception.Message); } return(listarDatos); }
public void EliminarProducto() { try { clsDatos = new ClsDatos(); SqlParameter[] parameters = new SqlParameter[1]; parameters[0] = new SqlParameter(); parameters[0].ParameterName = "@codigo"; parameters[0].SqlDbType = SqlDbType.Int; parameters[0].Value = inventarioDTO.id; clsDatos.EjecutarSP(parameters, "SPEliminarProducto"); } catch (Exception e) { Exception exception = new Exception(e.Message); throw exception; } }
private void btn_listar_esquemas_Click(object sender, EventArgs e) { //DATOS DE LOS ESQUEMA DE LA BD if (conectarBd(this.cmb_base_datos.SelectedItem.Tostring())) { //TAMAÑO DE FORMULARIO consultarEsquemas(); //RESTABLECER CHECK chk_busqueda.Checked = false; //DESCONECTAR ClsDatos.Desconectar(); //CONECTAR conectarBd(this.cmb_base_datos.SelectedItem.Tostring()); //EJECUTAR EL ARCHIVO SQL ClsDatos.run_script(Retornar_lectura_script("modelador.sql")); this.Size = new System.Drawing.Size(590, 374); //BLOQUEO OPCIONES DE CONEXION grbCadenaConec.Enabled = false; txt_nom_func.Text = ""; } abrirCerrarFormulario(false); }