Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            englishContext = new EnglishContext();

            ShowVerbs.Click       += (s, e) => { ShowList_Click(englishContext.Verbs); };
            ShowPronouns.Click    += (s, e) => { ShowList_Click(englishContext.Pronouns); };
            LearnFirstSheme.Click += LearnFirstSheme_Click;

            LearnVerbs.Click    += LearnVerbs_Click;
            LearnPronouns.Click += LearnPronouns_Click;

            //Priz();
        }
Ejemplo n.º 2
0
        public LearnFirstScheme(EnglishContext englishContext)
        {
            InitializeComponent();
            this.englishContext = englishContext;

            SelectAllWordWhatsNotLearned();



            Next.Click   += (s, e) => { Next_Click(); };;
            Helped.Click += (s, e) => { Helped_Click(); };
            Answer.Click += (s, e) => { Answer_Click(); };
            KeyDown      += LearnFirstScheme_KeyDown;
            Fall.Click   += (s, e) => { Fall_Click(); };
        }
Ejemplo n.º 3
0
        public static void SetupDatabase(EnglishContext db)
        {
            db.Database.EnsureCreated();

            if (db.Users.Count() == 0)
            {
                db.Users.Add(new Users()
                {
                    Name = "user01"
                });
            }

            var q = new[] { 1, 2, 3 };

            var qaList = new[] {
                new { Q = "Hello World", A = "Olá Mundo" },
                new { Q = "How old are you?", A = "Quantos anos você tem?" },
                new { Q = "What is your name?", A = "Qual é o seu nome?" }
            };

            if (db.Phrases.Count() == 0)
            {
                foreach (var qa in qaList)
                {
                    var phrase = new Phrases()
                    {
                        Text = qa.Q
                    };
                    var translation = new Translations()
                    {
                        Text = qa.A, Phrase = phrase
                    };

                    db.Translations.Add(translation);
                    db.SaveChanges();
                }
            }

            db.SaveChanges();
        }
Ejemplo n.º 4
0
 public BaseRepository(EnglishContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAnkiServices anki, EnglishContext db)
        {
            SetupDatabase(db);

            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            app.UseDefaultFiles();


            // Test Environment
            if (env.IsEnvironment("Test"))
            {
                app.UseStaticFiles(new StaticFileOptions()
                {
                    FileProvider = new PhysicalFileProvider(
                        Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\tests")),
                    RequestPath = new PathString("")
                });
            }

            app.UseStaticFiles();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "EnglishPhrases v1");
            });

            app.UseMvc();
        }
Ejemplo n.º 6
0
 public UserRepository(EnglishContext context) : base(context)
 {
 }
Ejemplo n.º 7
0
 public ResetController(EnglishContext db)
 {
     this._db = db;
 }
 public DictionaryRepository(EnglishContext context) : base(context)
 {
 }
Ejemplo n.º 9
0
 public PhrasesController(EnglishContext db)
 {
     this._db = db;
 }
Ejemplo n.º 10
0
 public SubsectionRepository(EnglishContext context) : base(context)
 {
 }
Ejemplo n.º 11
0
 public AnkiServices(EnglishContext db)
 {
     this._db = db;
 }
Ejemplo n.º 12
0
 public SectionRepositoryTests(EnglishContext context)
 {
     _context = context;
 }
Ejemplo n.º 13
0
 public ValuesController(EnglishContext db)
 {
     this._db = db;
 }
Ejemplo n.º 14
0
 public DictionaryWordRepository(EnglishContext context)
 {
     _context = context;
 }
Ejemplo n.º 15
0
 public ExerciseRepository(EnglishContext context) : base(context)
 {
     _context = context;
 }
Ejemplo n.º 16
0
 public AnswerRepository(EnglishContext context) : base(context)
 {
     _context = context;
 }
Ejemplo n.º 17
0
 public WordRepository(EnglishContext context) : base(context)
 {
 }
Ejemplo n.º 18
0
 public RepositoryManager(EnglishContext context)
 {
     _context = context;
 }
Ejemplo n.º 19
0
 public EnglishItemsController(EnglishContext context)
 {
     _context = context;
 }