Exemplo n.º 1
0
        public void FinishShopping(string UserName)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.FinishShopping(UserName), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            disconnect(con);
        }
Exemplo n.º 2
0
        public void DeleteProduct(string Product_list_id)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.DeleteProduct(Product_list_id), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            disconnect(con);
        }
Exemplo n.º 3
0
        public void insertProductToList(Product p)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.insertProductToList(p), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables["Products"];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            disconnect(con);
        }
Exemplo n.º 4
0
        public DataTable GetLastPurchesd(Product p)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.GetLastPurchesd(p), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables[0];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            disconnect(con);
            return(dt);
        }
Exemplo n.º 5
0
        public DataTable CreateNewUser(List <string> UserDetailsList)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.CreateNewUser(UserDetailsList), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables[0];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            disconnect(con);
            return(dt);
        }
Exemplo n.º 6
0
        public DataTable getProducts()
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.getProducts(), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables[0];
            }
            catch (Exception ex)
            {
                Logger.writeToLog(LoggerLevel.ERROR, "page :DBServicesAPP.cs, function: getAnimalTypes(), exeption message: " + ex.Message);
                throw ex;
            }
            disconnect(con);
            return(dt);
        }
Exemplo n.º 7
0
        public DataTable getUserDedails(string UserName, string passwordString)
        {
            SqlConnection con;

            try
            {
                con = connect();                                                                    // open the connection to the database/
                da  = new SqlDataAdapter(SQLQueries.getUserDedails(UserName, passwordString), con); // create the data adapter
                DataSet ds = new DataSet();
                da.Fill(ds);                                                                        // Fill the datatable (in the dataset), using the Select command
                dt = ds.Tables[0];                                                                  // point to the cars table , which is the only table in this case
            }
            catch (Exception ex)
            {
                Logger.writeToLog(LoggerLevel.ERROR, "page :DBServicesAPP.cs, function: getVolonteerPass(), exeption message: " + ex.Message);
                throw ex;
            }
            disconnect(con);
            return(dt);
        }
Exemplo n.º 8
0
        public DataTable ShowShoppingList_byUserId(string UserId)
        {
            SqlConnection con;

            try
            {
                con = connect();
                da  = new SqlDataAdapter(SQLQueries.ShowShoppingList_byUserId(UserId), con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                dt = ds.Tables[0];
            }
            catch (Exception ex)
            {
                Logger.writeToLog(LoggerLevel.ERROR, "page :DBServicesAPP.cs, function: getVeg_ShoppingList(), exeption message: " + ex.Message);
                throw ex;
            }
            disconnect(con);
            return(dt);
        }