public bool CheckIfInferAvail( ) { if (info == null) { this.info = new Group_attribs(this.group_id); } return(info.InfAvail()); }
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; }
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; }
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)); } }
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)); }
public Group_attribs GetByGroupId(int group_id) { Group_attribs info = db.Group_attribs.Find(group_id); return(info); }
public WorkerWithInf(Worker worker, Group_attribs info) : base(worker, info) { }