Beispiel #1
0
        private void webBrowserDetail_TitleChange(object sender, AxSHDocVw.DWebBrowserEvents2_TitleChangeEvent e)
        {
            Console.Write(e.text + "\n");

            #if (DEBUG)
            #endif

            if (listViewMaestro.SelectedItems.Count == 1)
            {
                if (myformvisualizador == null)
                {
                    myformvisualizador = new formVisualizador();
                }
                myformvisualizador.calledForm = this;

                Maestro maestroselected = (Maestro)listViewMaestro.SelectedItems[0].Tag;
                Int32   mes             = System.Convert.ToInt32(maestroselected.tvdatafiles_recordDate.Substring(3, 2));
                string  strmes          = mes.ToString();


                Detalle Detalleselected;


                if (Convert.ToInt32(e.text) == -1)
                {
                    if (internalbusqueda.arrayDetalle.Count == 0)
                    {
                        //string iphostname = hosttoip(maestroselected.serverlist_hostname);
                        string iphostname = maestroselected.serverlist_hostname;

                        myformvisualizador.filename_path         = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\";
                        myformvisualizador.filename              = maestroselected.tvdatafiles_name;
                        myformvisualizador.filename_to_reproduce = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\" + maestroselected.tvdatafiles_name;
                    }
                    else
                    {
                        Detalleselected = (Detalle)internalbusqueda.arrayDetalle[0];

                        //string iphostname = hosttoip(Detalleselected.serverlist_hostname);
                        string iphostname = Detalleselected.serverlist_hostname;

                        myformvisualizador.filename_path         = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\";
                        myformvisualizador.filename              = Detalleselected.tvdatafiles_name;
                        myformvisualizador.filename_to_reproduce = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\" + Detalleselected.tvdatafiles_name;
                    }

                    myformvisualizador.timeframe = 0;
                }
                else
                {
                    Detalleselected = (Detalle)internalbusqueda.arrayDetalle[Convert.ToInt32(e.text)];
                    //string iphostname = hosttoip(Detalleselected.serverlist_hostname);
                    string iphostname = Detalleselected.serverlist_hostname;

                    myformvisualizador.filename_path = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\";

                    myformvisualizador.filename = Detalleselected.tvdatafiles_name;
                    myformvisualizador.filename_to_reproduce = @"\\" + iphostname + @"\tvfiles\" + maestroselected.tvdatafiles_recordDate.Substring(6, 4) + @"\" + strmes + @"\" + Detalleselected.tvdatafiles_name;

                    myformvisualizador.timeframe = System.Convert.ToInt32(Detalleselected.tvinfo_timepoint);
                }

                Console.Write(myformvisualizador.filename_to_reproduce + "\n timeframe" + myformvisualizador.timeframe + "\n");


                myformvisualizador.Show();
                myformvisualizador.WindowState = FormWindowState.Normal;
                myformvisualizador.TopMost     = true;
                myformvisualizador.play();
                myformvisualizador.TopMost = false;
            }
        }
Beispiel #2
0
        public int fillMaestro(string strwhere, bool is_withData, bool fulltext)
        {
            string sql;

            if (ascendente)
            {
                if (is_withData)
                {
                    if (fulltext)
                    {
                        sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta_fulltext` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate ";
                    }
                    else
                    {
                        sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate ";
                    }
                }
                else
                {
                    sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta_no_data` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate ";
                }
            }
            else
            {
                if (is_withData)
                {
                    if (fulltext)
                    {
                        sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta_fulltext` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate desc ";
                    }
                    else
                    {
                        sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate desc ";
                    }
                }
                else
                {
                    sql = "select distinct tvdatafiles_name, tvdatafiles_id, tvdatafiles_recordDate ,tvdatafiles_Starttime,tvchannels_Channel,tvchannels_Name,   tvdatafiles_tvshow,tvshows_name,users_Name, storagetype_name ,tvdatafiles_host , serverlist_hostname from (SELECT * FROM `vw_consulta_no_data` WHERE " + strwhere + "  ) tabla order by tvdatafiles_recordDate desc ";
                }
            }

            sql = sql + " LIMIT " + this.pagina * 100 + " , " + 99;



            Console.Write(sql + "\n");

            MySqlCommand    command = connection.CreateCommand();
            MySqlDataReader Reader;

            int int_tvdatafiles_id;
            int int_tvdatafiles_name;

            int int_tvdatafiles_recordDate;
            int int_tvdatafiles_Starttime;
            int int_tvchannels_Channel;
            int int_tvchannels_Name;
            int int_tvdatafiles_tvshow;
            int int_tvshows_name;
            int int_storagetype_name;
            int int_users_Name;

            int int_tvdatafiles_host;
            int int_serverlist_hostname;


            command.CommandText    = sql;
            command.CommandTimeout = int.MaxValue;
            Reader = command.ExecuteReader();


            int_tvdatafiles_id   = Reader.GetOrdinal("tvdatafiles_id");
            int_tvdatafiles_name = Reader.GetOrdinal("tvdatafiles_name");

            int_tvdatafiles_recordDate = Reader.GetOrdinal("tvdatafiles_recordDate");
            int_tvdatafiles_Starttime  = Reader.GetOrdinal("tvdatafiles_Starttime");

            int_tvchannels_Channel = Reader.GetOrdinal("tvchannels_Channel");
            int_tvchannels_Name    = Reader.GetOrdinal("tvchannels_Name");

            int_tvdatafiles_tvshow = Reader.GetOrdinal("tvdatafiles_tvshow");
            int_tvshows_name       = Reader.GetOrdinal("tvshows_name");

            int_storagetype_name = Reader.GetOrdinal("storagetype_name");
            int_users_Name       = Reader.GetOrdinal("users_Name");

            int_tvdatafiles_host    = Reader.GetOrdinal("tvdatafiles_host");
            int_serverlist_hostname = Reader.GetOrdinal("serverlist_hostname");


            int resultado = 0;

            while (Reader.Read())
            {
                resultado++;
                Maestro amaestro = new Maestro();

                amaestro.tvdatafiles_id   = Reader.GetValue(int_tvdatafiles_id).ToString();
                amaestro.tvdatafiles_name = Reader.GetValue(int_tvdatafiles_name).ToString();

                if (Reader.GetValue(int_tvdatafiles_recordDate) != null)
                {
                    amaestro.tvdatafiles_recordDate = Reader.GetValue(int_tvdatafiles_recordDate).ToString();
                }
                else
                {
                    amaestro.tvdatafiles_recordDate = "";
                }


                amaestro.tvdatafiles_Starttime = Reader.GetValue(int_tvdatafiles_Starttime).ToString();
                amaestro.tvchannels_Channel    = Reader.GetValue(int_tvchannels_Channel).ToString();
                amaestro.tvchannels_Name       = Reader.GetValue(int_tvchannels_Name).ToString();
                amaestro.tvdatafiles_tvshow    = Reader.GetValue(int_tvdatafiles_tvshow).ToString();
                amaestro.tvshows_name          = Reader.GetValue(int_tvshows_name).ToString();
                amaestro.storagetype_name      = Reader.GetValue(int_storagetype_name).ToString();
                amaestro.users_Name            = Reader.GetValue(int_users_Name).ToString();
                amaestro.tvdatafiles_host      = Reader.GetValue(int_tvdatafiles_host).ToString();
                amaestro.serverlist_hostname   = Reader.GetValue(int_serverlist_hostname).ToString();

                arrayMaestros.Add(amaestro);
            }
            Reader.Close();
            return(resultado);
        }
Beispiel #3
0
        void doitnow()
        {
            if (listViewMaestro.SelectedItems.Count == 1)
            {
                Maestro maestroselected = (Maestro)listViewMaestro.SelectedItems[0].Tag;
                listViewMaestro.SelectedItems[0].Text = "X";
                maestroselected.visto = "X";
                internalbusqueda.arrayDetalle.Clear();
                //this.listViewDetalle.Items.Clear();
                if (!checkBoxVerSoloPalabras.Checked)
                {
                    internalbusqueda.fillDetalle(where, maestroselected.tvdatafiles_id, is_withData);
                }
                else
                {
                    internalbusqueda.fillDetalleAll(maestroselected.tvdatafiles_id, is_withData);
                }
//                string str_to_display = "<html><body oncontextmenu=\"return false;\">";
                string str_to_display = "<html>";
                str_to_display = str_to_display + "<script type=\"text/javascript\"> function changeTitle(title,ran) { document.title = title; }</script>";
                str_to_display = str_to_display + "<table border=1>";
                str_to_display = str_to_display + "<tr>";
                str_to_display = str_to_display + "<td width=50>";
                str_to_display = str_to_display + "Timeline";
                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "<td width=50>";
                str_to_display = str_to_display + "Info";
                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "<td width=500>";
                str_to_display = str_to_display + "Detalle";
                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "</tr>";



                str_to_display = str_to_display + "<tr>";
                str_to_display = str_to_display + "<td width=50>";

                str_to_display = str_to_display + getNewLink("00" + ":" + "00" + ":" + "00", -1);

                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "<td width=50>";
                str_to_display = str_to_display + "-";
                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "<td width=500>";
                str_to_display = str_to_display + "Comienzo";
                str_to_display = str_to_display + "</td>";

                str_to_display = str_to_display + "</tr>";



                int posicion = 0;
                foreach (Detalle value in internalbusqueda.arrayDetalle)
                {
                    str_to_display = str_to_display + "<tr>";

                    Int32  timepoint = System.Convert.ToInt32(value.tvinfo_timepoint);
                    int    segundos  = timepoint % 60;
                    int    minutos   = (timepoint / 60) % 60;
                    int    horas     = (timepoint / 60 / 60);
                    string str_horas;
                    string str_minutos;
                    string str_segundos;

                    if (segundos < 10)
                    {
                        str_segundos = "0" + segundos.ToString();
                    }
                    else
                    {
                        str_segundos = segundos.ToString();
                    }

                    if (minutos < 10)
                    {
                        str_minutos = "0" + minutos.ToString();
                    }
                    else
                    {
                        str_minutos = minutos.ToString();
                    }

                    if (horas < 10)
                    {
                        str_horas = "0" + horas.ToString();
                    }
                    else
                    {
                        str_horas = horas.ToString();
                    }

                    str_to_display = str_to_display + "<td>";

                    str_to_display = str_to_display + getNewLink(str_horas + ":" + str_minutos + ":" + str_segundos, posicion);
                    posicion++;

                    str_to_display = str_to_display + "</td>";



                    str_to_display = str_to_display + "<td>";
                    if (value.tvinfo_infotype == "")
                    {
                        str_to_display = str_to_display + "-";
                    }
                    else
                    {
                        str_to_display = str_to_display + value.tvinfo_infotype;
                    }
                    str_to_display = str_to_display + "</td>";

                    str_to_display = str_to_display + "<td>";
                    str_to_display = str_to_display + getNewText(value.tvinfo_data);
                    str_to_display = str_to_display + "</td>";


                    str_to_display = str_to_display + "</tr>";
                }
                str_to_display = str_to_display + "</table>";
                str_to_display = str_to_display + "</body></html>";


                string strfile = System.IO.Path.GetTempFileName();

                System.IO.StreamWriter file = new System.IO.StreamWriter(strfile);
                file.WriteLine(str_to_display);
                file.Close();
                object Zero        = 0;
                object EmptyString = "";
                webBrowserDetail.Navigate("file:" + strfile, ref Zero, ref EmptyString, ref EmptyString, ref EmptyString);
            }
        }