private void btn_exit_Click(object sender, EventArgs e)
 {
     adminDefault admin = new adminDefault(label6.Text);
     this.Close();
     this.Dispose();
     admin.ShowDialog();
 }
예제 #2
0
        private void btn_exit_Click(object sender, EventArgs e)
        {
            adminDefault admin = new adminDefault(lbl_text.Text);

            this.Hide();
            admin.ShowDialog();
        }
예제 #3
0
        private void btn_remove_Click(object sender, EventArgs e)
        {
            adminDefault admin = new adminDefault(lbl_text.Text);

            BusinessLayer.BAL bl = new BAL();
            int result           = 0;

            result = bl.RemoveBook(rem_cmb.SelectedValue.ToString(), Convert.ToInt32(rem_qntrem.Text));
            if (result > 0)
            {
                MessageBox.Show("Selected Quantity Removed");
                this.Hide();
                admin.ShowDialog();
            }
            else if (result == 0)
            {
                MessageBox.Show("Books Removed");
                this.Hide();
                admin.ShowDialog();
            }
            else
            {
                MessageBox.Show("Quantity is more than available");
            }
        }
예제 #4
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     if (add_book.Text == "" || add_author.Text == "" || add_price.Text == "" || add_qnt.Text == "")
     {
         MessageBox.Show("Please Enter all Details Properly");
     }
     else
     {
         Login             log = new Login();
         BusinessLayer.BAL bl  = new BAL();
         int result            = 0;
         result = bl.AddBook(add_book.Text, Convert.ToInt32(add_cmb.SelectedValue), Convert.ToDecimal(add_price.Text), add_qnt.Text, add_author.Text);
         if (result > 0)
         {
             MessageBox.Show("Book Added Successfully");
             adminDefault admin = new adminDefault(lbl_text.Text);
             this.Hide();
             admin.ShowDialog();
         }
         else
         {
             MessageBox.Show("Book Already Present");
         }
     }
 }
예제 #5
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            BusinessLayer.BAL bl = new BAL();
            int result           = 0;

            result = bl.Validate_login(txt_uname.Text, txt_pwd.Text);
            if (result > 0)
            {
                adminDefault admin = new adminDefault(txt_uname.Text);
                admin.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username/Password does not match");
            }
        }
 private void btn_return_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedValue == null)
     {
         MessageBox.Show("Please select any book to return");
     }
     else
     {
         BusinessLayer.BAL bl = new BAL();
         int result           = 0;
         result = bl.ReturnBook(comboBox1.SelectedValue.ToString(), label3.Text);
         if (result == 1)
         {
             MessageBox.Show("Book Return Successfully");
             adminDefault admin = new adminDefault(label3.Text);
             this.Close();
             this.Dispose();
             admin.ShowDialog();
         }
         else if (result == 0)
         {
             MessageBox.Show("This Book is not Issued To User");
             adminDefault admin = new adminDefault(label3.Text);
             this.Close();
             this.Dispose();
             admin.ShowDialog();
         }
         else
         {
             MessageBox.Show("Try After Sometime.");
             adminDefault admin = new adminDefault(label3.Text);
             this.Close();
             this.Dispose();
             admin.ShowDialog();
         }
     }
 }