Пример #1
0
        private void TBuscarI_TextChanged(object sender, EventArgs e)
        {
            BPanel.Controls.Clear();
            BPanel.BringToFront();
            y = 6;
            var tamanio = 0;

            BPanel.Height = tamanio;
            if (TBuscarI.Text != "" && TBuscarI.Text != "Buscar")
            {
                BPanel.Visible = false;
                var proxy = new ProxyInstagram();
                var lista = proxy.Buscar(name, TBuscarI.Text);
                foreach (var item in lista)
                {
                    var perfil = new ConstructorPerfilBusqueda(BPanel, 0, y, PerfilUsuario, item).CrearObjeto();
                    perfil.crearPanel();
                    tamanio += perfil.obtenerPanel().Height;
                    if (tamanio < 220)
                    {
                        BPanel.Height = tamanio + 8;
                    }
                    BPanel.Controls.Add(perfil.obtenerPanel());
                    y += 44;
                }
                BPanel.Visible = true;
            }
            else
            {
                BPanel.Visible = false;
            }
        }
Пример #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            if (TCorreo.Text == "")
            {
                TCorreo.Text = "*"; Error = true;
            }
            if (TNombreC.Text == "")
            {
                TNombreC.Text = "*"; Error = true;
            }
            if (TContra.Text == "")
            {
                TContra.Text = ""; Error = true;
            }
            if (TNombreU.Text == "")
            {
                TNombreU.Text = "*"; Error = true;
            }
            if (Error)
            {
                TContra.Text = "";
                Error        = false;
                return;
            }
            // Nombre de Usuario en DB disponible
            var proxy = new ProxyInstagram();
            var res   = proxy.Registro(TNombreU.Text, TNombreC.Text, TCorreo.Text, TContra.Text);

            //
            if (res)
            {
                string name = TNombreU.Text;
                this.Hide();
                Form inicio = new Inicio(name);
                inicio.StartPosition = FormStartPosition.Manual;
                inicio.Location      = this.Location;
                inicio.ShowDialog();
                this.Close();
            }
            else
            {
                Label label = new Label();
                label.Text      = "usuario/correo ya registrados";
                label.ForeColor = Color.Red;
                Respuesta.Controls.Add(label);
                label.Width    = Respuesta.Width - 50;
                label.Location = new Point(30, 0);
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TCorreo.Text == "")
            {
                TCorreo.Text = "*"; Error = true;
            }
            if (TContra.Text == "")
            {
                TContra.Text = ""; Error = true;
            }
            if (Error)
            {
                TContra.Text = "";
                Error        = false;
                return;
            }
            //
            var proxy = new ProxyInstagram();
            var res   = proxy.LogIn(TCorreo.Text, TCorreo.Text, TContra.Text);

            if (res)
            {
                // Revisar usuario/contraseña en DB
                string name = TCorreo.Text;
                this.Hide();
                Form inicio = new Inicio(name);
                inicio.StartPosition = FormStartPosition.Manual;
                inicio.Location      = this.Location;
                inicio.ShowDialog();
                this.Close();
            }
            else
            {
                Label label = new Label();
                label.Text      = "usuario/contraseña incorrecta";
                label.ForeColor = Color.Red;
                Respuesta.Controls.Add(label);
                label.Width    = Respuesta.Width - 50;
                label.Location = new Point(60, 0);
            }
        }
Пример #4
0
        public Inicio(string data)
        {
            string url = Directory.GetCurrentDirectory();

            for (int i = 0; i < url.Length - 9; i++)
            {
                newURL += url[i];
            }
            proxy = new ProxyInstagram();
            var res = proxy.GetUser(data);

            name = res.user; // DB User

            InitializeComponent();
            TopPanel.SendToBack();
            button2.FlatAppearance.BorderSize = 0;
            button3.FlatAppearance.BorderSize = 0;
            button4.FlatAppearance.BorderSize = 0;
            ConfigPanel.Visible   = false;
            PostsPanel.AutoScroll = true;
            StoryPanel.AutoScroll = true;
            this.ActiveControl    = PostsPanel;

            BPanel.BringToFront();
            BPanel.AutoScroll  = true;
            BPanel.Visible     = false;
            BPanel.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(BPanel);

            ConfigPanel.BorderStyle = BorderStyle.FixedSingle;

            NombreUsuario.Text  = res.user;
            NombreCompleto.Text = res.nombre;

            var   urlimage = newURL + res.foto;
            Image image    = Image.FromFile(urlimage);

            ImagenPerfil.Image  = image;
            ImagenPerfil.Width  = 44;
            ImagenPerfil.Height = 44;

            //Cargar Feed DB
            var insta = proxy.GetFeed(res.user);

            foreach (Post item in insta.publico)
            {
                var post = new ConstructorPosts(PostsPanel, 0, y, PerfilUsuario, item, name, UpdatePosts, this).CrearObjeto();
                post.crearPanel();
                PostsPanel.Controls.Add(post.obtenerPanel());
                y += post.obtenerPanel().Height + 20;
            }

            // My Stories
            if (insta.stories.stories.Count > 0)
            {
                var Mystory = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, insta.stories, res.user, UpdateStories).CrearObjeto();
                Mystory.crearPanel();
                StoryPanel.Controls.Add(Mystory.obtenerPanel());
                y2 += StoryPanel.Height / 6 + 10;
            }
            //

            foreach (Stories item in insta.publicStories)
            {
                var story = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, item, res.user, UpdateStories).CrearObjeto();
                story.crearPanel();
                StoryPanel.Controls.Add(story.obtenerPanel());
                y2 += StoryPanel.Height / 6 + 10;
            }
        }