private void btn_refresh_Click(object sender, EventArgs e) { this.Hide(); Add_detail form3 = new Add_detail(); form3.Closed += (s, args) => this.Close(); form3.Show(); }
private void Comment_btn_Click(object sender, EventArgs e) { AddComment = txt_add_comment.Text.ToString(); //MessageBox.Show(Variable.add_id); //AddDescr = Add_Descr.Text.ToString(); Data_send = "Comment_Insert|" + Variable.gusername + "|" + Variable.add_id + "|" + AddComment; //MessageBox.Show(Data_send); try { clientSocket2.Connect(Variable.ipaddress, 12000); STR_W = new StreamWriter(clientSocket2.GetStream()); STR_R = new StreamReader(clientSocket2.GetStream()); STR_W.AutoFlush = true; if (clientSocket2.Connected) { STR_W.WriteLine(Data_send); string returndata; returndata = STR_R.ReadLine(); if (returndata == "Success") { MessageBox.Show("Your Comment has been submitted for Review"); this.Hide(); Add_detail frm1 = new Add_detail(); frm1.Show(); clientSocket2.Close(); } else { clientSocket2.Close(); MessageBox.Show("Error"); this.Hide(); Add_detail form3 = new Add_detail(); form3.Show(); } } } catch (Exception e1) { MessageBox.Show(e1.ToString()); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { // Retriving data which we need to show to user and on Clicking particular add it will go to next form var item = dataGridView1.Rows[e.RowIndex].Cells[1].Value; // MessageBox.Show(item.ToString()); Variable.add_id = item.ToString(); item = dataGridView1.Rows[e.RowIndex].Cells[3].Value; Variable.add_name = item.ToString(); //MessageBox.Show(item.ToString()); item = dataGridView1.Rows[e.RowIndex].Cells[4].Value; Variable.add_detail = item.ToString(); // MessageBox.Show(item.ToString()); this.Hide(); Add_detail form2 = new Add_detail(); form2.Closed += (s, args) => this.Close(); form2.Show(); }