private void Delete_Click(object sender, RoutedEventArgs e) { var id = ((Button)sender).Tag.ToString(); var user = _userBusiness.Get(id); DeleteView(user); }
private void Delete_Click(object sender, RoutedEventArgs e) { var id = ((Button)sender).Tag.ToString(); var employee = _employeeBusiness.Get(id); DeleteView(employee); }
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 }); } }
private void Delete_Click(object sender, RoutedEventArgs e) { var id = ((Button)sender).Tag.ToString(); var company = _companyBusiness.Get(id); DeleteView(company); }
public void SaveView() { if (IsViewValid()) { ChangeControlsEnabled(false); LeaseCompany company = new LeaseCompany() { Id = _idCompanySelected, Name = Name.Text, Email = Email.Text }; _trucksView.Where(x => x.IsActive) .ToList() .ForEach(x => company.Trucks.Add(_truckBusiness.Get(x.Id))); _companyBusiness.Update(company); MessageBox.Show("The information was correctly saved!", "Save", MessageBoxButton.OK, MessageBoxImage.Information); ClearView(); FillGrid(); } else { MessageBox.Show(ValidationMessage, "Validations", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void LoadPayroll(string id) { _payrollLeaseCompany = _payrollLeaseCompanyBusiness.Get(id); _percentLeaseFeeValue = _payrollLeaseCompany.PercentLeaseFeeValue; _percentWorkerCompValue = _payrollLeaseCompany.PercentWorkerCompValue; LeaseCompanies.SelectedValue = _payrollLeaseCompany.LeaseCompany.Id; Trucks.SelectedValue = _payrollLeaseCompany.Truck.Id; Date.SelectedDate = _payrollLeaseCompany.Date; FromPayment.SelectedDate = _payrollLeaseCompany.From; ToPayment.SelectedDate = _payrollLeaseCompany.To; PercentLeaseFeeValue.Text = _percentLeaseFeeValue.ToString(); PercentWorkerCompValue.Text = _percentWorkerCompValue.ToString(); Total.Text = _payrollLeaseCompany.Total.ToString("C"); if (_rates.Count == 0) { foreach (var rate in _payrollLeaseCompany.Rates) { _rates.Add(new RateDetail() { Companies = rate.Companies, Hours = rate.Hours, Rate = rate.Rate }); } } _details.Clear(); foreach (var detail in _payrollLeaseCompany.Details) { _details.Add(new PayrollLeaseCompanyDetails() { IsEnabled = !detail.Item.Contains("Diesel"), Item = detail.Item, Value = detail.Value }); } foreach (var deduction in _payrollLeaseCompany.Deductions) { _deductions.Add(new GenericCollection() { Item = deduction.Item, Value = deduction.Value }); } foreach (var reimbursements in _payrollLeaseCompany.Reimbursements) { _reimbursements.Add(new GenericCollection() { Item = reimbursements.Item, Value = reimbursements.Value }); } }
public void LoadPayroll(string id) { _payroll = _payrollBusiness.Get(id); Employees.SelectedValue = _payroll.Employee.Id; FromPayment.SelectedDate = _payroll.From; ToPayment.SelectedDate = _payroll.To; TotalHours.Text = _payroll.TotalHours.ToString(); Payment.Text = _payroll.PaymentTotalHours.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"); }