コード例 #1
0
ファイル: Main.cs プロジェクト: nayan2/Web-Site-Hack-Notifyer
        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);
        }