Exemple #1
0
 public channel(string ids, userData us, bool active, mainFORM mn)
 {
     InitializeComponent();
     id          = ids;
     this.active = active;
     user        = us;
     this.mn     = mn;
 }
        public watchvideo(userData usr, string linkas, bool actv, mainFORM mainform)
        {
            InitializeComponent();

            user          = usr;
            link          = linkas;
            active        = actv;
            this.mainform = mainform;
        }
Exemple #3
0
        private void label10_Click(object sender, EventArgs e)
        {
            string sqlText    = "select count(id) from logins where UserName='******';";
            var    connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }
            if ((long)DBFunctions.ExecuteSqlScalar(sqlText, connection) == 0)
            {
                MessageBox.Show("User does not exist");
                return;
            }

            sqlText = string.Format("select id,username,password,email,ChannelColour,subscribers from logins where Username='******' and Password='******';", textBox1.Text, PasswordClass.GetMD5hash(textBox2.Text));
            var reader = DBFunctions.ExecuteSqlSelect(sqlText, connection);

            if (reader == null)
            {
                return;
            }
            if (!reader.HasRows)
            {
                MessageBox.Show("Wrong password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            userData user = new userData();

            while (reader.Read())
            {
                user.user_ID          = (ulong)reader[0];
                user.user_username    = reader[1].ToString();
                user.user_password    = reader[2].ToString();
                user.user_email       = reader[3].ToString();
                user.user_colour      = reader[4].ToString();
                user.user_subscribers = reader[5].ToString();
            }
            reader.Close();
            reader.Dispose();
            connection.Close();
            connection.Dispose();
            //open main form
            prnt.loaduser(user);

            prnt.label2.Visible = false;

            prnt.panel2.Visible = true;

            prnt.label12.Text = user.user_username;
            Color red = Color.FromName(user.user_colour);

            prnt.label6.BackColor = red;
            prnt.active           = true;

            if (prnt.Controls.ContainsKey("hmw"))
            {
                prnt.Controls.RemoveByKey("hmw");
                prnt.loadtrends();
            }
            if (prnt.Controls.ContainsKey("wthvid"))
            {
                prnt.loadtrends();
            }

            this.Close();
        }
 public uploadvideo(userData curuser)
 {
     InitializeComponent();
     user = curuser;
 }
Exemple #5
0
 public void loaduser(userData user)
 {
     this.user = user;
 }