Exemplo n.º 1
0
        public void InitSelectedItems()
        {
            Recipe  = Recipes.FirstOrDefault(r => r.RecipeId == Job.RecipeId);
            AgrYear = AgrYears.FirstOrDefault(ay => ay.AgrYearId == Job.AgrYearId);
            Field   = Fields.FirstOrDefault(f => f.FieldId == Job.FieldId);

            SourceFacility   = Facilities.FirstOrDefault(f => f.FacilityId == Job.SourceFacilityId);
            DestFacility     = Facilities.FirstOrDefault(f => f.FacilityId == Job.DestFacilityId);
            SourceTransport  = Transports.FirstOrDefault(t => t.TransportId == Job.SourceTransportId);
            DestTransport    = Transports.FirstOrDefault(t => t.TransportId == Job.DestTransportId);
            SourceApplicator = Applicators.FirstOrDefault(a => a.ApplicatorId == Job.SourceApplicatorId);
            DestApplicator   = Applicators.FirstOrDefault(a => a.ApplicatorId == Job.DestApplicatorId);

            SourceFacilityTanks   = GetFacilityTanks(SourceFacility);
            DestFacilityTanks     = GetFacilityTanks(DestFacility);
            SourceTransportTanks  = GetTransportTanks(SourceTransport);
            DestTransportTanks    = GetTransportTanks(DestTransport);
            SourceApplicatorTanks = GetApplicatorTanks(SourceApplicator);
            DestApplicatorTanks   = GetApplicatorTanks(DestApplicator);

            SourceFacilityTank   = SourceFacilityTanks?.FirstOrDefault(ft => ft.FacilityTankId == Job.SourceFacilityTankId);
            DestFacilityTank     = DestFacilityTanks?.FirstOrDefault(ft => ft.FacilityTankId == Job.DestFacilityTankId);
            SourceTransportTank  = SourceTransportTanks?.FirstOrDefault(tt => tt.TransportTankId == Job.SourceTransportTankId);
            DestTransportTank    = DestTransportTanks?.FirstOrDefault(tt => tt.TransportTankId == Job.DestTransportTankId);
            SourceApplicatorTank = SourceApplicatorTanks?.FirstOrDefault(at => at.ApplicatorTankId == Job.SourceApplicatorTankId);
            DestApplicatorTank   = DestApplicatorTanks?.FirstOrDefault(at => at.ApplicatorTankId == Job.DestApplicatorTankId);
        }
Exemplo n.º 2
0
        private void AddNewFacilitySubscription()
        {
            SelectedSubscription = null;
            SelectedFacility     = null;

            SelectedFacilitySubscription = new FacilitySubscriptionDTO();

            SelectedSubscription = Subscriptions.FirstOrDefault();
            SelectedFacility     = Facilities.FirstOrDefault();
        }