public ViewRegistryPresenter(IViewRegistryView view, ISessionProvider sessionProvider) { if (view == null) { throw new ArgumentNullException("Widok nie mo¿e mieæ wartoœci null"); } this.view = view; this.service = new ViewRegistryTask(); this.session = sessionProvider; subscribeToEvents(); view.IsCurrentDailyLogDef = true; if (view.RegistryID == 0) { registryId = service.GetCurrentRegistryId(1, DateTime.Today.Year); if (registryId == 0) { view.IsCurrentDailyLogDef = false; } view.RegistryID = registryId; } else { registryId = view.RegistryID; } session["registryId"] = registryId; }