Esempio n. 1
0
        public static List <Model.Changelog> GetAllChangelog()
        {
            List <Model.Changelog> changelogs = new List <Model.Changelog>();
            string    query = "select * from CHANGE_LOG order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                changelogs.Add(RowToEntity(row));
            }
            return(changelogs);
        }
Esempio n. 2
0
        public static List <POS_Order> GetOrders(DateTime first, DateTime second)
        {
            List <POS_Order> orders = new List <POS_Order>();
            string           query  = "select * from pos_order where place_time between TO_DATE('" + first.ToString(string.Format("MM-dd-yyyy")) + "', 'mm-dd-yyyy') and TO_DATE('" + second.ToString(String.Format("MM-dd-yyyy")) + "', 'mm-dd-yyyy')";
            DataTable        table  = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                orders.Add(RowToEntity(row));
            }
            return(orders);
        }
        public static List <Model.Ingredient> GetAllIngredients()
        {
            List <Model.Ingredient> ingredients = new List <Model.Ingredient>();
            string    query = "select * from ingredient order by Id";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                ingredients.Add(RowToEntity(row));
            }
            return(ingredients);
        }
        public static List <Model.Unit_Type> GetAllUnit_Types()
        {
            List <Model.Unit_Type> types = new List <Model.Unit_Type>();
            string    query = "SELECT * FROM UNIT_TYPE ORDER BY ID";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                types.Add(RowToEntity(row));
            }
            return(types);
        }
Esempio n. 5
0
        public static List <Model.Data> GetAllChangelog()
        {
            List <Model.Data> Data  = new List <Model.Data>();
            string            query = "select * from Data order by id";
            DataTable         table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                Data.Add(RowToEntity(row));
            }
            return(Data);
        }
        public static List <string> GetAllJobTitles()
        {
            List <string> titles = new List <string>();
            string        query  = "SELECT Job_Title FROM JOB ORDER BY ID";
            DataTable     table  = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                titles.Add(row["Job_Title"].ToString());
            }
            return(titles);
        }
        public static List <Model.Customer> GetAllCustomers()
        {
            List <Model.Customer> customers = new List <Model.Customer>();
            string    query = "select * from customer order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                customers.Add(RowToEntity(row));
            }
            return(customers);
        }
        public static List <Model.Job> GetAllJobs()
        {
            List <Model.Job> jobs  = new List <Model.Job>();
            string           query = "SELECT * FROM JOB ORDER BY ID";
            DataTable        table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                jobs.Add(RowToEntity(row));
            }
            return(jobs);
        }
        public static List <Model.Food_Type> GetAllFood_Types()
        {
            List <Model.Food_Type> food_Types = new List <Model.Food_Type>();
            string    query = "select * from food_type order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                food_Types.Add(RowToEntity(row));
            }
            return(food_Types);
        }
        public static List <Model.POS_Purchase> GetPurchases(DateTime first, DateTime second)
        {
            List <Model.POS_Purchase> purchases = new List <Model.POS_Purchase>();
            string    query = "select * from pos_purchase where time between TO_DATE('" + first.ToString(string.Format("MM-dd-yyyy")) + "', 'mm-dd-yyyy') and TO_DATE('" + second.ToString(String.Format("MM-dd-yyyy")) + "', 'mm-dd-yyyy')";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                purchases.Add(RowToEntity(row));
            }
            return(purchases);
        }
        public static List <Model.Period> GetAllPeriods()
        {
            List <Model.Period> period = new List <Model.Period>();
            string    query            = "select * from PERIOD order by id";
            DataTable table            = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                period.Add(RowToEntity(row));
            }
            return(period);
        }
Esempio n. 12
0
        public static List <Model.Employee> GetAllEmployees()
        {
            List <Model.Employee> employees = new List <Model.Employee>();
            string    query = "select * from employee order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            foreach (DataRow row in table.Rows)
            {
                employees.Add(RowToEntity(row));
            }
            return(employees);
        }
Esempio n. 13
0
        public static List <Model.Order_Food> GetAllFoods()
        {
            List <Model.Order_Food> foods = new List <Model.Order_Food>();
            string    query = "select name, price, id from food where availability = 'Yes' order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            foods.Add(new Model.Order_Food {
            });                                  // taqui - patch
            foreach (DataRow row in table.Rows)
            {
                foods.Add(RowToEntity(row));
            }
            return(foods);
        }
Esempio n. 14
0
        public static List <Model.Food_Ingredient> GetUsedIngredients(int Id)
        {
            List <Model.Food_Ingredient> f_ingredients = new List <Model.Food_Ingredient>();
            string    query = "select fi.Ingredient_Id, i.Name, i.unit_cost, fi.Amount from ingredient i, food_ingredient fi where i.id = fi.ingredient_id and fi.food_id = " + Id;
            DataTable table = DB_Handler.GetDataTable(query);

            f_ingredients.Add(new Model.Food_Ingredient {
            });                                               // taqui - patch
            foreach (DataRow row in table.Rows)
            {
                f_ingredients.Add(RowToEntity(row));
            }
            return(f_ingredients);
        }
Esempio n. 15
0
        public static List <Model.Food_Ingredient> GetUnusedIngredients(int Id)
        {
            List <Model.Food_Ingredient> ingredients = new List <Model.Food_Ingredient>();
            string    query = "select i.id, i.name, i.unit_cost from ingredient i where i.id not in (select i.id from ingredient i, food_ingredient fi where i.id = fi.ingredient_id and fi.food_id = " + Id + ") order by i.id";
            DataTable table = DB_Handler.GetDataTable(query);

            ingredients.Add(new Model.Food_Ingredient {
            });                                             // taqui - patch
            foreach (DataRow row in table.Rows)
            {
                ingredients.Add(RowToEntity2(row));
            }
            return(ingredients);
        }
        public static List <Model.Purchase_Ingredient> GetAllIngredients()
        {
            List <Model.Purchase_Ingredient> ingredients = new List <Model.Purchase_Ingredient>();
            string    query = "select name, unit_cost, id from ingredient order by id";
            DataTable table = DB_Handler.GetDataTable(query);

            ingredients.Add(new Model.Purchase_Ingredient {
            });                                                 // taqui - patch
            foreach (DataRow row in table.Rows)
            {
                ingredients.Add(RowToEntity(row));
            }
            return(ingredients);
        }