public void SetInterventionToEdit() { TotalInfoSelectedEl = new TotalsIfo() { TotalHours = -SelectedInterventionDetails.LocalIntervention.DateHourDetail.Duration, TotalInverventions = -1, TotalRevenue = -SelectedInterventionDetails.LocalIntervention.Revenue, TotalProfit = -SelectedInterventionDetails.LocalIntervention.Percent }; SelectedArea = SelectedInterventionDetails.LocalIntervention.Area != null?Areas.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.Area.Id) : null; if (SelectedInterventionDetails.LocalIntervention.Location != null) { SelectedLocation = LocalLocations.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.Location.Id); } if (SelectedInterventionDetails.LocalIntervention.Material != null && Materials != null) { SelectedMaterial = Materials.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.Material.Id); } SelectedPatient = PatientsList.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.PatientId); SelectedWork = SelectedInterventionDetails.LocalIntervention.Lucrare != null?Works.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.Lucrare.Id) : new LocalWork(); Durata = SelectedInterventionDetails.Durata.TotalMinutes.ToString(); Date = SelectedInterventionDetails.LocalIntervention.DateHourDetail.Date; StartingHour = SelectedInterventionDetails.LocalIntervention.DateHourDetail.StartHour; Revenue = SelectedInterventionDetails.LocalIntervention.Revenue; Id = SelectedInterventionDetails.LocalIntervention.Id; LocalIntervention = SelectedInterventionDetails.LocalIntervention; Observation = SelectedInterventionDetails.Observations; IsInEditMode = true; WasPayedByDental = SelectedInterventionDetails.WasPayedByDental; SelectedTechnician = Technicians.FirstOrDefault(item => item.Id == SelectedInterventionDetails.LocalIntervention.TechnicianId); MaterialCost = SelectedInterventionDetails.MaterialCost; }
public void OnChangeTotalInfo(TotalsIfo totalsIfo) { InterventionsGeneralDetailsViewModel.TotalHours += totalsIfo.TotalHours; InterventionsGeneralDetailsViewModel.TotalProfit += totalsIfo.TotalProfit; InterventionsGeneralDetailsViewModel.TotalRevenue += totalsIfo.TotalRevenue; InterventionsGeneralDetailsViewModel.TotalInverventions += totalsIfo.TotalInverventions; InterventionsGeneralDetailsViewModel.TotalPatients += totalsIfo.TotalPatients; }