private void metroButton4_Click(object sender, EventArgs e) { access_data d = new access_data(); string tag_name = ""; if (metroTextBox2.Text.Contains("//")) { tag_name = metroTextBox2.Text; } else { tag_name = "//" + metroTextBox2.Text; } string tag_value = metroTextBox3.Text; if (tag_name == "" && tag_value == "") { MetroMessageBox.Show(this, "please insert tag name and tag value first", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (d.CheckDataAvailableOrNot(tag_name, tag_value) == true) { MetroMessageBox.Show(this, "Tag name andd value is already available", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (d.InsertNew_site_details(UrlId, tag_name, tag_value) == true) { MetroMessageBox.Show(this, "Data successfully inserted", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Information); metroTextBox2.Text = metroTextBox3.Text = ""; } } metroGrid2.DataSource = d.ReturnWebTagListAndName(UrlId); }
private void deleteRecordToolStripMenuItem_Click(object sender, EventArgs e) { access_data d = new access_data(); if (d.DeleteRow(delete_id) == true) { MetroMessageBox.Show(this, "Information successfully deleted", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Information); } metroGrid2.DataSource = d.ReturnWebTagListAndName(UrlId); }
private void metroGrid1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (metroGrid1.Rows.Count >= 1) { metroTextBox1.Enabled = metroTextBox2.Enabled = metroTextBox3.Enabled = textBox1.Enabled = true; metroButton2.Enabled = metroButton4.Enabled = metroButton5.Enabled = true; metroGrid2.Enabled = true; DataGridViewRow selectedrow = null; if (metroGrid1.SelectedRows.Count > 0) { selectedrow = metroGrid1.SelectedRows[0]; } if (selectedrow == null) { return; } string x = selectedrow.Cells["URL"].Value.ToString(); if (x == "") { return; } else { metroTextBox2.Text = ""; metroTextBox3.Text = ""; access_data d = new access_data(); d.get_info_by_url(x); UrlId = d.GetIdByUsingUrl(x); metroTextBox1.Text = d.a; textBox1.Text = d.dd; metroGrid2.DataSource = d.ReturnWebTagListAndName(UrlId); aa = 0; } } }
private void metroButton5_Click(object sender, EventArgs e) { access_data d = new access_data(); string tag_name = ""; if (metroTextBox2.Text.Contains("//")) { tag_name = metroTextBox2.Text; } else { tag_name = "//" + metroTextBox2.Text; } string tag_value = metroTextBox3.Text; if (tag_name == "" && tag_value == "") { MetroMessageBox.Show(this, "please Select something from below table", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (EditTagNameAndTagValue == 0) { MetroMessageBox.Show(this, "please edit tag name or value first", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (d.Update_site_details(id, tag_name, metroTextBox3.Text) == true) { MetroMessageBox.Show(this, "Information successfully updated", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Information); metroTextBox2.Text = metroTextBox3.Text = ""; } } } metroGrid2.DataSource = d.ReturnWebTagListAndName(UrlId); }