示例#1
0
        static void Delete(hmsbal worker)
        {
            try
            {
                Console.WriteLine("Enter ID to delete");

                int ID = int.Parse(Console.ReadLine());
                foreach (var item in worker.GetAll())
                {
                    // Console.WriteLine(item.RollNo);
                    if (ID == item.ID)
                    {
                        worker.Remove(ID);
                    }
                }
            }
            catch (WorkerNotFoundException ex1)
            {
                Console.WriteLine(ex1.Message);
            }
            catch (Exception ex2)
            {
                Console.WriteLine(ex2.Message);
            }
            //Worker wr = new Worker();
            //int ID = int.Parse(Console.ReadLine());
            //worker.Remove(ID);
        }
示例#2
0
        static void Display(hmsbal worker)
        {
            //student.GetAll();

            foreach (var item in worker.GetAll())
            {
                Console.WriteLine(item.ToString());
            }
        }
示例#3
0
 static void Display(hmsbal worker)
 {
     //student.GetAll();
     try
     {
         foreach (var item in worker.GetAll())
         {
             Console.WriteLine(item.ToString());
         }
     }
     catch (WorkerNotFoundException ex1)
     {
         Console.WriteLine(ex1.Message);
     }
     catch (Exception ex2)
     {
         Console.WriteLine(ex2.Message);
     }
 }
示例#4
0
        static void Modify(hmsbal worker)
        {
            //Student st = new Student();
            //student.Modify(st);

            Worker wr = new Worker();

            Console.WriteLine("Enter ID");
            int ID1 = int.Parse(Console.ReadLine());

            foreach (var item in worker.GetAll())
            {
                // Console.WriteLine(item.RollNo);
                if (ID1 == item.ID)
                {
                    wr = item;
                    worker.Modify(wr);
                }
            }
        }