示例#1
0
        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;
            }
        }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
        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;
            }
        }
示例#5
0
        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();
            }
        }
示例#6
0
        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;
            }
        }
示例#7
0
        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();
            }
        }
示例#8
0
        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;
            }
        }
示例#9
0
        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;
            }
        }
示例#10
0
        public void SP_FrmRegistrarVinculo_Vincular()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con;

            con             = new SqlCommand("SP_FrmRegistrarVinculo_Vincular", objconect.connection);
            con.CommandType = CommandType.StoredProcedure;
            con.Parameters.AddWithValue("@Documento", Documento);
            con.Parameters.AddWithValue("@RFID", RFID);
            con.Connection.Open();
            con.ExecuteNonQuery();
            con.Connection.Close();
        }
示例#11
0
        public void SP_FrmRegistrarVinculo_ActualizarContraseña()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con; SqlDataReader Lectura;

            con             = new SqlCommand("SP_FrmRegistrarVinculo_ActualizarContraseña", objconect.connection);
            con.CommandType = CommandType.StoredProcedure;
            con.Parameters.AddWithValue("@RFID", RFID);
            con.Parameters.AddWithValue("@Contraseña", Contraseña);
            con.Connection.Open();
            con.ExecuteNonQuery();
            Lectura = con.ExecuteReader();
            con.Connection.Close();
        }
示例#12
0
        public void SP_FrmRecargas_RecargarSaldo()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con; SqlDataReader Lectura;

            con             = new SqlCommand("SP_FrmRecargas_RecargarSaldo", objconect.connection);
            con.CommandType = CommandType.StoredProcedure;
            con.Parameters.AddWithValue("@Codigo", RFID);
            con.Parameters.AddWithValue("@Saldo", Saldo);
            con.Connection.Open();
            con.ExecuteNonQuery();
            Lectura = con.ExecuteReader();
            con.Connection.Close();
        }
示例#13
0
        public void SP_FrmProductos_Actualizar()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con; SqlDataReader Lectura;

            con             = new SqlCommand("SP_FrmProductos_Actualizar", objconect.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();
            Lectura = con.ExecuteReader();
            con.Connection.Close();
        }
示例#14
0
        public void SP_FrmEmpleados_ActualizarEmpleados()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con; SqlDataReader Lectura;

            con             = new SqlCommand("SP_FrmEmpleados_ActualizarEmpleados", objconect.connection);
            con.CommandType = CommandType.StoredProcedure;
            con.Parameters.AddWithValue("@Documento", Documento);
            con.Parameters.AddWithValue("@Nombre", Nombre);
            con.Parameters.AddWithValue("@Correo", Correo);
            con.Parameters.AddWithValue("@Telefono", Telefono);
            con.Connection.Open();
            con.ExecuteNonQuery();
            Lectura = con.ExecuteReader();
            con.Connection.Close();
        }
示例#15
0
        public void SP_FrmRegistrarVinculo_ActualizarPersona()
        {
            CLConexion objconect = new CLConexion();
            SqlCommand con; SqlDataReader Lectura;

            con             = new SqlCommand("SP_FrmRegistrarVinculo_ActualizarPersona", objconect.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();
            Lectura = con.ExecuteReader();
            con.Connection.Close();
        }