Пример #1
0
 public Employer(string Name, int Age, DateTime DateIn, prof Prof, int Salary)
 {
     this.Name   = Name;
     this.Age    = Age;
     this.DateIn = DateIn;
     this.Prof   = Prof;
     this.Salary = Salary;
 }
Пример #2
0
 public Employee(string Name, int Age, DateTime DateOfStart, int Salary, prof prof)
 {
     this.Name        = Name;
     this.Age         = Age;
     this.DateOfStart = DateOfStart;
     this.Salary      = Salary;
     this.prof        = prof;
 }
Пример #3
0
 public Employer(string name, int age, DateTime dateofStart, int salary, prof P)
 {
     Name        = name;
     Age         = age;
     Salary      = salary;
     DateOfStart = dateofStart;
     Salary      = salary;
     Prof        = P;
 }
        public List <Employee> FindManager(prof p)
        {
            var             g        = employers.Where(w => w.prof == p).Sum(s => s.Salary);//коллекция
            int             c        = employers.Where(w => w.prof == p).Count();
            double          avg      = g / c;
            List <Employee> Managers =
                employers.Where(w => w.prof == prof.Manager && w.Salary > avg).ToList();

            return(Managers.OrderBy(o => o.Name).ToList());
        }
Пример #5
0
        public List <Employer> Find(prof p)
        {
            int    g   = employers.Where(w => w.Prof == p).Sum(s => s.Salary);
            int    c   = employers.Where(w => w.Prof == p).Count();
            double avg = g / c;

            List <Employer> Managers = employers.Where(w => w.Prof == prof.manager && w.Salary >= avg).ToList();

            return(Managers.OrderBy(o => o.Name).ToList());
        }
Пример #6
0
        public List <Employer> FindManger(prof x)
        {
            int g = employers.Where(w => w.Prof == x).Sum(s => s.Salary);

            int c = employers.Where(w => w.Prof == x).Count();

            double avg = g / c;

            List <Employer> managers = employers.Where(w => w.Prof == prof.manager && w.Salary > avg).ToList();

            return(managers.OrderBy(o => o.Name).ToList());//сортировка по имени
        }