Beispiel #1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            retriveOrDelete rd = new retriveOrDelete();

            this.Hide();
            rd.Show();
        }
Beispiel #2
0
        private void Label2_Click(object sender, EventArgs e)
        {
            if (textBox1.TextLength == 0)
            {
                MessageBox.Show("ENTER AMMOUNT");
                textBox1.Focus();
            }
            else
            {
                SqlConnection con = new SqlConnection("Data Source=LAPTOP-3CMESOM3;Initial Catalog=DisasterManagement;Integrated Security=True;Pooling=False");


                SqlCommand cmd = new SqlCommand("deleteData", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@SSN", Convert.ToInt32(ssnText.Text));
                con.Open();
                try
                {
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("AMOUNT SANCTIONED");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("error occured " + ex);
                }
                con.Close();



                SqlCommand cmd1 = new SqlCommand("insertSanctionedAmount", con);
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@SSN", Convert.ToInt32(ssnText.Text));
                cmd1.Parameters.AddWithValue("@sanctionedAmount", Convert.ToInt32(textBox1.Text));
                con.Open();
                try
                {
                    cmd1.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("error occured " + ex);
                }
                con.Close();



                retriveOrDelete rd = new retriveOrDelete();
                this.Hide();
                rd.Show();
            }
        }
Beispiel #3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            String Aname = getAdminName(),
                   Apass = getAdminPassword(), name, pass;

            name = textBox1.Text;
            pass = textBox2.Text;

            if (name.Equals(Aname) && pass.Equals(Apass))
            {
                retriveOrDelete rd = new retriveOrDelete();
                this.Hide();
                rd.Show();
            }
            else
            {
                label4.Show();
            }
        }
        private void Button2_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=LAPTOP-3CMESOM3;Initial Catalog=DisasterManagement;Integrated Security=True;Pooling=False");

            SqlCommand cmd = new SqlCommand("clearData", con);

            con.Open();
            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(" INVALID OPERATION : " + ex);
            }
            con.Close();


            retriveOrDelete rd = new retriveOrDelete();

            this.Hide();
            rd.Show();
        }