private void newaddlink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) // On click jumping to New add if user wants to post new add
        {
            this.Hide();
            PostNewAddHere frm3 = new PostNewAddHere();

            frm3.Closed += (s, args) => this.Close();
            frm3.Show();
        }
Example #2
0
        private void post_add_Click(object sender, EventArgs e)
        {
            Add = add_text.Text.ToString();
            //MessageBox.Show(Add);
            AddDescr  = Add_Descr.Text.ToString();
            Data_send = "Add_Insert|" + Variable.gusername + "|" + Add + "|" + AddDescr;
            //MessageBox.Show(Data_send);
            try
            {
                clientSocket.Connect(Variable.ipaddress, Variable.port);
                STR_W           = new StreamWriter(clientSocket.GetStream());
                STR_R           = new StreamReader(clientSocket.GetStream());
                STR_W.AutoFlush = true;
                if (clientSocket.Connected)
                {
                    STR_W.WriteLine(Data_send);
                    string returndata; returndata = STR_R.ReadLine();

                    if (returndata == "Success")
                    {
                        //          MessageBox.Show("Your add has been Posted for Review");
                        this.Hide();
                        UserHome frm1 = new UserHome();
                        frm1.Show();
                        clientSocket.Close();
                    }
                    else
                    {
                        clientSocket.Close();
                        this.Hide();
                        PostNewAddHere form3 = new PostNewAddHere();
                        form3.Show();
                    }
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.ToString());
            }
        }