Beispiel #1
0
        public static DataSet GetMatchedAttributes(int birthNumber, string fortune, int nameNumber)
        {
            string query = "SELECT attribute.attribute as attribute " +
                           "FROM attribute INNER JOIN [attribute-birthnumber] ON attribute.Id = [attribute-birthnumber].IDattribute " +
                           "WHERE ((([attribute-birthnumber].birthNumber)={0})) " +

                           "UNION ALL " +

                           "SELECT attribute.attribute  as attribute " +
                           "FROM fortune INNER JOIN (attribute INNER JOIN [attribute-fortune] ON attribute.Id = [attribute-fortune].IDattribute) ON fortune.Id = [attribute-fortune].IDfortune " +
                           "WHERE (((fortune.fortune)='{1}')) " +

                           "UNION ALL " +

                           "SELECT attribute.attribute as attribute " +
                           "FROM attribute INNER JOIN [attribute-namenumber] ON attribute.Id = [attribute-namenumber].IDattribute " +
                           "WHERE ((([attribute-namenumber].nameNumber)={2}))";

            DataSet vDataset = null;



            vDataset = MicrosoftAccessConnector.Recuperar_Consulta(string.Format(query, birthNumber, fortune, nameNumber));



            return(vDataset);
        }
Beispiel #2
0
        public static void AddAttribute(string attribute)
        {
            //Llamar a el método ejecutar sentencia sql
            string query = string.Format("INSERT INTO attribute ( attribute ) VALUES ('{0}')", attribute);

            MicrosoftAccessConnector.Ejecutar_Sentencia(query);
        }
Beispiel #3
0
        public static void UpDateAttributeFortune(int IDattribute, int IDFortune, int newIDAttribute, int newIDFortune)
        {
            string query = string.Format("UPDATE [attribute-fortune] SET IDattribute={0}, IDfortune={1} WHERE IDattribute={2} AND IDfortune={3}", newIDAttribute, newIDFortune, IDattribute, IDFortune);

            try
            {
                MicrosoftAccessConnector.Ejecutar_Sentencia(query);
            }
            catch (System.Data.OleDb.OleDbException e)
            {
                //Agregar Excepcion de que no se puede agregar con esos datos porque no coinciden
            }
        }
Beispiel #4
0
        public static void UpDateAttribute(int IDattribute, string attribute)
        {
            string query = string.Format("UPDATE attribute SET attribute='{0}' WHERE ID={1}", attribute, IDattribute);

            try
            {
                MicrosoftAccessConnector.Ejecutar_Sentencia(query);
            }
            catch (System.Data.OleDb.OleDbException e)
            {
                //Agregar Excepcion de que no se puede agregar con esos datos porque no coinciden
            }
        }
Beispiel #5
0
        public static void AddAttributeFortune(int IDAttribute, int IDfortune)
        {
            //Llamar a el método ejecutar sentencia sql
            string query = string.Format("INSERT INTO [attribute-fortune] ( IDattribute, IDfortune ) VALUES ({0}, {1})", IDAttribute, IDfortune);

            try
            {
                MicrosoftAccessConnector.Ejecutar_Sentencia(query);
            }
            catch (System.Data.OleDb.OleDbException e)
            {
                //Agregar Excepcion de que no se puede agregar con esos datos porque no coinciden
            }
        }
Beispiel #6
0
        public static string GetFAQContent()
        {
            string query = "SELECT content FROM cms WHERE Id=4";

            DataSet vDataset = null;

            vDataset = MicrosoftAccessConnector.Recuperar_Consulta(query);

            DataTable tbl = vDataset.Tables[0];

            string content = tbl.Rows[0]["content"].ToString();

            return(content);
        }
Beispiel #7
0
        public static void UpDateFAQPage(string content)
        {
            string fixedContent = content.Replace("\'", "'");

            string query = string.Format("UPDATE [cms] SET content='{0}' WHERE Id=4;", fixedContent);

            try
            {
                MicrosoftAccessConnector.Ejecutar_Sentencia(query);
            }
            catch (System.Data.OleDb.OleDbException e)
            {
                //Agregar Excepcion de que no se puede agregar con esos datos porque no coinciden
            }
        }
Beispiel #8
0
        public static void DeleteAttribute(int IDattribute)
        {
            string query = "DELETE FROM attribute WHERE ID =" + IDattribute;

            MicrosoftAccessConnector.Ejecutar_Sentencia(query);
        }