Beispiel #1
0
        private async void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "")
            {
                string send_msg;
                send_msg  = "login ";
                send_msg += ip + " " + textBox1.Text + " " + textBox2.Text + " ";
                send_msg  = await ClientSoket.SendData(send_msg);

                if (send_msg == "login")
                {
                    textBox1.Visible  = false;
                    textBox2.Visible  = false;
                    button1.Visible   = false;
                    listView1.Visible = true;
                    listView2.Visible = true;
                    button2.Visible   = true;
                    button3.Visible   = true;
                    //MessageBox.Show("Logare efectuata cu succes!");
                    try
                    {
                        bool        x   = true;
                        LoginDenial log = new LoginDenial(x);
                        log.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                    }

                    FillListView1(await ClientSoket.SendData("users " + ip + " "));
                    FillListView2(await ClientSoket.SendData("books " + ip + " "));
                }
                else
                {
                    try
                    {
                        bool        x   = false;
                        LoginDenial log = new LoginDenial(x);
                        log.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            else
            {
                MessageBox.Show("Va rog sa introduceti credentialele!");
            }
        }
Beispiel #2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            if (SelectedUser != "")
            {
                SynchronousSocketClient ClientSoket = new SynchronousSocketClient();
                string data = await ClientSoket.SendData("return " + ip + " " + titlu + " | " + SelectedUser + " ");

                listView1.Clear();
                data = await ClientSoket.SendData("user " + ip + " " + titlu + " ");

                FillListView1(data);
            }
            else
            {
                MessageBox.Show("Nu a fost selectat nici un user!");
            }
        }
Beispiel #3
0
        private async void button2_Click(object sender, EventArgs e)
        {
            try
            {
                SynchronousSocketClient sok = new SynchronousSocketClient();
                string receive = await sok.SendData("loan " + ip + " " + user + " | " + book + " ");

                MessageBox.Show(receive);
                this.Close();
            }
            catch (Exception ex)
            {
            }
        }