Exemplo n.º 1
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);
        }