예제 #1
0
        private void upGen()
        {
            sqLite = new SQLiteConnection(dbConString);


            if (MessageBox.Show("Update Selected Column?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
            {
                MessageBox.Show("Updation Process Canceled");
            }

            else
            {
                try
                {
                    sqLite.Open();

                    SQLiteCommand createCommand = new SQLiteCommand(Query, sqLite);
                    createCommand.ExecuteNonQuery();
                    MessageBox.Show("Record Updated");
                }

                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }

                finally
                {
                    ShowEvents sh = new ShowEvents();
                    sqLite.Close();
                    this.Hide();
                    sh.Show();
                }
            }
        }
예제 #2
0
        private void showEvent_Click(object sender, RoutedEventArgs e)
        {
            ShowEvents sh = new ShowEvents();

            this.Hide();
            sh.Show();
        }
예제 #3
0
        private void subButton_Click(object sender, RoutedEventArgs e)
        {
            sqLite = new SQLiteConnection(dbConString);

            if (prizeBox.Text.Equals(null) || nameBox.Text.Equals(null) || courseBox.Equals(null) || rollBox.Equals(null) || semBox.Equals(null) || collBox.Equals(null))
            {
                MessageBox.Show("Fill all the details");
            }

            else
            {
                if (MessageBox.Show("Update Prize?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    MessageBox.Show("Updation Process Canceled");
                }

                else
                {
                    apTable = selectedTable + "_approval";

                    try
                    {
                        sqLite.Open();
                        Query = "UPDATE '" + selectedTable + "' SET Prize = '" + prizeBox.Text + "' WHERE EID='" + this.SBox.Text + "' OR NAME = '" + this.SBox.Text + "'";
                        SQLiteCommand createCommand = new SQLiteCommand(Query, sqLite);
                        createCommand.ExecuteNonQuery();

                        Query         = "UPDATE '" + apTable + "' SET Prize = '" + prizeBox.Text + "' WHERE EID='" + this.SBox.Text + "' OR NAME = '" + this.SBox.Text + "'";
                        createCommand = new SQLiteCommand(Query, sqLite);
                        createCommand.ExecuteNonQuery();

                        MessageBox.Show("Record Updated");
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message);
                    }

                    finally
                    {
                        ShowEvents sh = new ShowEvents();
                        sqLite.Close();
                        this.Hide();
                        sh.Show();
                    }
                }
            }
        }