private void AddButton_Click(object sender, EventArgs e)
        {
            if (IDTextField.Text != "" && NameTextField.Text != "")
            {
                using (SqlCommand cmd = new SqlCommand("addBank", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@id", IDTextField.Text);
                    cmd.Parameters.AddWithValue("@name", NameTextField.Text);
                    cmd.Parameters.AddWithValue("@address", AddressTextField.Text);

                    con.Open();
                    try
                    {
                        cmd.ExecuteNonQuery();
                        StatusLabel.Text = "Successfully added";
                        StatusLabel.Show();
                        IDTextField.Text      = "";
                        NameTextField.Text    = "";
                        AddressTextField.Text = "";
                    }
                    catch (Exception x)
                    {
                        StatusLabel.Text = "Error!";
                        StatusLabel.Show();
                        MessageBox.Show("" + x);
                    }
                    con.Close();
                    bankDatagridview();
                }
            }
        }
Exemplo n.º 2
0
 private void endInstallation(string reason, bool failed)
 {
     InstallProgress.Value = 100;
     BetaRadio.Hide();
     InstallButton.Hide();
     UninstallButton.Hide();
     UpdateButton.Hide();
     ReinjectButton.Hide();
     StatusText.Hide();
     StatusLabel.Show();
     StatusLabel.Text      = operation == "UPDATE" ? "Update " + (failed ? "failed" : "complete") : (operation == "UNINSTALL" ? "Unin" : "In") + "stallation " + (failed ? " failed." : "completed!");
     StatusLabel.ForeColor = failed ? Color.Red : Color.Lime;
     StatusLabel2.Show();
     StatusLabel2.Text = reason;
     StatusCloseButton.Show();
     if (platform != "Linux")
     {
         OpenFolderButton.Show();
     }
 }
Exemplo n.º 3
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            if (AccNoTextField.Text != "" && TypeTextField.Text != "" && BalTextField.Text != "" && Br_idtextfield.Text != "" && cust_idtextfield.Text != "")
            {
                using (SqlCommand cmd = new SqlCommand("addAccount", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@accNo", AccNoTextField.Text);
                    cmd.Parameters.AddWithValue("@type", TypeTextField.Text);
                    cmd.Parameters.AddWithValue("@bal", BalTextField.Text);
                    cmd.Parameters.AddWithValue("@br_id", Br_idtextfield.Text);
                    cmd.Parameters.AddWithValue("@cid", cust_idtextfield.Text);

                    con.Open();
                    try
                    {
                        cmd.ExecuteNonQuery();
                        StatusLabel.Text = "Successfully added";
                        StatusLabel.Show();
                        AccNoTextField.Text   = "";
                        TypeTextField.Text    = "";
                        BalTextField.Text     = "";
                        cust_idtextfield.Text = "";
                        Br_idtextfield.Text   = "";
                    }
                    catch (Exception x)
                    {
                        StatusLabel.Text = "Error!";
                        StatusLabel.Show();
                        MessageBox.Show("" + x);
                    }
                    con.Close();
                    accountDatagridview();
                }
            }
            else
            {
                MessageBox.Show("Values cannot be empty!");
            }
        }
        private void AddButton_Click(object sender, EventArgs e)
        {
            if (CustIDTextField.Text != "" && CustNameTextField.Text != "" && AddressTextField.Text != "")
            {
                using (SqlCommand cmd = new SqlCommand("addCust", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@cid", CustIDTextField.Text);
                    cmd.Parameters.AddWithValue("@name", CustNameTextField.Text);
                    cmd.Parameters.AddWithValue("@phone", PhoneTextField.Text);
                    cmd.Parameters.AddWithValue("@address", AddressTextField.Text);

                    con.Open();
                    try
                    {
                        cmd.ExecuteNonQuery();
                        StatusLabel.Text = "Successfully Added";
                        StatusLabel.Show();
                        CustIDTextField.Text   = "";
                        CustNameTextField.Text = "";
                        PhoneTextField.Text    = "";
                        AddressTextField.Text  = "";
                    }
                    catch (Exception x)
                    {
                        StatusLabel.Text = "Error!";
                        StatusLabel.Show();
                        MessageBox.Show("" + x);
                    }
                    con.Close();
                    customerDatagridview();
                }
            }
            else
            {
                MessageBox.Show("Value is empty!");
            }
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            using (SqlCommand cmd = new SqlCommand("deleteCustomer", con))
            {
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@cid", SearchCustIDTextField.Text);

                con.Open();
                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (Exception x)
                {
                    StatusLabel.Text = "Error!";
                    StatusLabel.Show();
                    MessageBox.Show("" + x);
                }
                con.Close();
                customerDatagridview();
            }
        }
        private void AddButton_Click(object sender, EventArgs e)
        {
            if (LoanNoTextField.Text != "" && AmtTextField.Text != "" && BranchNoTextfield.Text != "" && TypeTextField.Text != "" && CustIdTextField.Text != "")
            {
                using (SqlCommand cmd = new SqlCommand("addLoan", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@lid", LoanNoTextField.Text);
                    cmd.Parameters.AddWithValue("@amt", AmtTextField.Text);
                    cmd.Parameters.AddWithValue("@bid", BranchNoTextfield.Text);
                    cmd.Parameters.AddWithValue("@type", TypeTextField.Text);
                    cmd.Parameters.AddWithValue("@cid", CustIdTextField.Text);

                    con.Open();
                    try
                    {
                        cmd.ExecuteNonQuery();
                        StatusLabel.Text = "Successfully added";
                        StatusLabel.Show();
                        LoanNoTextField.Text   = "";
                        AmtTextField.Text      = "";
                        BranchNoTextfield.Text = "";
                        TypeTextField.Text     = "";
                        CustIdTextField.Text   = "";
                    }
                    catch (Exception x)
                    {
                        StatusLabel.Text = "Error!";
                        StatusLabel.Show();
                        MessageBox.Show("" + x);
                    }
                    con.Close();
                    loanDatagridview();
                }
            }
        }
Exemplo n.º 7
0
 private void button1_MouseHover(object sender, EventArgs e)
 {
     StatusLabel.Text = "Log-In for Airport's Employees";
     StatusLabel.Show();
 }
Exemplo n.º 8
0
 private void button3_MouseHover(object sender, EventArgs e)
 {
     StatusLabel.Text = "Log-In for Government Employees";
     StatusLabel.Show();
 }
Exemplo n.º 9
0
 private void button4_MouseHover(object sender, EventArgs e)
 {
     StatusLabel.Text = "Check your Booking or Search for Flights";
     StatusLabel.Show();
 }