コード例 #1
0
        public void Set(string _modelo, string _lote, string _panel, string _id_causa, string _id_defecto, string _defecto, string _id_accion, string _correctiva, string _id_origen, string _estado)
        {
            modelo     = _modelo;
            lote       = _lote;
            panel      = _panel;
            id_causa   = _id_causa;
            id_defecto = _id_defecto;
            defecto    = _defecto;
            id_accion  = _id_accion;
            correctiva = _correctiva;
            id_origen  = _id_origen;
            estado     = _estado;

            object[] fyh = Sistema.fechayhora();
            fecha = fyh[0].ToString();
            hora  = fyh[1].ToString();
        }
コード例 #2
0
        public static void ping()
        {
            if (Sistema.mantenimiento())
            {
                Application.Exit();
            }
            else
            {
                string ver = Utilidades.Version();
                host = Dns.GetHostEntry(Dns.GetHostName()).HostName.ToString();

                Mysql     sql = new Mysql();
                string    str = "select id,hostname,flag from pc where hostname = '" + host + "' limit 1";
                DataTable rs  = sql.Select(str);
                if (sql.rows)
                {
                    DataRow r = rs.Rows[0];
                    flag = r["flag"].ToString();
                    id   = r["id"].ToString();

                    switch (flag)
                    {
                    case "A":
                        MessageBox.Show("El ADMINISTRADOR solicito actualizar el Control de Reparacion.", "ADMINISTRACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        sql.Ejecutar("Update `pc` set flag = '' where id = '" + id + "' limit 1");
                        Utilidades.Actualizar_version();
                        break;

                    case "B":
                        MessageBox.Show("El ADMINISTRADOR bloqueo el acceso de esta PC, pongase en contacto para mas informacion.", "ADMINISTRACION", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Application.Exit();
                        break;

                    default:
                        sql.Ejecutar("Update `pc` set `vr` = '" + ver + "', fecha = NOW(), id_operador = '" + Operador.id + "' where id = '" + id + "' limit 1");
                        break;
                    }
                }
                else
                {
                    sql.Ejecutar("INSERT INTO `pc` (`hostname`, `vr`, `fecha`,`id_operador` ) VALUES ('" + host + "', '" + ver + "', NOW(), '" + Operador.id + "');");
                }
            }
        }
コード例 #3
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     // Cargo reportes y envio ping al servidor.
     //refrescarPlanilla();
     Sistema.ping();
 }