Exemple #1
0
        public List <Items> GetItemsBought()
        {
            // var groceryDataMapper = new GroceryDataMapper();
            var itemsBought = new List <Items>();
            int choice;
            var inventory = GroceryDataMapper.GetInventory();

            do
            {
                Console.WriteLine("choose from the list ");
                foreach (Inventory i in inventory)
                {
                    Console.WriteLine(i.item_id + " " + i.item_description);
                }
                Console.WriteLine("Input 0 if you are done selecting items");
                choice = Convert.ToInt32(Console.ReadLine());
                if (choice != 0)
                {
                    Items item        = new Items();
                    var   itemChoosed = inventory.FirstOrDefault(i => i.item_id == choice);
                    item.ItemName = itemChoosed.item_description;
                    Console.WriteLine("Provide the quantity");
                    item.ItemCount = Convert.ToInt32(Console.ReadLine());
                    item.ItemCost  = itemChoosed.cost;
                    item.CatId     = itemChoosed.Category_id;
                    item.ItemId    = itemChoosed.item_id;
                    itemsBought.Add(item);
                }
            }while (choice != 0);
            return(itemsBought);
        }
Exemple #2
0
        public void TotalSales()
        {
            var inventory = GroceryDataMapper.GetInventory();

            Console.WriteLine("Inventory list ");
            foreach (Inventory i in inventory)
            {
                Console.WriteLine(i.item_id + " " + i.item_description + " " + i.Quantity);
            }
        }
Exemple #3
0
        public string GetLoggedUserInfo()
        {
            //var groceryDataMapper = new GroceryDataMapper();
            Console.WriteLine("Please Enter the login details");
            Console.WriteLine("Enter login id");
            var userName = Console.ReadLine();

            Console.WriteLine("Enter Password ");
            var    uPass      = Console.ReadLine();
            string employeeId = GroceryDataMapper.ValidateUser(userName, uPass);

            if (!string.IsNullOrEmpty(employeeId))
            {
                Console.WriteLine("Welcome " + userName);
                return(employeeId);
            }
            else
            {
                return("");
            }
        }
Exemple #4
0
 public List <Items> SpecialDiscounts(List <Items> itemList)
 {
     return(GroceryDataMapper.ApplyDiscountAvailable(itemList));
 }
Exemple #5
0
 public void UpdateInventory(List <Items> itemList)
 {
     GroceryDataMapper.UpdateInventoryDetails(itemList);
 }
Exemple #6
0
 public void UpdateOrderTransactions(decimal amount, string eid)
 {
     GroceryDataMapper.RecordOrderTransactions(amount, eid);
 }