Exemple #1
0
        /// <summary>
        /// les donnee concernant une salaire
        /// </summary>
        public PayrollCard(Payroll payroll)
        {
            PayrollGuid = payroll.PayrollGuid;
            Designation = payroll.Designation;
            IsPaid      = payroll.IsPaid;
            TotalSalary = 0;

            Employment employ;

            using (var db = new StationContext()) employ = db.Employments.Find(payroll.EmploymentGuid);

            var payrollStart = employ.SalaryRecurrence == InstallmentRecurrence.Once ? employ.StartDate.GetValueOrDefault()
                               : payroll.PaycheckDate.GetValueOrDefault().AddMonths(-((int)employ.SalaryRecurrence));

            switch (employ.PayType)
            {
            case PayType.HoursTaught:
                //TotalSalary=PayrollManager.StaticGetTeachingSalary(employ.StaffGuid, payrollStart, payroll.PaycheckDate, true);
                RenumerationsCards.Add(new ViewCard {
                    Info1 = "Heures Enseignées",
                    //Info2=StudyManager.StaticGetHoursTaught(employ.StaffGuid, payrollStart, payroll.PaycheckDate, true).TotalHoursMins(),
                    Info3 = TotalSalary.ToString("0.##", CultureInfo.CurrentCulture) + " dhs"
                });
                break;
                //case PayType.HoursWorked:
                //    TotalSalary=(payroll.HoursWorked.TotalMinutes*(employ.HourlyPay/60));
                //    RenumerationsCards.Add(new DataCard {
                //        Info1="Heures Travaillées",
                //        Info2=payroll.HoursWorked.TotalHoursMins(),
                //        Info3=TotalSalary.ToString("0.##", CultureInfo.CurrentCulture)+" dhs"
                //    });
                //    break;
            }

            foreach (var salary in PayrollManager.StaticGetSalaries(employ.EmploymentGuid, payrollStart, payroll.PaycheckDate))
            {
                RenumerationsCards.Add(new ViewCard(salary));
                TotalSalary += salary.Remuneration;
            }

            if (payroll.PaycheckDate > DateTime.Today)
            {
                TotalSalaryString = "Estimation: " + TotalSalary.ToString("0.##", CultureInfo.CurrentCulture) + " dhs";
            }
            else
            {
                TotalSalaryString = "Total: " + TotalSalary.ToString("0.##", CultureInfo.CurrentCulture) + " dhs";
            }

            if (!payroll.IsPaid)
            {
                return;
            }
            TotalSalary       = payroll.FinalPaycheck;
            TotalSalaryString = "Paid: " + TotalSalary.ToString("0.##", CultureInfo.CurrentCulture) + " dhs";
            NumeroReference   = "Ref: " + payroll.NumeroReference;
            Observations      = "Finance User (" + payroll.DatePaid.GetValueOrDefault().ToShortDateString() + ")"; //+" par "+payroll.PaymentMethode.GetEnumDescription();
            YesNoColor        = "Blue";
        }
Exemple #2
0
 private DBManager()
 {
     debits = new DebitsManager();
     employees = new EmployeeManager();
     extras = new ExtrasManager();
     locations = new LocationManager();
     operations = new OperationsManager();
     groups = new OperationsGroupManager();
     penalties = new PenaltiesManager();
     payrolls = new PayrollManager();
     roles = new RolesManager();
     salaries = new SalaryManager();
     users = new UsersManager();
     calls = new CallManager();
 }
Exemple #3
0
 public PayrollController(DataBaseContext dbContext)
 {
     this._payrollManager = new PayrollManager(dbContext);
 }