public GeneralSettingView(GeneralSettings gSetting, MainPipeSettings pipe)
 {
     Status     = (StatusType)gSetting.Status;
     UseMaster  = pipe.UseMaster;
     TimeZoneID = gSetting.CustomTimeZoneID;
     ValidDays  = new ValidDaysView(pipe);
 }
Example #2
0
        public DeviceSettingTitleView(FertilizerSetting fert,
                                      WaterMeterSetting waterMeter,
                                      GeneralSettings setting,
                                      MainPipeSettings MainPipe,
                                      ZoneSetting[] zonelist)
        {
            if (setting != null)
            {
                LandTypeID     = (LandType)setting.LandTypeID;
                IsAdvancedFert = setting.Flag_AdvancedFert;
            }

            if (zonelist != null)
            {
                Zones = zonelist.Select(z => new ZoneInfoView()
                {
                    Color   = z.ZoneColor,
                    Name    = z.Name,
                    ZoneNum = z.OutputNumber,
                    Precipitation_AllowDuration = z.PrecipitationRate != null && z.PrecipitationRate > 0,
                    Precipitation_AllowQuantity = z.IrrigrationArea != null && z.IrrigrationArea > 0
                }
                                        ).ToArray();
            }
            Fertilizer = new FertilizerSettingView(fert);
            WaterMeter = new WaterMeterSettingView(waterMeter);
            ValidDays  = new ValidDaysView(MainPipe);
        }