Esempio n. 1
0
        private void buttonTourSave_Click(object sender, EventArgs e)
        {
            if (textBoxTourFrom.Text == "")
            {
                MessageBox.Show("Please fill the required information", "Error");
            }
            else
            {
                try
                {
                    DBL.Tour tour = new DBL.Tour();
                    tour.Tourfrom   = textBoxTourFrom.Text;
                    tour.Tourto     = textBoxTourTo.Text;
                    tour.Tourkm     = textBoxTourKM.Text;
                    tour.Touramount = textBoxTourAmount.Text;
                    tour.addTour(tour);
                    MessageBox.Show("Inserted Well", "Success");
                    allTourTable();

                    textBoxTourFrom.Text   = "";
                    textBoxTourTo.Text     = "";
                    textBoxTourKM.Text     = "";
                    textBoxTourAmount.Text = "";
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error");
                }
            }
        }
Esempio n. 2
0
        public bool foundTour(String id)
        {
            DBL.Tour tour = new DBL.Tour();
            tour.Id = id;
            SqlDataReader rdr = tour.getTour(tour);

            if (rdr.Read())
            {
                /*
                 * string col = rdr["id"].ToString();
                 * MessageBox.Show(col, "Success");
                 */
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
 private void buttonTourDelete_Click(object sender, EventArgs e)
 {
     if (textBoxTourSearch.Text == "")
     {
         MessageBox.Show("Please fill the required information", "Error");
     }
     else
     {
         try
         {
             DBL.Tour tour = new DBL.Tour();
             tour.Id = textBoxTourSearch.Text;
             tour.deleteTour(tour);
             MessageBox.Show("Deleted Well", "Success");
             allTourTable();
             textBoxTourSearch.Text = "";
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Error");
         }
     }
 }