Exemplo n.º 1
0
 public JobsController(
     FeaturesDbContext context,
     UserManager <User> userManager,
     IBaseService baseService,
     IJobsService jobsService,
     ICategoriesService categoriesService,
     ILocationService locationService,
     ISkillsService skillsService,
     ILanguageService langService,
     ICompanyService companyService,
     IFavoritesService favoriteService,
     INotificationService notifyService,
     IToastNotification toastNotification,
     IResumeService resumeService)
 {
     _context           = context;
     _userManager       = userManager;
     _baseService       = baseService;
     _jobsService       = jobsService;
     _locationService   = locationService;
     _skillsService     = skillsService;
     _langService       = langService;
     _categoriesService = categoriesService;
     _companyService    = companyService;
     _favoriteService   = favoriteService;
     _notifyService     = notifyService;
     _toastNotification = toastNotification;
     _resumeService     = resumeService;
 }
Exemplo n.º 2
0
        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Company>();

            for (int i = 0; i < 50000; i++)
            {
                test = new List <Company>
                {
                    new Company
                    {
                        Title           = "test Company",
                        isApproved      = ApproveType.Success,
                        PosterId        = "da3bb2af-d040-4b34-aa04-9edcfe117e80",
                        Adress          = "Младост 4",
                        PhoneNumber     = "13123 13213",
                        Date            = DateTime.Now,
                        LocationId      = "София",
                        About           = "sexsexsexsex",
                        Email           = "*****@*****.**",
                        Private         = false,
                        isAuthentic_EIK = true
                    }
                };
                dbContext.Company.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 3
0
        /*public async Task<ContestantViewModel> GetByPosterId(string id)
         * {
         *  var ent = await contestantRepository.Set()
         *      .Where(p => p.PosterID == id)
         *      .To<ContestantViewModel>()
         *      .FirstOrDefaultAsync();
         *
         *  return null;
         * }
         * public async Task<bool> IsValid(int Id)
         * {
         *  var ent = await this.contestantRepository.Set().AnyAsync(x => x.Id == Id);
         *
         *  return ent;
         * }
         */

        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Contestant>();

            for (int i = 0; i < 50000; i++)
            {
                test = new List <Contestant>
                {
                    new Contestant
                    {
                        FullName         = "test Performace",
                        About            = "I am a 28-year-old professional with over 8 years of experience working in advertising agencies both.",
                        Age              = DateTime.Now,
                        Description      = "I am a 28-year-old professional with over 8 years of experience working in advertising agencies both as a graphic designer and as a content writer. I was born in Curitiba, Brazil, where I got a degree in Advertising at Universidade Positivo before moving to Toronto, Canada, where I lived for a year.",
                        SalaryType       = SalaryType.month,
                        Experience       = 2,
                        Genders          = Gender.Male,
                        CategoryId       = 2,
                        userSkillsId     = "1,5,1999,2222,2212,1111,2044,2043",
                        profileVisiblity = 0,
                        isApproved       = ApproveType.Success,
                        isArchived       = false,
                        CreatedOn        = DateTime.Now,
                        ExpiredOn        = DateTime.Now.AddMonths(1),
                        PosterID         = "da3bb2af-d040-4b34-aa04-9edcfe117e80"
                    }
                };
                dbContext.Contestant.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 4
0
        public MessageApiController(
            BaseDbContext contextBase,
            FeaturesDbContext contextFeatures,
            IConfiguration config)
        {
            this._config = config;

            this._contextBase     = contextBase ?? throw new ArgumentNullException(nameof(contextBase));
            this._contextFeatures = contextFeatures ?? throw new ArgumentNullException(nameof(contextFeatures));
        }
Exemplo n.º 5
0
        public JobsService(
            IRepository <Jobs> jobsRepository,
            ICompanyService companyService,
            INotificationService notifyService,
            FeaturesDbContext _context)
        {
            this.jobsRepository = jobsRepository;
            _companyService     = companyService;
            _notifyService      = notifyService;


            //   this.SeedTest(_context);
        }
Exemplo n.º 6
0
        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Company>();

            for (int i = 0; i < 100000; i++)
            {
                test = new List <Company>
                {
                    new Company
                    {
                        Title      = "test",
                        isApproved = 2
                    }
                };
                dbContext.Company.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 7
0
        public async Task SeedSkills(FeaturesDbContext dbContext)
        {
            var skills = new List <Skills>();

            string[] lines = System.IO.File.ReadAllLines(@"C:\Users\iNexus\Documents\source\repos\HireMe\HireMe\Skills.txt");

            foreach (string line in lines)
            {
                skills = new List <Skills>
                {
                    new Skills
                    {
                        Title = line
                    }
                };
                await dbContext.Skills.AddRangeAsync(skills);
            }

            await dbContext.SaveChangesAsync();
        }
Exemplo n.º 8
0
        public async Task SeedLocation(FeaturesDbContext dbContext)
        {
            var location = new List <Location>();

            string[] lines = System.IO.File.ReadAllLines(@"C:\Users\iNexus\Documents\source\repos\HireMe\HireMe\Location.txt");

            foreach (string line in lines)
            {
                location = new List <Location>
                {
                    new Location
                    {
                        City = line
                    }
                };
                await dbContext.Location.AddRangeAsync(location);
            }

            await dbContext.SaveChangesAsync();
        }
Exemplo n.º 9
0
        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Contestant>();

            for (int i = 0; i < 100000; i++)
            {
                test = new List <Contestant>
                {
                    new Contestant
                    {
                        Name       = "test",
                        CategoryId = 3,
                        isApproved = 2
                    }
                };
                dbContext.Contestant.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 10
0
        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Jobs>();

            for (int i = 0; i < 50000; i++)
            {
                test = new List <Jobs>
                {
                    new Jobs
                    {
                        //Id = i,
                        CategoryId = 12,
                        CompanyId  = 5,
                        Name       = "Test for backround task",
                        //WorkType = Entities.Enums.WorkType.Full,
                        ExprienceLevels = Entities.Enums.ExprienceLevels.Beginner,
                        Description     = "testt",
                        LocationId      = "София",
                        LanguageId      = null,
                        MinSalary       = 11,
                        MaxSalary       = 111,
                        SalaryType      = Entities.Enums.SalaryType.day,
                        Adress          = "test",
                        TagsId          = null,
                        PosterID        = "da3bb2af-d040-4b34-aa04-9edcfe117e80",
                        CreatedOn       = DateTime.Now,
                        ExpiredOn       = DateTime.Now.AddMonths(1),
                        Promotion       = Entities.Enums.PromotionEnum.Default,
                        isApproved      = ApproveType.Success,
                        isArchived      = false
                    }
                };
                dbContext.Jobs.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 11
0
        public void SeedTest(FeaturesDbContext dbContext)
        {
            var test = new List <Jobs>();

            for (int i = 0; i < 100000; i++)
            {
                test = new List <Jobs>
                {
                    new Jobs
                    {
                        //Id = i,
                        CategoryId = 1,
                        CompanyId  = 1,
                        Name       = "Test2",
                        //WorkType = Entities.Enums.WorkType.Full,
                        ExprienceLevels = Entities.Enums.ExprienceLevels.Beginner,
                        Description     = "testt",
                        LocationId      = 1,
                        Visiblity       = Entities.Enums.Visiblity.Public,
                        LanguageId      = null,
                        MinSalary       = 11,
                        MaxSalary       = 111,
                        SalaryType      = Entities.Enums.SalaryType.day,
                        Adress          = "test",
                        TagsId          = null,
                        PosterID        = "77701575-2fcc-4896-98ff-8f80a15efd35",
                        Date            = DateTime.Now,
                        Promotion       = Entities.Enums.PromotionEnum.Default,
                        isApproved      = 2
                    }
                };
                dbContext.Jobs.AddRange(test);
            }

            dbContext.SaveChanges();
        }
Exemplo n.º 12
0
        public async Task SeedCategories(FeaturesDbContext dbContext)
        {
            string[] lines      = File.ReadAllLines(@"C:\Users\iNexus\Documents\source\repos\HireMe\HireMe\Categories.txt");
            var      Categories = new List <Category>();
            var      vals1      = lines;

            for (int i = 0; i <= lines.Length; i++)
            {
                vals1 = lines[i].Split('#');

                Categories = new List <Category>
                {
                    new Category
                    {
                        Title    = vals1[0].ToString(),
                        Title_BG = vals1[1].ToString(),
                        Icon     = vals1[2].ToString()
                    },
                };
                await dbContext.Category.AddRangeAsync(Categories);

                await dbContext.SaveChangesAsync();
            }
        }
Exemplo n.º 13
0
 public DbBaseRepository(FeaturesDbContext context)
 {
     this.context = context ?? throw new ArgumentNullException(nameof(context));
     this.dbSet   = this.context.Set <TEntity>();
 }
Exemplo n.º 14
0
 public ContestantsService(IRepository <Contestant> contestantRepository, FeaturesDbContext _context)
 {
     this.contestantRepository = contestantRepository;
     //this.SeedTest(_context);
 }
Exemplo n.º 15
0
 public CompanyService(IRepository <Company> companyRepository, FeaturesDbContext _context)
 {
     this.companyRepository = companyRepository;
     //   this.SeedTest(_context);
 }
Exemplo n.º 16
0
 public JobsService(IRepository <Jobs> jobsRepository, FeaturesDbContext _context)
 {
     this.jobsRepository = jobsRepository;
     // SeedTest(_context);
 }
Exemplo n.º 17
0
 public FeaturesApiController(FeaturesDbContext contextFeatures)
 {
     _contextFeatures = contextFeatures ?? throw new ArgumentNullException(nameof(contextFeatures));
 }
Exemplo n.º 18
0
 public CompanyService(IConfiguration config, IRepository <Company> companyRepository, FeaturesDbContext _context)
 {
     this.companyRepository = companyRepository;
     _FileDir = config.GetValue <string>("StoredImagesPath");
     //   this.SeedTest(_context);
 }