Ejemplo n.º 1
0
        public void LoadPayroll(string id)
        {
            _payroll = _payrollBusiness.Get(id);

            Drivers.SelectedValue    = _payroll.Driver.Id;
            TruckNumber.Text         = _payroll.TruckNumber.ToString();
            Rate.Text                = _payroll.Rate.ToString("C");
            CheckPrint.IsChecked     = _payroll.PrintRegularHoursApartOvertime;
            FromPayment.SelectedDate = _payroll.From;
            ToPayment.SelectedDate   = _payroll.To;
            TotalHours.Text          = _payroll.TotalHours.ToString();
            RegularHour.Text         = _payroll.RegularHour.ToString();
            OvertimeHour.Text        = _payroll.OvertimeHour.ToString();
            Payment.Text             = _payroll.Payment.ToString("C");
            Deductions.Text          = _payroll.Deductions.ToString("C");
            DeductionsText.Text      = _payroll.DeductionsDetail;
            Reimbursements.Text      = _payroll.Reimbursements.ToString("C");
            ReimbursementsText.Text  = _payroll.ReimbursmentsDetail;
            TotalPayment.Text        = _payroll.TotalPayment.ToString("C");

            foreach (var item in _payroll.Details)
            {
                _details.Add(new PayrollDetailView()
                {
                    Hours        = item.Hours,
                    OilCompany   = item.OilCompany,
                    TicketDate   = item.Ticket.Date,
                    TicketNumber = item.Ticket.Number
                });
            }
        }
Ejemplo n.º 2
0
 public Payroll()
 {
     InitializeComponent();
     _payrollBusiness = new business.Payroll();
     _driverBusiness  = new business.Driver();
     _companyBusiness = new business.OilCompany();
     _details         = new ObservableCollection <PayrollDetailView>();
     _payroll         = new model.Payroll();
 }
Ejemplo n.º 3
0
        private static void PrintReport(model.Payroll payroll)
        {
            ICollection <model.Payroll> prints = new List <model.Payroll>();

            if (payroll.PrintRegularHoursApartOvertime)
            {
                prints = payroll.Prints;
            }
            else
            {
                prints.Add(payroll);
            }
            foreach (var item in prints)
            {
                PrintPayroll print = new PrintPayroll(item);
                print.Print(true);
            }
        }
Ejemplo n.º 4
0
        private void Clear()
        {
            _payroll = new model.Payroll();
            _details = new ObservableCollection <PayrollDetailView>();

            Drivers.SelectedItem     = null;
            TruckNumber.Text         = string.Empty;
            Rate.Text                = string.Empty;
            FromPayment.SelectedDate = null;
            ToPayment.SelectedDate   = null;
            TotalHours.Text          = string.Empty;
            RegularHour.Text         = string.Empty;
            OvertimeHour.Text        = string.Empty;
            Payment.Text             = string.Empty;
            Deductions.Text          = string.Empty;
            DeductionsText.Text      = string.Empty;
            Reimbursements.Text      = string.Empty;
            ReimbursementsText.Text  = string.Empty;
            TotalPayment.Text        = string.Empty;
            Details.ItemsSource      = _details;
        }
Ejemplo n.º 5
0
 private void SendEmail(model.Payroll payroll)
 {
     PayrollMail.Send(new PrintPayroll(payroll), (IEmail <model.Payroll>)_payrollBusiness, payroll);
 }