Exemple #1
0
    static void Main()
    {
        string E_name;
        string E_departmentname;
        int    E_id;

        Console.WriteLine("Enter Empployee name");
        E_name = Console.ReadLine();
        Console.WriteLine("Enter Empployee Departmentname");
        E_departmentname = Console.ReadLine();
        Console.WriteLine("Enter Empployee Id");
        E_id = Convert.ToInt32(Console.ReadLine());

        Employee                   emp1 = new Employee(E_name, E_departmentname, E_id);
        Getnamecalleddel           GNC  = new Getnamecalleddel(emp1.Getnamecalled);
        Getdepartmentnamecalleddel GDC  = new Getdepartmentnamecalleddel(emp1.Getdepartmentnamecalled);
        GetIdcalleddel             GIC  = new GetIdcalleddel(emp1.GetIdcalled);

        emp1.Getname(GNC);
        emp1.GetId(GIC);
        emp1.Getdepartmentname(GDC);

        string EU_name;
        string EU_departmentname;
        int    EU_id;

        Console.WriteLine("Enter new name for employee ");
        EU_name = Console.ReadLine();
        Console.WriteLine("Enter new department for  Empployee ");
        EU_departmentname = Console.ReadLine();
        Console.WriteLine("Enter new id for Empployee");
        EU_id = Convert.ToInt32(Console.ReadLine());


        emp1.Getname(EU_name);
        emp1.GetId(EU_id);
        emp1.Getdepartmentname(EU_departmentname);
    }
Exemple #2
0
 public void GetId(GetIdcalleddel obj)
 {
     obj();
     Console.WriteLine("Employee Id is:" + id);
 }