Пример #1
0
 public bool CheckIfInferAvail( )
 {
     if (info == null)
     {
         this.info = new Group_attribs(this.group_id);
     }
     return(info.InfAvail());
 }
Пример #2
0
        public Worker(Worker worker, Group_attribs info)
        {
            this.id           = worker.id;
            this.name         = worker.name;
            this.recruit_date = worker.recruit_date;
            this.remove_date  = worker.remove_date;
            this.group_id     = worker.group_id;
            this.base_salary  = worker.base_salary;

            this.info = info;
        }
Пример #3
0
        public Group_attribs(int group_id) // мб стоит передать объект  ApplicationContext - ?
        {
            dbInfo = new ApplicationContext();
            Group_attribs info = dbInfo.Group_attribs.Find(group_id);

            this.text       = info.text;
            this.year_ratio = info.year_ratio;
            this.max_ratio  = info.max_ratio;
            this.inf_ratio  = info.inf_ratio;
            this.inf_avail  = info.inf_avail;
        }
Пример #4
0
        public static Worker GetRightObgById(int id, ApplicationContext db)
        {
            Worker        worker = new Worker(id, db);
            Group_attribs info   = new Group_attribs(worker.group_id);

            if (info.InfAvail() == false)
            {
                return(new WorkerWithoutInf(worker, info));
            }
            else
            {
                return(new WorkerWithInf(worker, info));
            }
        }
Пример #5
0
        public decimal GetYearsRatio(DateTime datetime)
        {
            // в зависимости от стажа на данной должности рассчитаем yearsRatio:
            // 1 получить из info year_ratio; max_ratio
            // 2 получить количество отработанных полных лет НА ДАТУ!
            if (info == null)
            {
                this.info = new Group_attribs(this.Group_id);
            }
            var year_base = info.Year_ratio;
            var max_ratio = info.Max_ratio;
            var years     = GetWorkerYears(datetime);

            return(Utils.CalcFromBaseToMax(years, year_base, max_ratio));
        }
Пример #6
0
        public Group_attribs GetByGroupId(int group_id)
        {
            Group_attribs info = db.Group_attribs.Find(group_id);

            return(info);
        }
Пример #7
0
 public WorkerWithInf(Worker worker, Group_attribs info) : base(worker, info)
 {
 }