Пример #1
0
 public static void EliminarVehiculo(Vehiculo item)
 {
     using (Conect db = new Conect())
     {
         db.SP_VEHICULO_ELIMINAR(item.MATRICULA);
     }
 }
Пример #2
0
        public static Vehiculos ConsultarVehiculoCliente()
        {
            List <SP_GENERAL_CONSULTARResult> lstDB = new List <SP_GENERAL_CONSULTARResult>();

            using (Conect db = new Conect())
            {
                lstDB = db.SP_GENERAL_CONSULTAR().ToList <SP_GENERAL_CONSULTARResult>();
            }

            Vehiculos lstRes = new Vehiculos();

            foreach (SP_GENERAL_CONSULTARResult item in lstDB)
            {
                lstRes.Add(new Vehiculo
                {
                    MATRICULA = item.MATRICULA,
                    MARCA     = item.MARCA,
                    ESTADO    = item.ESTADO
                                //,MODELO = convert. item.MODELO
                    , MODELO = System.Convert.ToInt16(item.MODELO),
                });
            }

            return(lstRes);
        }
Пример #3
0
 public static void InsertaVehiculo(Vehiculo item)
 {
     using (Conect db = new Conect())
     {
         db.SP_VEHICULO_CREAR(item.MATRICULA, item.MARCA, item.MODELO, item.ESTADO);
     }
 }
Пример #4
0
        static void Main(string[] args)
        {
            bool   requirePass = true;
            string serverHost  = "\t\t\t\t<Valve alwaysBatch=\"true\" batchSize=\"50\""
                                 + "\n\t\t\t\tclassName=\"com.openintl.security.valve.RedisLogValve\" expiration=\"259200\""
                                 + "\n\t\t\t\tflushInterval=\"30000\" queueSize=\"50\""
                                 + "\n\t\t\t\tredisHost=\"&HOST&\" redisPort=\"&PORT&\" />";


            Console.WriteLine(serverHost);
            string serverHot = "hola";

            try
            {
                Console.WriteLine("Inicio");
                // Conexión con la base de datos
                var client = new RedisClient("tmpsao445674", 6379);
                //Console.WriteLine("1");
                // Contraseña (si fue ingresada por el instalador)
                //client.Auth("qwerty");
                Console.WriteLine(client.Ping());
                // Selección de la base de datos
                client.Select(0);

                // Registra una llave con un valor cualquiera
                client.Set("Installed", "RedisInstalledSFBH0708");

                // Obtiene el valor de la llave
                //Console.WriteLine(client.Get("Installed"));
                //Console.WriteLine(client.Get("index0"));

                //string comm = "mkdir /home/tomcat/new";//Console.WriteLine(Conect.EjecutarSSH("tmpsao445674", "tomcat", "XXXsrivera445674", comm));

                //Console.WriteLine(Conect.test());

                Console.WriteLine(Conect.validateUrl("1234567890"));
                Console.WriteLine(Console.ReadKey());
                Console.WriteLine("Fin");
            }
            catch (System.Net.Sockets.SocketException e)
            {
                if (e.Message.Contains("No such host is known"))
                {
                    Console.WriteLine("No se puede comprobar el host");
                }
            }
            catch (ResponseException e)
            {
                if (e.Message.Contains("NOAUTH"))
                {
                    requirePass = false;
                    Console.WriteLine("Necesita password");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Пример #5
0
 private void CarregarGrid()
 {
     try
     {
         Conect         conect = new Conect();
         SqlConnection  conn   = conect.Conexao();
         SqlCommand     cmd    = new SqlCommand("Select * From tbl_Correcao", conn);
         SqlDataAdapter da     = new SqlDataAdapter(cmd);
         DataTable      dt     = new DataTable();
         da.Fill(dt);
         dgvCorrecao.DataSource = dt;
     }
     catch (Exception ex)
     {
         MessageBox.Show("ERRO, Detalhe: " + ex.Message);
     }
 }
Пример #6
0
 public PessoaController()
 {
     Conect.Conectar();
 }
Пример #7
0
 public CargoController()
 {
     Conect.Conectar();
 }
Пример #8
0
            public static Element UpdateElement(string line)
            {
                line = (line + "                                                                                ").Substring(0, 80);
                if (Header.IsHeader(line))
                {
                    return(Header.FromString(line));                        // Title Section
                }
                if (Title.IsTitle(line))
                {
                    return(Title.FromString(line));                         // Title Section
                }
                if (Compnd.IsCompnd(line))
                {
                    return(Compnd.FromString(line));                        // Title Section
                }
                if (Source.IsSource(line))
                {
                    return(Source.FromString(line));                        // Title Section
                }
                if (Keywds.IsKeywds(line))
                {
                    return(Keywds.FromString(line));                        // Title Section
                }
                if (Expdta.IsExpdta(line))
                {
                    return(Expdta.FromString(line));                        // Title Section
                }
                if (Nummdl.IsNummdl(line))
                {
                    return(Nummdl.FromString(line));                        // Title Section
                }
                if (Author.IsAuthor(line))
                {
                    return(Author.FromString(line));                        // Title Section
                }
                if (Revdat.IsRevdat(line))
                {
                    return(Revdat.FromString(line));                        // Title Section
                }
                if (Jrnl.IsJrnl(line))
                {
                    return(Jrnl.FromString(line));                          // Title Section
                }
                if (Remark.IsRemark(line))
                {
                    return(Remark.FromString(line));                        // Title Section
                }
                if (Seqres.IsSeqres(line))
                {
                    return(Seqres.FromString(line));                        // Primary Structure Section
                }
                if (Seqadv.IsSeqadv(line))
                {
                    return(Seqadv.FromString(line));                        // Primary Structure Section
                }
                if (Helix.IsHelix(line))
                {
                    return(Helix.FromString(line));                         // Secondary Structure Section
                }
                if (Sheet.IsSheet(line))
                {
                    return(Sheet.FromString(line));                         // Secondary Structure Section
                }
                if (Site.IsSite(line))
                {
                    return(Site.FromString(line));                          // Miscellaneous Features Section
                }
                if (Cryst1.IsCryst1(line))
                {
                    return(Cryst1.FromString(line));                        // Crystallographic and Coordinate Transformation Section
                }
                if (Anisou.IsAnisou(line))
                {
                    return(Anisou.FromString(line));                        // Coordinate Section
                }
                if (Atom.IsAtom(line))
                {
                    return(Atom.FromString(line));                          // Coordinate Section
                }
                if (Endmdl.IsEndmdl(line))
                {
                    return(Endmdl.FromString(line));                        // Coordinate Section
                }
                if (Hetatm.IsHetatm(line))
                {
                    return(Hetatm.FromString(line));                        // Coordinate Section
                }
                if (Model.IsModel(line))
                {
                    return(Model.FromString(line));                         // Coordinate Section
                }
                if (Siguij.IsSiguij(line))
                {
                    return(Siguij.FromString(line));                        // Coordinate Section
                }
                if (Ter.IsTer(line))
                {
                    return(Ter.FromString(line));                           // Coordinate Section
                }
                if (Conect.IsConect(line))
                {
                    return(Conect.FromString(line));                        // Connectivity Section
                }
                if (Master.IsMaster(line))
                {
                    return(Master.FromString(line));                        // Bookkeeping Section
                }
                if (End.IsEnd(line))
                {
                    return(End.FromString(line));                           // Bookkeeping Section
                }
                if (line.Substring(0, 6) == "DBREF ")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SEQRES")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "MODRES")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "HET   ")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "HETNAM")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "FORMUL")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SSBOND")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "LINK  ")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "ORIGX1")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "ORIGX2")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "ORIGX3")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SCALE1")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SCALE2")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SCALE3")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "CISPEP")
                {
                    return(new Element(line));                                  // Connectivity Annotation Section
                }
                if (line.Substring(0, 6) == "HETSYN")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SEQADV")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SPRSDE")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "MTRIX1")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "MTRIX2")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "MTRIX3")
                {
                    return(new Element(line));
                }

                if (line.Substring(0, 6) == "MDLTYP")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SPLIT ")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "CAVEAT")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "OBSLTE")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "HYDBND")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SLTBRG")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "TVECT ")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "DBREF1")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "DBREF2")
                {
                    return(new Element(line));
                }
                if (line.Substring(0, 6) == "SIGATM")
                {
                    return(new Element(line));
                }

                HDebug.Assert(false);
                return(new Element(line));
            }