コード例 #1
0
ファイル: Main.cs プロジェクト: nayan2/Web-Site-Hack-Notifyer
        private void metroButton2_Click(object sender, EventArgs e)
        {
            if (metroTextBox1.Text == "")
            {
                CheckEmpty();
            }
            else
            {
                if (aa == 0)
                {
                    MetroMessageBox.Show(this, "please edit text first from [url or tag name or tag value or description]", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    site n = new site();

                    n.url         = metroTextBox1.Text;
                    n.description = textBox1.Text;
                    access_data ad = new access_data();



                    DialogResult ff = MetroMessageBox.Show(this, "Are you really wants to change the information?", "WSH notify", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                    if (ff == DialogResult.OK)
                    {
                        if (ad.Edit_web_info(n, UrlId) == true)
                        {
                            MetroMessageBox.Show(this, "information successfully update", "WSH notify", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            access_data addd = new access_data();
                            metroGrid1.DataSource = addd.ReturnWebSiteUrl();
                        }
                        else
                        {
                            DialogResult dd = MetroMessageBox.Show(this, "something went wrong!", "WSH notify", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);

                            if (dd == DialogResult.Cancel)
                            {
                                Application.Exit();
                            }
                        }
                    }
                }
            }
        }