示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string A, B;

            A = textBox1.Text;
            B = textBox2.Text;
            Trazilica T = new Trazilica();
            Korisnik  a = new Korisnik();


            StreamReader sr = new StreamReader("USERS.txt");
            string       linija;
            bool         kraj = false;

            while (!kraj)
            {
                linija = sr.ReadLine();
                if (linija == null)
                {
                    kraj = true;
                }
                else
                {
                    string[] razlomljenalinija = linija.Split('|');
                    {
                        if (razlomljenalinija[2] == textBox1.Text && razlomljenalinija[3] == textBox2.Text)
                        {
                            a.Krediti  = int.Parse(razlomljenalinija[4]);
                            a.Ime      = razlomljenalinija[0];
                            a.Prezime  = razlomljenalinija[1];
                            a.Username = razlomljenalinija[2];
                            a.Lozinka  = razlomljenalinija[3];

                            T.label6.Text = a.Username;

                            T.label7.Text      = a.Lozinka;
                            T.label7.BackColor = System.Drawing.Color.Transparent;
                            T.label7.ForeColor = System.Drawing.Color.Transparent;

                            T.label9.Text = a.Krediti.ToString();

                            T.label10.Text      = a.Ime;
                            T.label10.BackColor = System.Drawing.Color.Transparent;
                            T.label10.ForeColor = System.Drawing.Color.Transparent;


                            T.label11.Text      = a.Prezime;
                            T.label11.ForeColor = System.Drawing.Color.Transparent;
                            T.label11.BackColor = System.Drawing.Color.Transparent;


                            this.Hide();
                            T.Show();
                            MessageBox.Show("Molimo Vas da se odjavite na 'Log out' u lijevom donjem kutu kada zavrsite s programom!");
                        }
                    }
                }
            }
        }
        private void Form4_Load(object sender, EventArgs e)
        {
            Trazilica T = new Trazilica();

            label6.Text = T.label6.Text;
            label7.Text = T.label7.Text;
            label3.Text = T.label9.Text;
        }
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Trazilica T = new Trazilica();

            T.label9.Text  = label9.Text;
            T.label10.Text = ime.Text;
            T.label11.Text = prezime.Text;
            T.label7.Text  = lozinka.Text;
            T.label6.Text  = username.Text;
            T.label9.Text  = label9.Text;
            T.Show();
            this.Hide();
        }
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Trazilica T = new Trazilica();

            T.Show();

            T.label10.Text      = lblime.Text;
            T.label10.ForeColor = System.Drawing.Color.Transparent;
            T.label10.BackColor = System.Drawing.Color.Transparent;

            T.label11.Text      = lblprezime.Text;
            T.label11.ForeColor = System.Drawing.Color.Transparent;
            T.label11.BackColor = System.Drawing.Color.Transparent;

            T.label6.Text      = label6.Text;
            T.label9.Text      = label3.Text;
            T.label7.Text      = label7.Text;
            T.label7.ForeColor = System.Drawing.Color.Transparent;
            T.label7.BackColor = System.Drawing.Color.Transparent;


            this.Close();
        }
示例#5
0
        private void button2_Click(object sender, EventArgs e)
        {
            Trazilica T = new Trazilica();
            Korisnik  a = new Korisnik();

            a.Ime      = textBox4.Text;
            a.Prezime  = textBox3.Text;
            a.Lozinka  = textBox2.Text;
            a.Username = textBox1.Text;
            a.Krediti  = 100;

            T.label6.Text = a.Username;


            T.label7.Text      = a.Lozinka;
            T.label7.BackColor = System.Drawing.Color.Transparent;
            T.label7.ForeColor = System.Drawing.Color.Transparent;

            T.label9.Text       = a.Krediti.ToString();
            T.label10.Text      = a.Ime;
            T.label10.BackColor = System.Drawing.Color.Transparent;
            T.label10.ForeColor = System.Drawing.Color.Transparent;

            T.label11.Text      = a.Prezime;
            T.label11.BackColor = System.Drawing.Color.Transparent;
            T.label11.ForeColor = System.Drawing.Color.Transparent;


            Admin.UnosKorisnika(a.Ime, a.Prezime, a.Username, a.Lozinka, a.Krediti);



            this.Hide();
            T.Show();
            MessageBox.Show("Molimo Vas da se odjavite na 'Log out' u lijevom donjem kutu kada zavrsite s programom!");
        }