Ejemplo n.º 1
0
 private void button6_Click(object sender, EventArgs e)//method is used for delete customer
 {
     Video_Rental_Gurmukh_Static_Functions.Delete_Customer(lblCustomer.Text);
     MessageBox.Show("Customer Deleted");
     //Dispose();
     GetCustomers();
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)//add moovie
        {
            int a, b;

            if (txtMovieName.Text == "" || textPoints.Text == "" || textYear.Text == "" || textCopies.Text == "" || textReleased.Text == "")
            {
                MessageBox.Show("All fields are required");
            }
            else if (!int.TryParse(textYear.Text, out a) || !(int.TryParse(textCopies.Text, out b)))
            {
                MessageBox.Show("Year and Copies must be a valid integer");
            }
            else
            {
                int rental = 0;
                if ((DateTime.Now.Year - a) > 5)
                {
                    rental = 2;
                }
                else
                {
                    rental = 5;
                }

                Video_Rental_Gurmukh_Static_Functions.Add_Movie(txtMovieName.Text, textPoints.Text, Convert.ToInt32(textYear.Text), Convert.ToInt32(textCopies.Text), textReleased.Text, rental);
                MessageBox.Show("New Movie Added");
            }
            GetMovies();
        }
Ejemplo n.º 3
0
        private void btnVideoUpdate_Click(object sender, EventArgs e)//update movie
        {
            int a;

            if (!int.TryParse(textYear.Text, out a))
            {
                MessageBox.Show("Year and Copies must be a valid integer");
            }
            else
            {
                int rental = 0;
                if ((DateTime.Now.Year - a) > 5)
                {
                    rental = 2;
                }
                else
                {
                    rental = 5;
                }
                Video_Rental_Gurmukh_Static_Functions.Edit_Movie(txtMovieName.Text, textPoints.Text, Convert.ToInt32(textYear.Text), Convert.ToInt32(textCopies.Text), textReleased.Text, rental, lblVideo.Text);
                MessageBox.Show("Movie Updated");
                //Dispose();
            }
            GetMovies();
        }
Ejemplo n.º 4
0
 private void button5_Click(object sender, EventArgs e)//method is used for edit customer
 {
     Video_Rental_Gurmukh_Static_Functions.Edit_Customer(txtName.Text, txtMobile.Text, txtAddress.Text, lblCustomer.Text);
     MessageBox.Show("Customer Updated");
     //Dispose();
     GetCustomers();
 }
Ejemplo n.º 5
0
 private void button4_Click(object sender, EventArgs e)//Method is used for add the customer
 {
     if (txtName.Text == "" || txtMobile.Text == "" || txtAddress.Text == "")
     {
         MessageBox.Show("All fields are required");
     }
     else
     {
         Video_Rental_Gurmukh_Static_Functions.Add_Customer(txtName.Text, txtMobile.Text, txtAddress.Text);
         MessageBox.Show("New Customer Added");
         //Dispose();
         GetCustomers();
     }
 }
Ejemplo n.º 6
0
 private void GetRental()//Showing the rental list
 {
     dataGridViewRental.DataSource = Video_Rental_Gurmukh_Static_Functions.Get_Pending_Rentals();
 }
Ejemplo n.º 7
0
 private void GetMovies()//Showing the movies list
 {
     dataGridViewMovies.DataSource = Video_Rental_Gurmukh_Static_Functions.Find_All_Movies();
 }
Ejemplo n.º 8
0
 private void GetCustomers()//Showing the customer list
 {
     dataGridViewCustomers.DataSource = Video_Rental_Gurmukh_Static_Functions.Find_All_Customers();
 }
Ejemplo n.º 9
0
 private void btnMovieReturn_Click(object sender, EventArgs e)
 {
     Video_Rental_Gurmukh_Static_Functions.Update_Return_Record(Convert.ToDateTime(DateTime.Now.ToString()), lblRentalArea.Text);
     MessageBox.Show("Movie Returned");
     GetRental();
 }
Ejemplo n.º 10
0
 private void btnMovieIssue_Click(object sender, EventArgs e)
 {
     Video_Rental_Gurmukh_Static_Functions.Add_Rental_Record(Convert.ToInt32(comboBox1.SelectedValue), Convert.ToInt32(comboBox2.SelectedValue.ToString()), Convert.ToDateTime(dateTimePicker1.Text));
     MessageBox.Show("Movie Rented");
     GetRental();
 }
Ejemplo n.º 11
0
 private void btnVideoDelete_Click(object sender, EventArgs e)//delete movie
 {
     Video_Rental_Gurmukh_Static_Functions.Delete_Movie(lblVideo.Text);
     MessageBox.Show("Movie Deleted");
     //Dispose();
 }