Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            int totalIndexx = 0;
            stinfff = textBox1.Text;
            FFM ffME = new FFM();
            string[] split = stinfff.Split('/');
            ffME.MessageSequenceNumber = 0;
            foreach (string s in split)
            {
                if (s.Trim() != "")
                {
                    if (ffME.Registration == null & bir == 4)
                    {
                        ffME.Registration = s;
                        bir = 5;
                    }

                    if (ffME.Destrination == null & bir == 3)
                    {
                        ffME.Destrination = s;
                        bir = 4;
                    }

                    if (ffME.DayOfOperation == 0 & bir == 2)
                    {
                        ffME.DayOfOperation = Convert.ToInt32(s.Substring(0,2));
                        ffME.MonthOfOperation = s.Substring(2, 3);
                        if (s.Length == 9) ffME.TimeOfScheduledDeparture = s.Substring(5, 4); else ffME.TimeOfScheduledDeparture = "";
                        bir = 3;
                    }

                    if (ffME.FlightIdentifier == null & bir == 1)
                    {
                        ffME.FlightIdentifier = s;
                        bir = 2;
                    }

                    if (ffME.MessageSequenceNumber == 0)
                    {
                        ffME.MessageSequenceNumber = Convert.ToInt32(s);
                        bir = 1;
                    }        

                    Console.WriteLine(s);

                }
            }
            textBox2.Text = ffME.MessageSequenceNumber.ToString();
            textBox3.Text = ffME.FlightIdentifier;
            textBox4.Text = ffME.DayOfOperation.ToString();
            textBox5.Text = ffME.MonthOfOperation.ToString();
            textBox6.Text = ffME.TimeOfScheduledDeparture.ToString();
            textBox7.Text = ffME.Destrination.ToString();
            textBox8.Text = ffME.Registration.ToString();

        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            bool allCharactersInStringAreDigits;
            int totalIndexx = 0;
            stinfff = textBox9.Text;
            FFM ffME = new FFM();
            string[] split = stinfff.Split('/');
            ffME.MessageSequenceNumber = 0;
            foreach (string s in split)
            {
                if (s.Trim() != "")
                {
                    if (ffME.Goods == null & bir == 2)
                    {
                        ffME.Goods = s;                        
                        bir = 3;
                    }

                    if (ffME.ShipmentDescriptionCode == null & bir == 1)
                    {
                        
                        string[] w = SplitWords(s);
                        foreach (string ss in w)
                        {
                            ffME.ShipmentDescriptionCode = w[1];
                            ffME.Pieces = w[2];
                            ffME.WeightCode = w[3];
                            ffME.Weight = w[4];
                            ffME.VolumeCode = w[5];
                            ffME.Volume = w[6];
                            Console.WriteLine(s);
                        }
                        bir = 2;
                    }

                    if (ffME.AirlineAWBIdentification == null)
                    {
                        ffME.AirlineAWBIdentification = s.Substring(0, 3);
                        ffME.AwbSerialNumber = s.Substring(4, 8);
                        ffME.AwbOrigin = s.Substring(12, 3);
                        ffME.AwbDestination = s.Substring(15, 3);
                        bir = 1;
                    }

                    Console.WriteLine(s);
                }
            }

            textBox10.Text = ffME.AirlineAWBIdentification.ToString();
            textBox11.Text = ffME.AwbSerialNumber.ToString();
            textBox12.Text = ffME.AwbOrigin.ToString();
            textBox13.Text = ffME.AwbDestination.ToString();
            textBox14.Text = ffME.ShipmentDescriptionCode.ToString();
            textBox15.Text = ffME.Pieces.ToString();
            textBox16.Text = ffME.WeightCode.ToString();
            textBox17.Text = ffME.Weight.ToString();
            textBox18.Text = ffME.VolumeCode.ToString();
            textBox19.Text = ffME.Volume.ToString();
            textBox21.Text = ffME.Goods.ToString();

        }