Example #1
0
        public MainForm()
        {
            InitializeComponent();
            Settings = new Settings();
            //Repository = new PasswordActionRepository(Settings);
            Context = new PasswordActionContext();
            AuthenticationController = new AuthenticationController(Context, Settings);

            InputController = new InputController(Settings);

            Init();
        }
Example #2
0
        protected override void Init()
        {
            eveninigTime         = new TimeSpan(18, 0, 0);
            morningTime          = new TimeSpan(6, 0, 0);
            daytimePasswords     = new PasswordActionContext();
            eveningtimePasswords = new PasswordActionContext();
            LoadData();

            DaytimeStatistics     = new VelocityStatistics(daytimePasswords.PasswordActions.Local);
            EveningtimeStatistics = new VelocityStatistics(eveningtimePasswords.PasswordActions.Local);
            base.Init();
        }
Example #3
0
        protected override void ReloadData()
        {
            daytimePasswords     = new PasswordActionContext();
            eveningtimePasswords = new PasswordActionContext();
            LoadData();

            DaytimeStatistics.ChangeCollection(daytimePasswords.PasswordActions.Local);
            EveningtimeStatistics.ChangeCollection(eveningtimePasswords.PasswordActions.Local);

            UpdateChart();
            UpdateLablesGroupBox();
        }
        public PasswordActionRepository(Settings settings)
        {
            database = new PasswordActionContext();
            Settings = settings;
            database.PasswordActions.Include(passAct => passAct.SymbolActions);
            database.Users.Load();
            PasswordActions = database.PasswordActions.Local;
            database.PasswordActions.Include(passAct => passAct.SymbolActions).Where(passAct => passAct.UserId == this.Settings.User.Id).Load();
            database.PasswordActions.Where(passAct => passAct.UserId == this.Settings.User.Id).
            //PasswordActions = database.PasswordActions.Local.ToBindingList();
            Users = database.Users.Local;
            //UpdatePasswordAtions();
            //UpdateUsers();

            AbstractGroup passwordActionsGroup = new PasswordActionsGroup(PasswordActions);
            GroupBuilder  groupBuilder         = new GroupBuilder(passwordActionsGroup);
            GroupBuilder  userGroupBuilder     = groupBuilder.AppendGroup(passAct => passAct.UserId == this.Settings.User.Id);
            //повторяем для всех пользователей
            GroupBuilder samePasswordsGroupBuilder = userGroupBuilder.AppendGroup(passAct => passAct.ValidPassword == this.Settings.Password);

            //повторяем для всех паролей
            samePasswordsGroupBuilder.AppendGroupLeaf()
        }