Ejemplo n.º 1
0
        public PresenterFishingRecordEdit(IViewFishingRecord inView, int inRecordIndex) : base(inView)
        {
            _recordIndex = inRecordIndex;
            FishingRecord record = FishingRecordRepository.GetInstance().GetRecord(inRecordIndex);

            _fishCatch = record.FishCatch;

            // set record details on view
            _view.DateTimeStart = record.DateTimeInterval.Start;
            _view.DateTimeEnd   = record.DateTimeInterval.End;
            _view.Location      = record.Location.Name;
            _view.Wind          = CommonPresenterStuff.GetWindStrings()[(int)record.NatureContex.Wind];
            _view.MoonPhase     = CommonPresenterStuff.GetMoonPhaseStrings()[(int)record.NatureContex.MoonPhase];
            _view.Tide          = CommonPresenterStuff.GetTideStrings()[(int)record.NatureContex.Tide];
            foreach (string fish in record.FishCatch.GetCaughtFish())
            {
                _view.AddFishCatch(fish, record.FishCatch.GetCaughtFishMass(fish));
            }
            foreach (string fish in record.FishCatch.GetSoldFish())
            {
                _view.AddFishSale(fish, record.FishCatch.GetSoldFishMass(fish), record.FishCatch.GetSoldFishPrice(fish));
            }

            _view.SetFinishButtonText("Save changes");
        }
Ejemplo n.º 2
0
 private void SetPossibleSearchValues()
 {
     _view.Years      = Search.GetYears();
     _view.Months     = Search.GetMonths();
     _view.Locations  = LocationRepository.GetInstance().GetLocationNames();
     _view.Winds      = CommonPresenterStuff.GetWindStrings();
     _view.MoonPhases = CommonPresenterStuff.GetMoonPhaseStrings();
     _view.Tides      = CommonPresenterStuff.GetTideStrings();
 }
Ejemplo n.º 3
0
        public PresenterFishingRecord(IViewFishingRecord inView)
        {
            _view = inView;

            // fill view with data
            _view.Locations  = LocationRepository.GetInstance().GetLocationNames();
            _view.Winds      = CommonPresenterStuff.GetWindStrings();
            _view.MoonPhases = CommonPresenterStuff.GetMoonPhaseStrings();
            _view.Tides      = CommonPresenterStuff.GetTideStrings();
        }