public void ImportDataFromMongo(TelecommunicationDbContext telecommunicationDbContext, ITelecommunicationProviderMongoDbContext telecommunicationMongoDbContext)
        {
            var mongoData = new TelecommunicationProviderMongoDb(telecommunicationMongoDbContext);

            var usersCollection = mongoData.User.FindAll();

            var telephonesCollection = mongoData.TelephoneNumber.FindAll();

            var addressCollection = mongoData.Address.FindAll();

            foreach (var item in usersCollection)
            {
                var user = new User
                {
                    FirstName = item.FirstName,
                    LastName = item.LastName,
                    Ssn = item.Ssn,
                    Type = item.Type,
                    AddressId = item.AddressId
                };
                telecommunicationDbContext.Users.Add(user);
                telecommunicationDbContext.SaveChanges();
            }

            foreach (var item in telephonesCollection)
            {
                var phone = new TelephoneNumber
                {
                    Number = item.Number,
                    UserId = item.UserId
                };
                telecommunicationDbContext.TelephoneNumbers.Add(phone);
                telecommunicationDbContext.SaveChanges();
            }

            foreach (var item in addressCollection)
            {
                var address = new Address
                {
                    Name = item.Name,
                    Number = item.Number,
                    City = item.City,
                    Country = item.Country,
                    ZipCode = item.ZipCode
                };
                telecommunicationDbContext.Adresses.Add(address);
                telecommunicationDbContext.SaveChanges();
            }

            Console.WriteLine("Import from Mongo is ready");
        }
        public void ImportContractsFromExcelFilesInFolder(TelecommunicationDbContext telecommunicationDbContext, string excelFolderDataPath)
        {
            ExcelImporter excelDataImporter = new ExcelImporter();
            ICollection<Contract> importedContractsFromExcel =
            excelDataImporter.ImportContractsDataFromDirectory(excelFolderDataPath);
            foreach (var contract in importedContractsFromExcel)
            {
                telecommunicationDbContext.Contracts.Add(contract);
            }

            telecommunicationDbContext.SaveChanges();
        }
        public void ImportContractsFromXml(TelecommunicationDbContext telecommunicationDbContext, string xmlDataPath)
        {
            XmlImporter xmlDataImporter = new XmlImporter();
            ICollection<Contract> importedContractsFromXml =
            xmlDataImporter.ImportContractsDataFromFile(xmlDataPath);
            foreach (var contract in importedContractsFromXml)
            {
                telecommunicationDbContext.Contracts.Add(contract);
            }

            telecommunicationDbContext.SaveChanges();
        }
        public void CreateDatabase(TelecommunicationDbContext context)
        {
            context.Adresses.Add(
                new Address
                    {
                        Name = "Cvetna Gradina",
                        Number = 32,
                        City = "Sofiq",
                        Country = "Bulgaria",
                        ZipCode = "1000"
                    });

            context.Adresses.Add(
                new Address { Name = "Rakovska", Number = 32, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });
            context.Adresses.Add(
                new Address { Name = "Aleksandar Malinov", Number = 32, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });

            context.Adresses.Add(
                new Address { Name = "Bogatitsa", Number = 45, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });

            context.Adresses.Add(
                new Address { Name = "Kliment Ohridski", Number = 62, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });
            context.Adresses.Add(
                new Address { Name = "Cherny vryh", Number = 32, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });

            context.Adresses.Add(
                new Address { Name = "Arsenalski blvd", Number = 32, City = "Sofiq", Country = "Bulgaria", ZipCode = "1000" });

            context.SaveChanges();
            context.Users.Add(
                new User
                    {
                        LastName = "Stoycheva",
                        FirstName = "Aleksandra",
                        AddressId = 1,
                        Ssn = "123467891236",
                        Type = "Gold User"
                    });
            context.Users.Add(
                new User
                    {
                        LastName = "Dragneva",
                        FirstName = "Pavlina",
                        AddressId = 2,
                        Ssn = "123467691236",
                        Type = "Gold User"
                    });
            context.Users.Add(new User
                {
                    LastName = "Madjarova",
                    FirstName = "Velimira",
                    AddressId = 3,
                    Ssn = "123467861236",
                    Type = "Gold User"
                });
            context.Users.Add(
               new User
               {
                   LastName = "Pesho",
                   FirstName = "Peshov",
                   AddressId = 1,
                   Ssn = "123467881236",
                   Type = "Gold User"
               });
            context.Users.Add(
                new User
                {
                    LastName = "Doncho",
                    FirstName = "Minkov",
                    AddressId = 4,
                    Ssn = "127467691236",
                    Type = "Gold User"
                });
            context.Users.Add(new User
            {
                LastName = "Niki",
                FirstName = "Kostov",
                AddressId = 3,
                Ssn = "123467879236",
                Type = "Gold User"
            });

            context.SaveChanges();
            context.Packages.Add(new Package { Name = "A++", Type = "Gold", Price = 32 });
            context.Packages.Add(new Package { Name = "B++", Type = "Gold", Price = 35 });
            context.Packages.Add(new Package { Name = "A", Type = "Silver", Price = 25 });
            context.Packages.Add(new Package { Name = "B", Type = "Silver+", Price = 28 });
            context.Packages.Add(new Package { Name = "C++", Type = "Gold", Price = 50 });
            context.Packages.Add(new Package { Name = "D++", Type = "Gold", Price = 35 });
            context.Packages.Add(new Package { Name = "X", Type = "Silver", Price = 25 });
            context.Packages.Add(new Package { Name = "M", Type = "Silver+", Price = 28 });
            context.SaveChanges();
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 1, Number = "00359864576326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 2, Number = "00359864566466" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 3, Number = "00359864571326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 4, Number = "00359774591326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 5, Number = "00359864556326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 6, Number = "00359864566466" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 4, Number = "00359864544326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 1, Number = "00359774521326" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 5, Number = "00359456123783" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 6, Number = "00359456123782" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 4, Number = "00359456123781" });
            context.TelephoneNumbers.Add(new TelephoneNumber { UserId = 1, Number = "00359456123789" });
            context.SaveChanges();
        }