Beispiel #1
0
        public Boolean searchUser(User u)
        {
            ConnectOracle con = new ConnectOracle();

            return(!con.DLookUp("LOGIN", "USERS",
                                "LOGIN='******' AND PASSWORD='******'").Equals(-1));
        }
Beispiel #2
0
        //public bool ValidarConx(String contra)
        //{
        //    ConnectOracle search = new ConnectOracle();
        //    int resp = Convert.ToInt16(search.DLookUp("count(*)", "empleados", "UPPER(contra)= '" + contra.ToUpper() + "' AND borrado=0"));
        //    if (resp > 0)
        //    {
        //        return true;
        //    }
        //    return false;
        //}

        public int ValidarConx(Usuario u1)
        {
            ConnectOracle Search = new ConnectOracle();
            String        cond   = "UPPER(dni) ='" + u1.getDni().ToUpper() + "' AND CONTRA ='" + u1.getContra() + "'";

            Object resul = Search.DLookUp("count(*)", "empleados", cond);

            return(Int32.Parse(resul.ToString()));
        }
Beispiel #3
0
        public int Validar(User u1)
        {
            ConnectOracle Search = new ConnectOracle();
            String        cond   = "UPPER(NAME) ='" + u1.getNombre() + "' AND UPPER(PASSWORD) ='" + u1.getContra() + "'";

            Object resul = Search.DLookUp("IDUSER", "USUARIO", cond);

            return(Int32.Parse(resul.ToString()));
        }
Beispiel #4
0
        public bool existsUser(String dni)
        {
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "empleados", "UPPER(dni)= '" + dni.ToUpper() + "' AND borrado=0"));

            if (resp > 0)
            {
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public static bool existsUser(String user)
        {
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "usuario", "UPPER(NAME)= '" + user.ToUpper() + "' AND DELETED=0"));

            if (resp > 0)
            {
                return(true);
            }
            return(false);
        }
Beispiel #6
0
        public static bool existDNI(String DNI)
        {
            bool          exist  = false;
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "customers", "UPPER(DNI)= '" + DNI.ToUpper() + "' AND DELETED=0"));

            if (resp > 0)
            {
                exist = true;
            }
            return(exist);
        }
Beispiel #7
0
        public static bool existCustomer(String id)
        {
            bool          exist  = false;
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "orders", "REFCUSTOMER= '" + id + "' AND DELETED=0"));

            if (resp > 0)
            {
                exist = true;
            }
            return(exist);
        }
Beispiel #8
0
        public static bool existProductOrders(String id)
        {
            bool          exist  = false;
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "orders", "IDORDER= (Select REFORDER from ordersproducts Where REFPRODUCT ='" + id + "')"));

            if (resp > 0)
            {
                exist = true;
            }
            return(exist);
        }
Beispiel #9
0
        public static bool existProduct(String name)
        {
            bool          exist  = false;
            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("count(*)", "products", "UPPER(NAME)= '" + name.ToUpper() + "' AND DELETED=0"));

            if (resp > 0)
            {
                exist = true;
            }
            return(exist);
        }
Beispiel #10
0
        private void getZipcodesCities()
        {
            String tables = " zipcodescities z inner join zipcodes zip on refzipcode=idzipcode " +
                            " inner join cities c on refcity=idcity " +
                            " inner join states s on refstate=idstate ";
            String cond = " zipcode='" + cmbZIP.SelectedItem.ToString() + "' And city='" + cmbCity.SelectedItem.ToString() + "' And State= '" + cmbProv.SelectedItem.ToString() + "'";

            ConnectOracle search = new ConnectOracle();
            int           resp   = Convert.ToInt16(search.DLookUp("IDZIPCODESCITIES", tables, cond));

            this.refzipcodescities = resp;
        }
Beispiel #11
0
        public static String getData(String column, String table, String cond)
        {
            ConnectOracle select = new ConnectOracle();

            return(select.DLookUp(column, table, cond).ToString());
        }