Esempio n. 1
0
        public List <InventoryUtility.Pulse> AddToInventory(List <InventoryUtility.Pulse> pulses)
        {
            InventoryUtility.Pulse utility = new InventoryUtility.Pulse();

            Console.WriteLine("enter Name of pulse:");
            utility.Name = Console.ReadLine();
            Console.WriteLine("enter price of pulse:");
            utility.Price = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter weight in kg of pulse:");
            utility.Kg = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter type of pulse:");
            utility.Type = Console.ReadLine();
            pulses.Add(utility);
            return(pulses);
        }
Esempio n. 2
0
        public List <InventoryUtility.Pulse> UpdateToInventory(List <InventoryUtility.Pulse> pulses)
        {
            InventoryUtility.Pulse utility = new InventoryUtility.Pulse();
            Console.WriteLine("enter Name of pulse to be updated:");
            string Name = Console.ReadLine();

            pulses.Remove(pulses.Find(ut => ut.Name.Equals(Name)));
            Console.WriteLine("enter Name of pulse :");
            utility.Name = Console.ReadLine();
            Console.WriteLine("enter price of pulse:");
            utility.Price = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter weight in kg of pulse:");
            utility.Kg = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter type of pulse:");
            utility.Type = Console.ReadLine();
            pulses.Add(utility);
            return(pulses);
        }