Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            DateTime D1   = new DateTime(2020, 4, 4);
            DateTime D2   = new DateTime(2021, 4, 4);
            Employee Ivan = new Employee(10000, D1, D2, 20);
            HC       hc   = new HC(0.1, 1);

            Formula_Adv(Ivan, hc, new DateTime(2021, 4, 4));
        }
Ejemplo n.º 2
0
        static void Formula_Adv(Employee emp, HC hc, DateTime DE)
        {
            double Prc       = hc.get_AdvPrc();
            bool   UseAdvDay = false;

            if (Prc == 0)
            {
                return;
            }
            if (UseAdvDay == true)
            {
                emp.set_DayEnd(DE);
            }
            DateTime Ade = emp.Emp("day_end");

            if (Ade < emp.Emp("day_end"))
            {
                return;
            }

            int WD = emp.WorkDays();

            int MinWDays = hc.get_MinWDays();

            if (WD < MinWDays)
            {
                return;
            }

            int Salary = emp.GetSalary();
            int PD     = emp.PlanDays();

            double result = Salary / PD * WD * Prc / 100;

            Console.WriteLine(result);
        }