コード例 #1
0
ファイル: Program.cs プロジェクト: linhbon96/librarymanage
        static void Input(List <manage> list)
        {
            manage ul = new manage();

            ul.BorrowaBook();
            list.Add(ul);
        }
コード例 #2
0
        public void BorrowaBook(List <book> allBooks, List <Member> allmembers)
        {
            manage mn = new manage();

            mn.ID = BID++;

            Console.Write("Member:");
            int    memberID = int.Parse(Console.ReadLine());
            Member member   = Program.SearchMemberByID(Member.Equals(memberID));


            Console.Write("Name of book:");
            string book = Console.ReadLine();



            Console.Write("Borrow date: ");
            DateTime bdt;

            while (!DateTime.TryParse(Console.ReadLine(), out bdt))
            {
                Console.Write("Re enter  date:");
            }
            mn.borrowdate = bdt;


            Console.Write("Return date: ");
            DateTime rdt;

            while (!DateTime.TryParse(Console.ReadLine(), out rdt))
            {
                Console.Write("Re enter date:");
            }
            mn.returndate = rdt;



            Console.Write("Deposit: ");
            mn.deposit = double.Parse(Console.ReadLine());


            Console.Write("Cost:");
            mn.cost = double.Parse(Console.ReadLine());



            Console.Write("Quantity:");
            mn.quantity = int.Parse(Console.ReadLine());
        }