Esempio n. 1
0
 private void ClearErrors()
 {
     HotelNameError.Dispose();
     HotelEmailError.Dispose();
     NumberError.Dispose();
     DescriptionError.Dispose();
     HotelRatingError.Dispose();
     CountryError.Dispose();
     StreetError.Dispose();
     CityError.Dispose();
 }
Esempio n. 2
0
        private bool ValidInput()
        {
            bool ret = true;

            if (HotelNames.SelectedIndex == -1)
            {
                HotelNameError.SetError(HotelNames, "Please Select An Hotel");
                ret = false;
            }
            if (FeedbackText.Text == "" || FeedbackText.Text.Length < 3)
            {
                FeedbackError.SetError(FeedbackText, "Please Enter A Strong FeedBack");
                ret = false;
            }
            return(ret);
        }
Esempio n. 3
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);
        }