Exemplo n.º 1
0
        /// <summary>
        /// This function is responsible for the process of receiving and checking the input
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Longitude_Click(object sender, RoutedEventArgs e)
        {
            string textRange = MyTextBox1.Text;
            double result    = 0;

            if (double.TryParse(textRange, out result))
            {
                longitude = result;
                try
                {
                    bl.UpdateStopLongitude(result, managingStop.StopCode);
                    MessageBox.Show("input submited" + result + "      to exit click X", "input", MessageBoxButton.OK, MessageBoxImage.Information);

                    MyTextBox1.Clear();
                }
                catch (BO.BODOStopBadIdException ex)
                {
                    MessageBox.Show(ex.Message, "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                    MyTextBox1.Clear();
                    return;
                }
            }
            else
            {
                MessageBox.Show("wrong input!!!!", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                MyTextBox1.Clear();
            }
        }
        /// <summary>
        /// This function is responsible for the process of receiving and checking the input
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Fuel_Update_Click(object sender, RoutedEventArgs e)
        {
            string textRange = MyTextBox1.Text;
            float  result    = 0;

            if (float.TryParse(textRange, out result))
            {
                fuel = result;
                try
                {
                    bl.UpdateBusFuel(fuel, managingBus.LicenseNumber);
                    MessageBox.Show("input submited  " + result + "      to exit click X", "input", MessageBoxButton.OK, MessageBoxImage.Information);

                    MyTextBox1.Clear();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Information);
                    MyTextBox1.Clear();
                }
            }
            else
            {
                MessageBox.Show("wrong input!!!!", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                MyTextBox1.Clear();
            }
        }
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Area_Click(object sender, RoutedEventArgs e)
        {
            string textRange = MyTextBox1.Text;

            area = textRange;
            try
            {
                bl.UpdateLineArea(area, managingLine.Id);
                MessageBox.Show("input submited" + area + "  click on X to exit");

                MyTextBox1.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Information);
                MyTextBox1.Clear();
            }
        }
Exemplo n.º 4
0
		private void Page_Load(object sender, EventArgs e)
		{
			HtmlForm form1 = (HtmlForm) this.FindControl("form1");
			this.GHTTestBegin(form1);
			this.GHTSubTestBegin("New Inherits TextBox");
			try
			{
				MyTextBox1 box1 = new MyTextBox1();
				box1.ID = "MyTextBox1";
				base.GHTActiveSubTest.Controls.Add(box1);
				this.GHTSubTestAddResult(box1.ID);
			}
			catch (Exception exception2)
			{
				// ProjectData.SetProjectError(exception2);
				Exception exception1 = exception2;
				this.GHTSubTestUnexpectedExceptionCaught(exception1);
				// ProjectData.ClearProjectError();
			}
			this.GHTSubTestEnd();
			this.GHTTestEnd();
		}
        /// <summary>
        /// Defines actions to be performed when a  button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Area_Click(object sender, RoutedEventArgs e)
        {
            string textRange = MyTextBox1.Text;

            if (amount != 3)
            {
                area = textRange;

                MessageBox.Show("input submited  " + textRange + "      to exit click X", "input", MessageBoxButton.OK, MessageBoxImage.Information);

                AreaLabel.Content = area;
                MyTextBox1.Clear();
                if (!input1)
                {
                    input1 = true;
                    amount++;
                }
            }
            else
            {
                MessageBox.Show("wrong input!!!!", "input", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Exemplo n.º 6
0
        private void Page_Load(object sender, EventArgs e)
        {
            HtmlForm form1 = (HtmlForm)this.FindControl("form1");

            this.GHTTestBegin(form1);
            this.GHTSubTestBegin("New Inherits TextBox");
            try
            {
                MyTextBox1 box1 = new MyTextBox1();
                box1.ID = "MyTextBox1";
                base.GHTActiveSubTest.Controls.Add(box1);
                this.GHTSubTestAddResult(box1.ID);
            }
            catch (Exception exception2)
            {
                // ProjectData.SetProjectError(exception2);
                Exception exception1 = exception2;
                this.GHTSubTestUnexpectedExceptionCaught(exception1);
                // ProjectData.ClearProjectError();
            }
            this.GHTSubTestEnd();
            this.GHTTestEnd();
        }
        /// <summary>
        /// Defines actions to be performed when a  button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Longitude_Click(object sender, RoutedEventArgs e)
        {
            string textRange = MyTextBox1.Text;
            double result    = 0;

            if (double.TryParse(textRange, out result))
            {
                try
                {
                    valid.GetGoodLongitude(result);
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    MessageBox.Show(ex.Message, "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                    MyTextBox1.Clear();
                    return;
                }

                if (!input1 && amount != 3)
                {
                    amount++;
                    longitude = result;
                    MessageBox.Show("input submited  " + result + "      to exit click X", "input", MessageBoxButton.OK, MessageBoxImage.Information);
                    LongitudeLabel.Content = result;
                    MyTextBox1.Clear();
                    if (!input1)
                    {
                        input1 = true;
                    }
                }
            }
            else
            {
                MessageBox.Show("wrong input!!!!", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                MyTextBox1.Clear();
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LicenseDate_Click(object sender, RoutedEventArgs e)
        {
            int year;
            int day;
            int month;


            string stInput;
            string stYear;
            string stDay;
            string stMonth;



            stInput = MyTextBox1.Text;
            string[] inputValues = stInput.Split('/');
            if (inputValues.Length != 3)
            {
                MessageBox.Show("Wrong date format", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                MyTextBox1.Clear();
                return;
            }


            stDay   = inputValues[0];
            stMonth = inputValues[1];
            stYear  = inputValues[2];

            if (int.TryParse(stDay, out day) && int.TryParse(stMonth, out month) && int.TryParse(stYear, out year))
            {
                try
                {
                    valid.GoodTimeformat(day, month, year);
                    licenseDate = new DateTime(year, month, day);
                }
                catch
                {
                    MessageBox.Show("Wrong date format", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                    MyTextBox1.Clear();
                    return;
                }
                if (input0)
                {
                    try
                    {
                        valid.GoodLicense(licenseNumber, licenseDate);
                    }
                    catch (BO.BOBadBusIdException)
                    {
                        MessageBox.Show("licesne and date time don't match until 2018 7 digits from then and on 8 digits", "Operation Failure", MessageBoxButton.OK, MessageBoxImage.Error);
                        MyTextBox1.Clear();
                    }
                }

                if (amount != 5)
                {
                    DateTime temp = new DateTime(year, month, day);
                    licenseDate = temp;

                    MessageBox.Show("input submited  " + stInput + "      to exit click X", "input", MessageBoxButton.OK, MessageBoxImage.Information);

                    DateTimeLabel.Content = temp;
                    MyTextBox1.Clear();
                    if (!input1)
                    {
                        input1 = true;
                        amount++;
                    }
                }
            }
            else
            {
                MessageBox.Show("wrong input!!!", " Operation Failure ", MessageBoxButton.OK, MessageBoxImage.Error);
                MyTextBox1.Clear();
            }
        }