private void button7_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            string msgType = "";
            stinfff = textBox8.Text;
            LDM ldmE = new LDM();
            string[] split = stinfff.Split(' ');

            foreach (string s in split)
            {
                if (s.Trim() != "")
                {

                    if (s.StartsWith("B") && s.IndexOf("/") != -1)
                    {
                        string[] split2 = s.Split('.');
                        msgType = "FRE";
                        bir = 1;
                        foreach (string s1 in split2)
                        {
                            if (s1.Trim() != "")
                            {
                                if (s1.StartsWith("B/") && !s1.EndsWith("NIL"))
                                {
                                    ldmE.Baggage = Convert.ToInt32(s1.Substring(2, s1.Length - 2));
                                }
                                if (s1.StartsWith("C/") && !s1.EndsWith("NIL"))
                                {
                                    ldmE.Freight = Convert.ToInt32(s1.Substring(2, s1.Length - 2));
                                }
                                if (s1.StartsWith("M/") && !s1.EndsWith("NIL"))
                                {
                                    ldmE.Mail = Convert.ToInt32(s1.Substring(2, s1.Length - 2));
                                }
                                Console.WriteLine(s1);
                            }
                        }
                    }

                    Console.WriteLine(s);

                }

            }
            txtFreight.Text = ldmE.Freight.ToString();
            txtBaggage.Text = ldmE.Baggage.ToString();
            txtMail.Text = ldmE.Mail.ToString();
        }
        private void button5_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            string msgType = "";
            stinfff = textBox8.Text;
            LDM ldmE = new LDM();
            string[] split = stinfff.Split(' ');

            foreach (string s in split)
            {
                if (s.Trim() != "")
                {

                    if (ldmE.Baggage == 0 && bir == 5)
                    {
                        ldmE.Baggage = Convert.ToInt32(s);
                        //bir = 4;
                    }
                    if (msgType == "POS" && bir == 4)
                    {
                        msgType = "BAG";
                        bir = 5;
                    }
                    if (ldmE.Mail == 0 && bir == 3)
                    {
                        ldmE.Mail = Convert.ToInt32(s);
                        bir = 4;
                    }
                    if (msgType == "FRE" && bir == 2)
                    {
                        msgType = "POS";
                        bir = 3;
                    }
                    if (ldmE.Freight == 0 && bir == 1)
                    {
                        ldmE.Freight = Convert.ToInt32(s);
                        bir = 2;
                    }
                    if (ldmE.Freight == 0 && bir == 0 && s.StartsWith("FRE"))
                    {
                        msgType = "FRE";
                        bir = 1;
                    }

                    Console.WriteLine(s);

                }

            }
            txtFreight.Text = ldmE.Freight.ToString();
            txtBaggage.Text = ldmE.Baggage.ToString();
            txtMail.Text = ldmE.Mail.ToString();
        }
        private void button6_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            string msgType = "";
            stinfff = textBox8.Text;
            LDM ldmE = new LDM();
            string[] split = stinfff.Split('.');

            foreach (string s in split)
            {
                if (s.Trim() != "")
                {

                    if (ldmE.Mail == 0 && bir == 3 && s.StartsWith("M"))
                    {
                        ldmE.Mail = Convert.ToInt32(s.Substring(1,s.Length - 1));
                        bir = 4;
                    }

                    if (ldmE.Freight == 0 && bir == 1 && s.StartsWith("C"))
                    {
                        ldmE.Freight = Convert.ToInt32(s.Substring(1,s.Length-1));
                        bir = 3;
                    }
                    if (ldmE.Baggage == 0 && bir == 0 && s.StartsWith("B"))
                    {
                        msgType = "BAG";
                        ldmE.Baggage = Convert.ToInt32(s.Substring(1,s.Length-1));
                        bir = 1;
                    }

                    Console.WriteLine(s);

                }

            }
            txtFreight.Text = ldmE.Freight.ToString();
            txtBaggage.Text = ldmE.Baggage.ToString();
            txtMail.Text = ldmE.Mail.ToString();
        }
        private void button4_Click(object sender, EventArgs e)
        {
            string stinfff;
            int bir = 0;
            int totalIndexx = 0;
            stinfff = textBox6.Text;
            LDM ldmE = new LDM();
            string[] split = stinfff.Split('.');

            foreach (string s in split)
            {
                if (s.Trim() != "")
                {
                    if (bir == 6)
                    {
                        ldmE.RemarksForDest = ldmE.RemarksForDest + " " + s;
                    }

                    //if (bir == 5 && s.StartsWith("PAX"))
                    if (ldmE.LoadInCompartments != null && bir == 5 && s.StartsWith("PA"))
                    {
                        ldmE.PassengersInEachClass = s;
                    }

                    if (bir == 5 && s.StartsWith("PAD"))
                    {
                        ldmE.PadPassengersInEachClass = s;
                        bir = 6;
                    }

                    if (ldmE.LoadInCompartments != null && bir == 5 && !s.StartsWith("PA"))
                    {
                        ldmE.LoadInCompartments = ldmE.LoadInCompartments + " " + s;
                        bir = 5;
                    }

                    if (ldmE.LoadInCompartments == null && bir == 4)
                    {
                        ldmE.LoadInCompartments = s;
                        bir = 5;
                    }

                    if (ldmE.TotalDeadload == null && bir <= 3 && s.StartsWith("T"))
                    {
                        ldmE.TotalDeadload = s;
                        bir = 4;
                    }

                    if (ldmE.CabinBaggageWeight == 0 && bir == 2 && !s.StartsWith("T"))
                    {
                        ldmE.CabinBaggageWeight = Convert.ToInt32(s);
                        bir = 3;
                    }

                    if (ldmE.PassengerNumbers == null && bir == 1)
                    {
                        ldmE.PassengerNumbers = s;
                        bir = 2;
                        totalIndexx = 2;
                    }

                    if (ldmE.DestinationAirport == null )
                    {
                        ldmE.DestinationAirport = s;
                        bir = 1;
                    }

                    Console.WriteLine(s);

                }

            }
            txtDest.Text = ldmE.DestinationAirport;
            txtPassengerNumber.Text = ldmE.PassengerNumbers;
            txtCabbinBaggage.Text = ldmE.CabinBaggageWeight.ToString();
            txtTotalDeadload.Text = ldmE.TotalDeadload;
            txtLoadinCompart.Text = ldmE.LoadInCompartments;
            txtSeatOcupp.Text = ldmE.PassengersInEachClass + " " + ldmE.PadPassengersInEachClass;
            txtRemarks.Text = ldmE.RemarksForDest;
        }