예제 #1
0
 private void ReportButton_Click(object sender, EventArgs e)
 {
     if (HotelRating.Text == "" || !HelperClass.ValidRating(Convert.ToInt32(HotelRating.Text)))
     {
         HotelRatingError.SetError(HotelRating, "Please Enter Valid Rating");
     }
     else
     {
         CrystalReportRatingParameter = Convert.ToInt32(HotelRating.Text);
         HotelsReportViewer Report  = new HotelsReportViewer();
         Thread             Loading = new Thread(new ThreadStart(runSplash));
         Loading.Start();
         Report.ShowDialog();
         Loading.Abort();
     }
 }
예제 #2
0
        private bool CheckErrors()
        {
            bool Result = false;

            if (HotelCity.Text == "")
            {
                CityError.SetError(HotelCity, "Please Enter the Hotel City");
            }
            if (HotelCountry.Text == "")
            {
                CountryError.SetError(HotelCountry, "Please Enter the Hotel Country");
            }
            if (HotelStreet.Text == "")
            {
                StreetError.SetError(HotelStreet, "Please Enter the Hotel Street");
            }
            if (!ValidHotelName(HotelName.Text))
            {
                HotelNameError.SetError(HotelName, "This Hotel Name Already Exists");
                Result = true;
            }
            if (!HelperClass.ValidEmail(HotelEmail.Text) || !HelperClass.UniqueHotelEmail(HotelEmail.Text, AddHotelConnection))
            {
                HotelEmailError.SetError(HotelEmail, "This Email Is Not Valid or Already Exists");
                Result = true;
            }
            if (!HelperClass.ValidPhoneNumber(HotelContactNumber.Text) || !HelperClass.UniqueHotelNumber(HotelContactNumber.Text, AddHotelConnection))
            {
                NumberError.SetError(HotelContactNumber, "The Number Format You Entered Wrong, Correct Form 12 numbers Or Already Exists");
                Result = true;
            }
            if (!HelperClass.ValidRating(HotelRating.Value))
            {
                HotelRatingError.SetError(HotelRating, "Please Enter Rating For The Hotel");
                Result = true;
            }
            return(Result);
        }