public List <InventoryUtility.Wheats> RemoveFromInventory(List <InventoryUtility.Wheats> wheats) { InventoryUtility.Wheats utility = new InventoryUtility.Wheats(); Console.WriteLine("enter Name of wheats to be deleted:"); string Name = Console.ReadLine(); wheats.Remove(wheats.Find(ut => ut.Name.Equals(Name))); return(wheats); }
public List <InventoryUtility.Pulse> RemoveFromInventory(List <InventoryUtility.Pulse> pulse) { InventoryUtility.Wheats utility = new InventoryUtility.Wheats(); Console.WriteLine("enter Name of pulse to be deleted:"); string Name = Console.ReadLine(); pulse.Remove(pulse.Find(ut => ut.Name.Equals(Name))); return(pulse); }
public List <InventoryUtility.Wheats> AddToInventory(List <InventoryUtility.Wheats> wheats) { InventoryUtility.Wheats utility = new InventoryUtility.Wheats(); Console.WriteLine("enter Name of wheats:"); utility.Name = Console.ReadLine(); Console.WriteLine("enter price of wheats:"); utility.Price = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter weight in kg of wheats:"); utility.Kg = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter type of wheats:"); utility.Type = Console.ReadLine(); wheats.Add(utility); return(wheats); }
public void DisplayInventory(List <InventoryUtility.Wheats> wheats) { Console.WriteLine("*****************************Wheats Inventory**********************************"); string wheatString = string.Empty; int totalInventoryWheats = 0; //// iterates WheatsList by InventoryUtility.Wheats data type for (int i = 0; i < wheats.Count; i++) { InventoryUtility.Wheats c = wheats[i]; wheatString = "\nIndex=" + i + "\nname= " + c.Name + "\nweight= " + c.Kg + "\nPrice= " + c.Price + "\ntype= " + c.Type; totalInventoryWheats += ManageInventory(c.Kg, c.Price); Console.WriteLine(wheatString); } Console.WriteLine("\nTotal inventory rice cost:" + totalInventoryWheats); }
public List <InventoryUtility.Wheats> UpdateToInventory(List <InventoryUtility.Wheats> wheats) { InventoryUtility.Wheats utility = new InventoryUtility.Wheats(); Console.WriteLine("enter Name of wheats to be updated:"); string Name = Console.ReadLine(); wheats.Remove(wheats.Find(ut => ut.Name.Equals(Name))); Console.WriteLine("enter Name of wheats :"); utility.Name = Console.ReadLine(); Console.WriteLine("enter price of wheats:"); utility.Price = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter weight in kg of wheats:"); utility.Kg = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("enter type of wheats:"); utility.Type = Console.ReadLine(); wheats.Add(utility); return(wheats); }