/// <summary>
        /// Armado del archivo excel(encabezado y contenido) y guardado en
        /// temporales
        /// </summary>
        private void CreateExcel()
        {
            if (SearchDQBAstETU)
            {
                ReportDBQBucle();
                FixDQBETUReport();
                Microsoft.VisualBasic.Devices.Computer MyComputer = new Microsoft.VisualBasic.Devices.Computer();
                string fileName = string.Empty;
                int    count    = 0;

                #region Generacion documento Excel

                using (MyCTSExcel objExcel = new MyCTSExcel())
                {
                    objExcel.CreateExcelObject("MyCTS");
                    if (objExcel.IsObjectCreated)
                    {
                        fileName = MyComputer.FileSystem.SpecialDirectories.Temp;
                        fileName = fileName + string.Format("\\TempFile_{0}.xls", Guid.NewGuid().ToString());

                        MyCTSExcel.Cell cell = null;
                        cell           = new MyCTSExcel.Cell(2, 2, titulo);
                        cell.Bold      = true;
                        cell.Wide      = 6;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 2, "ITM");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 3, "PASSENGER NAME");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 4, "TKT NUMBER");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 5, "DK NUMBER");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 6, "ORIGINAL DATE ISSUE");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 7, "DATE ADDED TO REPORT");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);
                        cell      = new MyCTSExcel.Cell(3, 8, "DATE TO BE PURGED FROM REPORT");
                        cell.Bold = true;
                        objExcel.CreateCell(cell);

                        #region Elementos2

                        count = 4;
                        int numberPassengers = PassengerList.Count;
                        progressBar1.Visible = true;
                        progressBar1.Maximum = numberPassengers;
                        progressBar1.Value   = 0;
                        CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.GENERATING_FILE_EXCEL);

                        foreach (Passenger p in PassengerList)
                        {
                            cell = new MyCTSExcel.Cell(count, 2, p.Item);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 3, p.Name);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 4, p.TKTNumber);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 5, p.DKNumber);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 6, p.Original);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 7, p.DateAdd);
                            objExcel.CreateCell(cell);
                            cell = new MyCTSExcel.Cell(count, 8, p.DateToBe);
                            objExcel.CreateCell(cell);
                            progressBar1.Value = count - 3;
                            if (count % 20 == 0)
                            {
                                CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.GENERATING_FILE_EXCEL);
                            }
                            count++;
                        }

                        #endregion

                        objExcel.SaveFile(fileName);
                    }
                }
                if (!string.IsNullOrEmpty(fileName))
                {
                    Process proc = new Process();
                    proc.StartInfo.Arguments = "\"" + fileName + "\"";
                    proc.StartInfo.FileName  = "EXCEL.EXE";
                    proc.Start();
                }
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);

                #endregion
            }
        }
        /// <summary>
        /// Genera el archivo excel que contiene la información de la sabana de vuelo
        /// </summary>
        private void BuildSabana()
        {
            List <GetInfoGroup> indexList = new List <GetInfoGroup>();

            if (rdoPNR.Checked)
            {
                indexList = GetInfoGroupBL.GetInfoGroup(txtPNR.Text, Login.OrgId);
            }
            else
            {
                indexList = GetInfoGroupByIDGroupBL.GetInfoGroup(txtGroup.Text, Login.OrgId);
            }
            if (indexList.Count > 0)
            {
                CommandsAPI2.send_MessageToEmulator("GENERANDO SABANA DE VUELO, FAVOR DE ESPERAR.........");
                InfoGroupList        = new List <InfoGroup>();
                progressBar1.Maximum = indexList.Count;
                for (int i = 0; i < indexList.Count; i++)
                {
                    InfoGroup info = new InfoGroup();
                    info.Name          = string.Concat(indexList[i].PaxName, " ", indexList[i].PaxLastName);
                    info.Origin        = indexList[i].Origin;
                    info.Destination   = indexList[i].Destination;
                    info.DepartureTime = indexList[i].DepartureTime;
                    info.ArrivalTime   = indexList[i].ArrivalTime;
                    info.AirlineCode   = indexList[i].AirlineCode;
                    info.AirlineRef    = indexList[i].AirlineRef;
                    info.FlightNumber  = indexList[i].FlightNumber;
                    info.DepartureDate = Convert.ToString(indexList[i].DepartureDate);
                    info.PaxNumber     = Convert.ToString(indexList[i].PaxNumber);
                    info.RecLoc        = indexList[i].RecLoc;

                    InfoGroupList.Add(info);
                }
                Microsoft.VisualBasic.Devices.Computer MyComputer = new Microsoft.VisualBasic.Devices.Computer();
                string fileName = string.Empty; //Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
                int    count    = 7;
                int    j        = 3;

                using (MyCTSExcel objExcel = new MyCTSExcel())
                {
                    objExcel.CreateExcelObject("MyCTS");
                    if (objExcel.IsObjectCreated)
                    {
                        fileName = MyComputer.FileSystem.SpecialDirectories.Temp;
                        fileName = fileName + string.Format("\\TempFile_{0}.xls", Guid.NewGuid().ToString());
                        MyCTSExcel.Cell cell = null;
                        cell           = new MyCTSExcel.Cell(2, 2, string.Concat("SABANA DE VUELO ", indexList[0].IDGroup, " / RECORD MAESTRO: ", indexList[0].MasterPNR));
                        cell.Wide      = 8;
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell = new MyCTSExcel.Cell(3, 2, string.Concat("REPORTE EMITIDO EL ",
                                                                       DateTime.Now.ToString("dd/MMM/yyyy").ToUpper(), " a las ", DateTime.Now.ToString("HH:mm"), " Hrs."));
                        cell.Wide      = 8;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(5, 3, "SEGMENTO 1");
                        cell.Wide      = 7;
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 2, "Nombre");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 3, "Origen");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 4, "Destino");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 5, "Salida");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 6, "LLegada");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 7, "LA");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 8, "Vuelo");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 9, "Fecha");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 10, "Clave Aerolínea");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(6, 11, "Clave Aerolínea");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell = new MyCTSExcel.Cell(count, 2, InfoGroupList[0].Name);
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 3, InfoGroupList[0].Origin);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 4, InfoGroupList[0].Destination);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 5, InfoGroupList[0].DepartureTime);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 6, InfoGroupList[0].ArrivalTime);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 7, InfoGroupList[0].AirlineCode);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 8, InfoGroupList[0].FlightNumber);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 9, InfoGroupList[0].DepartureDate.Substring(0, 10));
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 10, InfoGroupList[0].AirlineRef);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        cell           = new MyCTSExcel.Cell(count, 11, InfoGroupList[0].RecLoc);
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                        progressBar1.Visible = true;
                        progressBar1.Value   = 1;
                        int barValue = 1;
                        int count2   = 0;
                        int max      = 0;
                        int aux      = 0;
                        for (int i = 1; i < InfoGroupList.Count; i++)
                        {
                            if (InfoGroupList[i].PaxNumber == InfoGroupList[i - 1].PaxNumber)
                            {
                                j              = j + 8;
                                cell           = new MyCTSExcel.Cell(count, j, InfoGroupList[i].Origin);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 1, InfoGroupList[i].Destination);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 2, InfoGroupList[i].DepartureTime);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 3, InfoGroupList[i].ArrivalTime);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 4, InfoGroupList[i].AirlineCode);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 5, InfoGroupList[i].FlightNumber);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 6, InfoGroupList[i].DepartureDate.Substring(0, 10));
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 7, InfoGroupList[i].AirlineRef);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, j + 8, InfoGroupList[i].RecLoc);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                count2++;
                                if (barValue % 19 == 0)
                                {
                                    CommandsAPI2.send_MessageToEmulator("GENERANDO SABANA DE VUELO, FAVOR DE ESPERAR.........");
                                }
                                barValue++;
                                progressBar1.Value = barValue;
                            }
                            else
                            {
                                aux = count2;
                                if (aux > max)
                                {
                                    max = aux;
                                }
                                else
                                {
                                    max = count2;
                                }
                                count2 = 0;
                                j      = 3;
                                count++;
                                cell = new MyCTSExcel.Cell(count, 2, InfoGroupList[i].Name);
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 3, InfoGroupList[i].Origin);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 4, InfoGroupList[i].Destination);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 5, InfoGroupList[i].DepartureTime);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 6, InfoGroupList[i].ArrivalTime);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 7, InfoGroupList[i].AirlineCode);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 8, InfoGroupList[i].FlightNumber);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 9, InfoGroupList[i].DepartureDate.Substring(0, 10));
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 10, InfoGroupList[i].AirlineRef);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                cell           = new MyCTSExcel.Cell(count, 11, InfoGroupList[i].RecLoc);
                                cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                                objExcel.CreateCell(cell);
                                if (barValue % 19 == 0)
                                {
                                    CommandsAPI2.send_MessageToEmulator("GENERANDO SABANA DE VUELO, FAVOR DE ESPERAR.........");
                                }
                                barValue++;
                                progressBar1.Value = barValue;
                            }
                        }
                        aux = count2;
                        if (aux > max)
                        {
                            max = aux;
                        }
                        else
                        {
                            max = count2;
                        }
                        aux = 11;
                        for (int k = 0; k < max; k++)
                        {
                            cell           = new MyCTSExcel.Cell(5, aux, string.Concat(" SEGMENTO ", k + 2, " "));
                            cell.Wide      = 7;
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux, " Origen ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 1, " Destino ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 2, " Salida ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 3, " Llegada ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 4, " LA ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 5, " Vuelo ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 6, " Fecha ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            cell           = new MyCTSExcel.Cell(6, aux + 7, " Clave Aerolínea ");
                            cell.Bold      = true;
                            cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                            objExcel.CreateCell(cell);
                            aux = aux + 8;
                        }
                        cell           = new MyCTSExcel.Cell(6, aux, " Record ");
                        cell.Bold      = true;
                        cell.Alignment = MyCTSExcel.Alignment.MiddleCenter;
                        objExcel.CreateCell(cell);
                    }
                    objExcel.SaveFile(fileName);
                }
                if (!string.IsNullOrEmpty(fileName))
                {
                    Process proc = new Process();
                    proc.StartInfo.Arguments = "\"" + fileName + "\"";
                    proc.StartInfo.FileName  = "EXCEL.EXE";
                    proc.Start();
                }
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
            else
            {
                if (rdoPNR.Checked)
                {
                    MessageBox.Show("EL RECORD LOCALIZADOR NO VALIDO O INEXISTENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (!GetInfoGroupByIDGroupBL.Status)
                {
                    MessageBox.Show("EL NOMBRE DE GRUPO NO EXISTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("EL GRUPO AUN NO CONTIENE PASAJEROS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }