private void CancelNewBook_Click(object sender, EventArgs e)
        {
            ManagerDashboard nxtForm = new ManagerDashboard();

            nxtForm.Show();
            this.Hide();
        }
 private void ManagerVerification()
 {
     try
     {
         connection CN = new connection();
         CN.thisConnection.Open();
         OracleCommand thisCommand = new OracleCommand();
         thisCommand.Connection  = CN.thisConnection;
         thisCommand.CommandText = "SELECT * From userinfo WHERE id='" + mngrUsername.Text + "' AND password='******'";
         OracleDataReader thisReader = thisCommand.ExecuteReader();
         if (thisReader.Read())
         {
             ManagerDashboard nxtform = new ManagerDashboard();
             nxtform.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("incorect password or username");
         }
         CN.thisConnection.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
        private void ConfirmNewBook_Click(object sender, EventArgs e)
        {
            connection CN2 = new connection();

            CN2.thisConnection.Open();
            OracleDataAdapter    thisAdapter = new OracleDataAdapter("SELECT * FROM bookinfo", CN2.thisConnection);
            OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter);
            DataSet thisDataSet = new DataSet();

            thisAdapter.Fill(thisDataSet, "bookinfo");
            DataRow thisRow = thisDataSet.Tables["bookinfo"].NewRow();

            try
            {
                thisRow["isbn"]           = IsbnOfTheBook.Text;
                thisRow["book_name"]      = NameOfTheBook.Text;
                thisRow["writer_name"]    = NameOfTheWriter.Text;
                thisRow["book_category"]  = CategoryOfTheBook.Text;
                thisRow["entry_date"]     = DateOfEntry.Text;
                thisRow["year_published"] = YearOfPublication.Text;
                thisRow["book_qty"]       = NumberOfBook.Text;
                thisDataSet.Tables["bookinfo"].Rows.Add(thisRow);
                thisAdapter.Update(thisDataSet, "bookinfo");
                MessageBox.Show("A New Book Added");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            CN2.thisConnection.Close();
            ManagerDashboard nxtForm = new ManagerDashboard();

            nxtForm.Show();
            this.Hide();
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();
            OracleCommand thisCommand = sv.thisConnection.CreateCommand();

            thisCommand.CommandText = "update bookinfo set book_qty = '" + NewQty.Text + "'where book_name= '" + BookNameToUpdate.Text + "'";
            thisCommand.Connection  = sv.thisConnection;
            thisCommand.CommandType = CommandType.Text;
            try
            {
                thisCommand.ExecuteNonQuery();
                MessageBox.Show("Quantity Updated");
                //this.Hide();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            sv.thisConnection.Close();
            ManagerDashboard nxtForm = new ManagerDashboard();

            nxtForm.Show();
            this.Hide();
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            ManagerDashboard nxtForm = new ManagerDashboard();

            nxtForm.Show();
            this.Hide();
        }
Beispiel #6
0
        private void FromSearchToDashboard_Click(object sender, EventArgs e)
        {
            ManagerDashboard nxtform = new ManagerDashboard();

            nxtform.Show();
            this.Hide();
        }
        private void ReturnFromViewButton_Click(object sender, EventArgs e)
        {
            ManagerDashboard nxtForm = new ManagerDashboard();

            nxtForm.Show();
            this.Hide();
        }
        private void ConfirmRemovingBook_Click(object sender, EventArgs e)
        {
            connection CN = new connection();

            CN.thisConnection.Open();
            OracleCommand thisCommand1 = CN.thisConnection.CreateCommand();

            thisCommand1.CommandText = "delete bookinfo where book_name= '" + BookNameToRemove.Text + "'";
            thisCommand1.Connection  = CN.thisConnection;
            thisCommand1.CommandType = CommandType.Text;
            try
            {
                thisCommand1.ExecuteNonQuery();
                MessageBox.Show("Book Removed");
                ManagerDashboard nxtform = new ManagerDashboard();
                nxtform.Show();
                this.Hide();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }