public void SP_FrmRecargas_Buscar() { CLConexion objconect = new CLConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_FrmRecargas_Buscar", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Codigo", RFID); objconect.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Saldo = Convert.ToDouble(Lectura[0]); msn = ""; objconect.connection.Close(); return; } if (Lectura.Read() == false) { msn = "No hay Registro"; objconect.connection.Close(); return; } }
public void SP_FrmProductos_Buscar() { CLConexion objconect = new CLConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_FrmProductos_Buscar", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Codigo", Codigo); objconect.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Nombre = Convert.ToString(Lectura[0]); Precio = Convert.ToDouble(Lectura[1]); Stock = Convert.ToInt32(Lectura[2]); msn = ""; objconect.connection.Close(); return; } if (Lectura.Read() == false) { msn = "No hay Registro"; objconect.connection.Close(); return; } }
public void SP_FrmProductos_Guardar() { CLConexion Obj = new CLConexion(); SqlDataReader Lectura; SqlCommand con = new SqlCommand("SP_FrmProductos_Buscar", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Codigo", Codigo); Obj.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == false) { Obj.connection.Close(); con = new SqlCommand("SP_FrmProductos_Guardar", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Codigo", Codigo); con.Parameters.AddWithValue("@Nombre", Nombre); con.Parameters.AddWithValue("@Precio", Precio); con.Parameters.AddWithValue("@Stock", Stock); con.Connection.Open(); con.ExecuteNonQuery(); con.Connection.Close(); msn = ""; return; } if (Lectura.Read() == true) { Obj.connection.Close(); } }
public void SP_FrmEmpleado_GuardarEmpleado() { CLConexion Obj = new CLConexion(); SqlDataReader Lectura; SqlCommand con = new SqlCommand("SP_FrmEmpleados_BuscarEmpleados", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); Obj.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == false) { Obj.connection.Close(); con = new SqlCommand("SP_FrmEmpleado_GuardarEmpleado", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); con.Parameters.AddWithValue("@Nombre", Nombre); con.Parameters.AddWithValue("@Telefono", Telefono); con.Parameters.AddWithValue("@Correo", Correo); con.Connection.Open(); con.ExecuteNonQuery(); con.Connection.Close(); msn = ""; return; } if (Lectura.Read() == true) { Obj.connection.Close(); } }
protected void Func_ConsultarUsuario() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_BuscarCliente", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@id", id); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { nombre = Convert.ToString(Lectura[0]); apellidos = Convert.ToString(Lectura[1]); sexo = Convert.ToString(Lectura[5]); direccion = Convert.ToString(Lectura[3]); correo = Convert.ToString(Lectura[2]); telefono = Convert.ToString(Lectura[7]); movil = Convert.ToString(Lectura[6]); estado = Convert.ToString(Lectura[4]); foto = Convert.ToString(Lectura[8]); usuario = Convert.ToString(Lectura[9]); sw = 1; } objconect.connection.Close(); }
private void btn_Buscar_Click(object sender, EventArgs e) { string BUSCAR = "SELECT * FROM DBP WHERE Id=@Id"; OleDbCommand CmdBuscar = new OleDbCommand(BUSCAR, Cnx); CmdBuscar.CommandType = CommandType.Text; CmdBuscar.Parameters.AddWithValue("@Id", idTextBox.Text); Cnx.Open(); OleDbDataReader Lectura; Lectura = CmdBuscar.ExecuteReader(); if (Lectura.Read() == true) { nombreTextBox.Text = Lectura[1].ToString(); apellidoTextBox.Text = Lectura[2].ToString(); departamentoTextBox.Text = Lectura[3].ToString(); turnoTextBox.Text = Lectura[4].ToString(); contactoTextBox.Text = Lectura[5].ToString(); pic_Empleado.ImageLocation = Lectura[6].ToString(); } else { MessageBox.Show("Los Datos a Buscar No Estan Registrados"); idTextBox.Clear(); idTextBox.Focus(); } Cnx.Close(); }
protected void FuncBuscarInventario() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_BuscarInventario", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@codigo", Codigo); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { // Codigo = Convert.ToString(Lectura[0]); Nombre = Convert.ToString(Lectura[1]); Caracteristicas = Convert.ToString(Lectura[2]); Serie = Convert.ToString(Lectura[3]); Tipo = Convert.ToString(Lectura[4]); Nivel = Convert.ToString(Lectura[5]); Dependencias = Convert.ToString(Lectura[7]); Valor = Convert.ToString(Lectura[8]); Modelo = Convert.ToString(Lectura[9]); Ambientes = Convert.ToString(Lectura[10]); sw = 1; } objconect.connection.Close(); }
public void SP_FrmRegistrarVinculo_BuscarTarjeta() { CLConexion objconect = new CLConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_FrmRegistrarVinculo_BuscarTarjeta", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@RFDI", RFID); objconect.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Contraseña = Convert.ToString(Lectura[0]); msn = ""; objconect.connection.Close(); return; } if (Lectura.Read() == false) { msn = "No hay Registro"; objconect.connection.Close(); return; } }
/// //////////////////////////////////////////// BUSCAR Persona ///////////////////////////////////////////////////////////// protected void Func_BuscarPersona() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ConsultarPersona", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@id", Id); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Primer_Nombre = Convert.ToString(Lectura[0]); Segundo_nombre = Convert.ToString(Lectura[1]); Primer_Apellido = Convert.ToString(Lectura[2]); Segundo_Apellido = Convert.ToString(Lectura[3]); Telefono = Convert.ToString(Lectura[4]); Correo = Convert.ToString(Lectura[5]); direccion = Convert.ToString(Lectura[6]); Rol = Convert.ToString(Lectura[8]); Usuario = Convert.ToString(Lectura[7]); sw = 1; } objconect.connection.Close(); }
public void SP_FrmRegistrarVinculo_RegistrarTarjeta() { CLConexion Obj = new CLConexion(); SqlDataReader Lectura; SqlCommand con = new SqlCommand("SP_FrmRegistrarVinculo_BuscarTarjeta", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@RFDI", RFID); Obj.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == false) { Obj.connection.Close(); con = new SqlCommand("SP_FrmRegistrarVinculo_RegistrarTarjeta", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@RFID", RFID); con.Parameters.AddWithValue("@Contraseña", Contraseña); con.Parameters.AddWithValue("@Saldo", Saldo); con.Connection.Open(); con.ExecuteNonQuery(); con.Connection.Close(); msn = ""; return; } if (Lectura.Read() == true) { Obj.connection.Close(); } }
public void SP_FrmRegistrarVinculo_BuscarPersona() { CLConexion objconect = new CLConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_FrmRegistrarVinculo_BuscarPersona", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); objconect.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Nombre = Convert.ToString(Lectura[0]); Institucion = Convert.ToString(Lectura[1]); RFID = Convert.ToString(Lectura[2]); Saldo = Convert.ToDouble(Lectura[3]); Correo = Convert.ToString(Lectura[4]); Contraseña = Convert.ToString(Lectura[5]); msn = ""; objconect.connection.Close(); return; } if (Lectura.Read() == false) { msn = "No hay Registro"; objconect.connection.Close(); return; } }
public void SP_FrmEmpleados_BuscarEmpleado() { CLConexion objconect = new CLConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_FrmEmpleados_BuscarEmpleados", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); objconect.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Nombre = Convert.ToString(Lectura[0]); Telefono = Convert.ToString(Lectura[1]); Correo = Convert.ToString(Lectura[2]); msn = ""; objconect.connection.Close(); return; } if (Lectura.Read() == false) { msn = "No hay Registro"; objconect.connection.Close(); return; } }
protected void Func_Imprimir1() { ClsConexion objconnet = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ImprimirOrdenTrabajo", objconnet.connection); con.Parameters.AddWithValue("@Codigo_Maquina", NumeroOr); con.CommandType = CommandType.StoredProcedure; objconnet.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { regional = Convert.ToString(Lectura[0]); dependencia = Convert.ToString(Lectura[1]); ambiente = Convert.ToString(Lectura[2]); solicitud = Convert.ToString(Lectura[3]); Codigo_Maquina = Convert.ToString(Lectura[4]); tipo_equipo = Convert.ToString(Lectura[5]); tipo_actividad = Convert.ToString(Lectura[6]); prioridad = Convert.ToString(Lectura[7]); actividad_ejecutar = Convert.ToString(Lectura[8]); nombre_tecnico = Convert.ToString(Lectura[9]); sw = 1; } objconnet.connection.Close(); }
private void btn_buscar_Click(object sender, EventArgs e) { string BUSCAR = "SELECT * FROM persona WHERE Id=@Id"; OleDbCommand CmdBuscar = new OleDbCommand(BUSCAR, Cnx); CmdBuscar.CommandType = CommandType.Text; CmdBuscar.Parameters.AddWithValue("@Id", txt_id.Text); Cnx.Open(); OleDbDataReader Lectura; Lectura = CmdBuscar.ExecuteReader(); if (Lectura.Read() == true) { txt_nombre.Text = Lectura[1].ToString(); txt_apellido.Text = Lectura[2].ToString(); txt_domicilio.Text = Lectura[3].ToString(); txt_colonia.Text = Lectura[4].ToString(); txt_ciudad.Text = Lectura[5].ToString(); txt_telcasa.Text = Lectura[6].ToString(); txt_telmovil.Text = Lectura[7].ToString(); txt_email.Text = Lectura[8].ToString(); txt_email_empresarial.Text = Lectura[9].ToString(); pic_foto.ImageLocation = Lectura[10].ToString(); } else { MessageBox.Show("Los Datos a Buscar No Estan Registrados"); txt_id.Clear(); txt_id.Focus(); } Cnx.Close(); }
public void SP_FrmRegistrarVinculo_GuardarPersona() { CLConexion Obj = new CLConexion(); SqlDataReader Lectura; SqlCommand con = new SqlCommand("SP_FrmRegistrarVinculo_BuscarPersona", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); Obj.connection.Open(); con.ExecuteNonQuery(); Lectura = con.ExecuteReader(); if (Lectura.Read() == false) { Obj.connection.Close(); con = new SqlCommand("SP_FrmRegistrarVinculo_GuardarPersona", Obj.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Documento", Documento); con.Parameters.AddWithValue("@Nombre", Nombre); con.Parameters.AddWithValue("@Institucion", Institucion); con.Parameters.AddWithValue("@Correo", Correo); con.Connection.Open(); con.ExecuteNonQuery(); con.Connection.Close(); msn = ""; return; } if (Lectura.Read() == true) { Obj.connection.Close(); } }
/// //////////////////////////////////////////////////// validar inicio empresa////////////////////////////////////////////////////////////// protected void Func_Inicio() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ValidarInicio", objconect.connection); con.CommandType = CommandType.StoredProcedure; objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { cant = Convert.ToInt32(Lectura[0]); sw = 1; } }
protected void Func_ConsultarRegistroUsuario() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ConsultarUsuario", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@usuario", id); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { foto = Convert.ToString(Lectura[0]); sw = 1; } }
protected void FuncCargarNit() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_CargarNitEmpresa", objconect.connection); con.CommandType = CommandType.StoredProcedure; objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { nit2 = Convert.ToString(Lectura[0]); Nombre = Convert.ToString(Lectura[1]); sw = 1; } }
protected void Func_ValidarCuenta() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ValidacionCuenta", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@ncuenta", ncuenta); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { swc = 1; } objconect.connection.Close(); }
protected void Func_NumeroOrdenTrabajo() { ClsConexion objconnet = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_CargarOrdenTrabajo", objconnet.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@codigo_maquina", Codigo_Maquina); objconnet.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { NumeroOr = Convert.ToString(Lectura[0]); sw = 1; } objconnet.connection.Close(); }
protected void Func_BuscarClientes() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ConsultarPropietario", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@id", cuenta); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { propietario = Convert.ToString(Lectura[0]); sw = 1; } objconect.connection.Close(); }
public void Fnt_ConsultarDB(String user, String pass) { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_Ingresar", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@correo", user); con.Parameters.AddWithValue("@clave", pass); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { nombre = Convert.ToString(Lectura[0]); sw = 1; } objconect.connection.Close(); }
public void Consultar() { Conexión Objconect = new Conexión(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_CONSULTARDATOS", Objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@PkId", numced); Objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { nombre = Convert.ToString(Lectura[0]); turno = Convert.ToDateTime(Lectura[1]); return; } Objconect.connection.Close(); }
protected void Func_Numerode_Inventario() { { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_VerNumerode_Inventario", objconect.connection); con.CommandType = CommandType.StoredProcedure; objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { ContInventario = Convert.ToString(Lectura[0]); sw = 1; } objconect.connection.Close(); } }
protected void Func_FuncConsultarCuentaGrla() { { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_BuscarCuenta_Gra1", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@cuenta", n_cuenta); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { nombre = Convert.ToString(Lectura[1]); movil = Convert.ToString(Lectura[2]); correo = Convert.ToString(Lectura[3]); sw = 1; } objconect.connection.Close(); } }
//Funcion de ingreso al sistema: FrmLogin protected void Func_IngresoAlSistema() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_IngresoSistema", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@user", id); con.Parameters.AddWithValue("@contraseña", contraseña); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { usuario = Convert.ToString(Lectura[0]); nombre = Convert.ToString(Lectura[1]); foto = Convert.ToString(Lectura[2]); contraseña = Convert.ToString(Lectura[3]); sw = 1; } objconect.connection.Close(); }
protected void FuncCargarRegistroFotografico() { { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_ConsltarRegistroFotografico", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@codigo_Maquina", Codigo); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { ruta1 = Convert.ToString(Lectura[0]); ruta2 = Convert.ToString(Lectura[1]); ruta3 = Convert.ToString(Lectura[2]); ruta4 = Convert.ToString(Lectura[3]); sw = 1; } objconect.connection.Close(); } }
protected void Func_BucarEmpresa() { ClsConexion objconect = new ClsConexion(); SqlCommand con; SqlDataReader Lectura; con = new SqlCommand("SP_BuscarEmpresa", objconect.connection); con.CommandType = CommandType.StoredProcedure; con.Parameters.AddWithValue("@Nit", Nit); objconect.connection.Open(); Lectura = con.ExecuteReader(); if (Lectura.Read() == true) { Nit = Convert.ToString(Lectura[0]); Nombre = Convert.ToString(Lectura[1]); Telefono = Convert.ToString(Lectura[2]); Correo = Convert.ToString(Lectura[3]); Direccion = Convert.ToString(Lectura[4]); sw = 1; } objconect.connection.Close(); }