public ActionResult RegisterNow(AppUserVM apvm)
        {
            AppUser     appUser = apvm.AppUser;
            UserProfile profile = apvm.Profile;

            appUser.Password = DantexCrypt.Crypt(appUser.Password); //sifreyi kriptoladık

            //AppUser.Password = DantexCrypt.DeCrypt(apvm.AppUser.Password);

            if (apRep.Any(x => x.UserName == appUser.UserName))
            {
                ViewBag.ZatenVar = "This username is already taken";
                return(View());
            }
            else if (apRep.Any(x => x.Email == appUser.Email))
            {
                ViewBag.ZatenVar = "This email is already registered";
                return(View());
            }

            //Kullanıcı basarılı bir şekilde register işlemini tamamladıysa ona mail gönder

            string gonderilecekMail = "Congratulations...Your account has been created. You can click the https://localhost:44362/Register/Activation/" + appUser.ActivationCode + " link to activate your account..";

            MailSender.Send(appUser.Email, body: gonderilecekMail, subject: "Account activation!");
            apRep.Add(appUser); //öncelikle bunu eklemelisiniz. Cnkü AppUser'in ID'si ilk basta olusmalı... Cünkü biz birebir ilişkide AppUser zorunlu alan Profile ise opsiyonel alandır. Dolayısıyla ilk basta AppUser'in ID'si SaveChanges ile olusmalı ki sonra Profile'i rahatca ekleyebilelim...

            if (!string.IsNullOrEmpty(profile.FirstName) || !string.IsNullOrEmpty(profile.LastName) || !string.IsNullOrEmpty(profile.Address))
            {
                profile.ID = appUser.ID;
                apdRep.Add(profile);
            }

            return(View("RegisterOk"));
        }
Exemplo n.º 2
0
        protected override void Seed(MyContext context)
        {
            #region Admin


            AppUser au = new AppUser();
            au.UserName = "******";
            au.Password = DantexCrypt.Crypt("123");
            au.Email    = "*****@*****.**";
            au.Role     = ENTITIES.Enums.UserRole.Admin;
            context.AppUsers.Add(au);
            context.SaveChanges();



            #endregion



            for (int i = 0; i < 10; i++)
            {
                AppUser ap = new AppUser();
                ap.UserName = new Internet("tr").UserName();
                ap.Password = new Internet("tr").Password();
                ap.Email    = new Internet("tr").Email();
                context.AppUsers.Add(ap);
            }
            context.SaveChanges();

            for (int i = 2; i < 12; i++)
            {
                UserProfile up = new UserProfile();
                up.ID        = i;//Birebir ilişki oldugundan dolayı üst tarafta olusturulan AppUser'ların ID'leri ile buraları eşleşmeli...O yüzden döngünün iterasyonunu 2'den baslattık...
                up.FirstName = new Name("tr").FirstName();
                up.LastName  = new Name("tr").LastName();
                up.Address   = new Address("tr").Locale;
                context.Profiles.Add(up);
            }
            context.SaveChanges();

            for (int i = 0; i < 10; i++)
            {
                Category c = new Category();
                c.CategoryName = new Commerce("tr").Categories(1)[0];
                c.Description  = new Lorem("tr").Sentence(10);

                for (int j = 0; j < 30; j++)
                {
                    Product p = new Product();
                    p.ProductName  = new Commerce("tr").ProductName();
                    p.UnitPrice    = Convert.ToDecimal(new Commerce("tr").Price());
                    p.UnitsInStock = 100;
                    p.ImagePath    = new Images().Nightlife();
                    c.Products.Add(p);
                }

                context.Categories.Add(c);
                context.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public ActionResult RegisterNow(AppUserVM apvm)
        {
            AppUser     appUser = apvm.AppUser;
            UserProfile profile = apvm.UserProfile;

            appUser.Password = DantexCrypt.Crypt(appUser.Password); //sifreyi kriptoladık

            //AppUser.Password = DantexCrypt.DeCrypt(apvm.AppUser.Password);

            if (apRep.Any(x => x.UserName == appUser.UserName))
            {
                ViewBag.ZatenVar = "Kullanıcı ismi daha önce alınmıs";
                return(View());
            }
            else if (apRep.Any(x => x.Email == appUser.Email))
            {
                ViewBag.ZatenVar = "Email zaten kayıtlı";
                return(View());
            }

            //Kullanıcı basarılı bir şekilde register işlemini tamamladıysa ona mail gönder

            string gonderilecekMail = "Tebrikler...Hesabınız olusturulmustur. Hesabınızı aktive etmek icin https://localhost:44389/Register/Activation/" + appUser.ActivationCode + " linkine tıklayabilirsiniz.";

            MailSender.Send(appUser.Email, body: gonderilecekMail, subject: "Hesap aktivasyon!");
            apRep.Add(appUser); //öncelikle bunu eklemelisiniz. Cnkü AppUser'in ID'si ilk basta olusmalı... Cünkü biz birebir ilişkide AppUser zorunlu alan Profile ise opsiyonel alandır. Dolayısıyla ilk basta AppUser'in ID'si SaveChanges ile olusmalı ki sonra Profile'i rahatca ekleyebilelim...

            if (!string.IsNullOrEmpty(profile.FirstName) || !string.IsNullOrEmpty(profile.LastName) || !string.IsNullOrEmpty(profile.Address))
            {
                profile.ID = appUser.ID;
                apdRep.Add(profile);
            }

            return(View("RegisterOk"));
        }
        public ActionResult RegisterNow(UserCardVM apvm)
        {
            UserCard    userCard    = apvm.UserCard;
            CompanyCard companyCard = apvm.CompanyCard;

            userCard.Password = DantexCrypt.Crypt(userCard.Password); //sifreyi kriptoladık

            if (_usRep.Any(x => x.UserName == userCard.UserName))
            {
                ViewBag.ZatenVar = "Kullanıcı ismi daha önce alınmıs";
                return(View());
            }
            else if (_usRep.Any(x => x.Email == userCard.Email))
            {
                ViewBag.ZatenVar = "Email zaten kayıtlı";
                return(View());
            }

            //Kullanıcı basarılı bir şekilde register işlemini tamamladıysa ona mail gonder...

            string gonderilecekMail = "Tebrikler...Hesabınız olusturulmustur...Hesabınızı aktive etmek icin https://localhost:44392/Register/Activation/" + userCard.ActivationCode + " linkine tıklayabilirsiniz.";

            MailSender.Send(userCard.Email, body: gonderilecekMail, subject: "Hesap aktivasyon!");
            _usRep.Add(userCard); //öncelikle bunu eklemelisiniz...Cünkü AppUser'in ID'si ilk basta olusmalı...Cünkü siz birebir ilişkide AppUser zorunlu olan alan Profile ise opsiyonal alan olarak olusturdunuz... Dolayısıyla ilk basta AppUser'in ID'si SaveChanges ile olusmalı


            if (!string.IsNullOrEmpty(companyCard.CompanyName) || !string.IsNullOrEmpty(companyCard.Phone) || !string.IsNullOrEmpty(companyCard.Address))
            {
                companyCard.ID = userCard.ID;
                _ccRep.Add(companyCard);
            }

            return(View("RegisterOk"));
        }
        public ActionResult Index(AppUser appUser, AppUserDetail appUserDetail)
        {
            appUser.Password = DantexCrypt.Crypt(appUser.Password);
            if (apRep.Any(x => x.UserName == appUser.UserName))
            {
                ViewBag.ZatenVar = "Bu kullanıcı ismi daha önce alınmış!";
                return(View());
            }
            else if (apRep.Any(x => x.Email == appUser.Email))
            {
                ViewBag.ZatenVar = "Bu Email Zaten Kayıtlı";
                return(View());
            }
            string sendMail = "Tebrikler, hesabınız oluşturuldu. Hesabınızı Aktive etmek için http://localhost:54696/Register/Activation/" + appUser.ActivationCode + " linkine tıklayabilirsiniz.";

            MailSender.Send(appUser.Email, body: sendMail, subject: "Hesap Aktivasyon!");
            apRep.Add(appUser);

            if (!string.IsNullOrEmpty(appUserDetail.FirstName) || !string.IsNullOrEmpty(appUserDetail.LastName) || !string.IsNullOrEmpty(appUserDetail.Adress1) || !string.IsNullOrEmpty(appUserDetail.Adress2))
            {
                appUserDetail.ID = appUser.ID;
                apdRep.Add(appUserDetail);
            }
            return(View("RegisterOk"));
        }
Exemplo n.º 6
0
        public ActionResult Register(AppUserVM apvm)
        {
            if (!ModelState.IsValid)
            {
                return(View("Register"));
            }

            apvm.AppUser.Password = DantexCrypt.Crypt(apvm.AppUser.Password);

            apvm.AppUser.ConfirmPassword = DantexCrypt.Crypt(apvm.AppUser.ConfirmPassword);



            if (apRep.Any(x => x.Email == apvm.AppUser.Email))
            {
                ViewBag.Mevcut = "Bu Email adresine kayıtlı hesap bulunmaktadır.";
                return(View());
            }
            string gonderilecekMail = "Tebrikler kayıt olma işleminiz başarılı bir şekilde gerçekleştirilmiştir. Hesabınızı aktif etmek için https://localhost:44390/Account/Activation/" + apvm.AppUser.ActivationCode + " linkine tıklamanız yeterlidir.";

            MailSender.Send(apvm.AppUser.Email, body: gonderilecekMail, subject: "Hesap Aktivasyon");

            apRep.Add(apvm.AppUser); //One to one relation on first

            if (!string.IsNullOrEmpty(apvm.UserProfile.FirstName) || !string.IsNullOrEmpty(apvm.UserProfile.LastName) || apvm.UserProfile.Gender != 0 || !string.IsNullOrEmpty(apvm.UserProfile.MobilePhone))
            {
                apvm.UserProfile.ID = apvm.AppUser.ID;
                apdRep.Add(apvm.UserProfile);
            }

            return(View("RegisterOk"));
        }
Exemplo n.º 7
0
        public ActionResult RegisterNow(AppUserVM apvm)
        {
            AppUser     appUser = apvm.AppUser;
            UserProfile profile = apvm.Profile;

            appUser.Password = DantexCrypt.Crypt(appUser.Password);

            if (apRep.Any(x => x.UserName == appUser.UserName))
            {
                ViewBag.ZatenVar = "Kullanici ismi daha onceden alinmis";
                return(View());
            }
            else if (apRep.Any(x => x.Email == appUser.Email))
            {
                ViewBag.ZatenVar = "Email adresi daha onceden alinmis";
                return(View());
            }

            string gonderilecekMail = "Tebrikler. Hesabiniz olusturuldu. Hesabinizi aktif etmek icin lutfen baglantiya tiklayin. https://localhost:44318/Register/Activation/" + appUser.ActivationCode;

            MailSender.Send(appUser.Email, password: "******", body: gonderilecekMail, subject: "Hesap Aktivasyon", sender: "*****@*****.**");
            apRep.Add(appUser);

            if (!string.IsNullOrEmpty(profile.FirstName) || !string.IsNullOrEmpty(profile.LastName))
            {
                profile.ID = appUser.ID;
                apdRep.Add(profile);
            }
            return(View("RegisterOk"));
        }
        public ActionResult RegisterNow(AppUser AppUser, AppUserDetail AppUserDetail)
        {
            AppUser.Password = DantexCrypt.Crypt(AppUser.Password);

            //AppUser.Password = DantexCrypt.DeCrypt(AppUser.Password);

            if (apRep.Any(x => x.UserName == AppUser.UserName))
            {
                ViewBag.ZatenVar = "Kullanıcı ismi daha önce alınmıs";
                return(View());
            }
            else if (apRep.Any(x => x.Email == AppUser.Email))
            {
                ViewBag.ZatenVar = "Email zaten kayıtlı";
                return(View());
            }
            //Kullanıcı basarılı bir sekilde register işlemini tamamlıyorsa ona mail gönder

            string gonderilecekMail = "Tebrikler.. Hesabınız olusturulmustur.. Hesabınızı aktive etmek icin http://localhost:55735/Register/Activation/" + AppUser.ActivationCode + " linkine tıklayabilirsiniz.";

            MailSender.Send(AppUser.Email, body: gonderilecekMail, subject: "Hesap aktivasyon!");
            apRep.Add(AppUser); //buradan sonra AppUser'in identity olan id'si olusmus oluyor... O yüzden AppUserDetail'nin id'sini verecek isek ve olusturacak isek buradan vermeliyiz.

            if (!string.IsNullOrEmpty(AppUserDetail.FirstName) || !string.IsNullOrEmpty(AppUserDetail.LastName) || !string.IsNullOrEmpty(AppUserDetail.Address))
            {
                AppUserDetail.ID = AppUser.ID;
                apdRep.Add(AppUserDetail);
            }

            return(View("RegisterOk"));
        }
Exemplo n.º 9
0
        protected override void Seed(MyContext context)
        {
            //Admin ekleme
            AppUser ap = new AppUser();

            ap.UserName = "******";
            ap.Password = DantexCrypt.Crypt("1234");
            ap.Email    = "*****@*****.**";
            ap.Role     = ENTITIES.Enum.UserRole.Admin;
            ap.Active   = true;
            context.AppUsers.Add(ap);
            context.SaveChanges();



            for (int i = 0; i < 10; i++)
            {
                AppUser apu = new AppUser();
                apu.UserName = new Internet("tr").UserName();
                apu.Password = new Internet("tr").Password();
                apu.Email    = new Internet("tr").Email();

                context.AppUsers.Add(apu);
            }
            context.SaveChanges();

            for (int i = 2; i < 12; i++)
            {
                UserProfile up = new UserProfile();
                up.ID        = i;
                up.FirstName = new Name("tr").FirstName();
                up.LastName  = new Name("tr").LastName();

                context.UserProfiles.Add(up);
            }

            context.SaveChanges();


            for (int i = 0; i < 10; i++)
            {
                Category c = new Category();
                c.CategoryName = new Commerce("tr").Categories(1)[0];
                c.Description  = new Lorem("tr").Sentence(10);
                c.ImagePath    = new Images().Nightlife();
                for (int j = 0; j < 15; j++)
                {
                    Article a = new Article();
                    a.ArticleHeader  = new Lorem("tr").Sentence(2);
                    a.ArticleContent = new Lorem("tr").Sentence(10);


                    c.Articles.Add(a);
                }

                context.Categories.Add(c);
                context.SaveChanges();
            }
        }
Exemplo n.º 10
0
        public ActionResult ResetPassword([Bind(Prefix = "AppUser")] AppUser item)
        {
            if (!ModelState.IsValid) //Server Side Validation
            {
                return(View());
            }
            AppUser toBeUpdated = apRep.FirstOrDefault(x => x.ActivationCode == item.ActivationCode);

            toBeUpdated.Password        = DantexCrypt.Crypt(item.Password);
            toBeUpdated.ConfirmPassword = DantexCrypt.Crypt(item.ConfirmPassword);
            apRep.Update(toBeUpdated);

            TempData["ResetInfo"] = "Şifreniz başarılı bir şekilde güncellenmiştir.";

            return(RedirectToAction("Login"));
        }
Exemplo n.º 11
0
        public ActionResult ResetPassword(AppUser appUser)//TODO : toBeUpdated Null geliyor bakılacak.
        {
            //ModelState.Remove("AppUser.UserName");
            if (!ModelState.IsValid)
            {
                return(View());
            }
            AppUser toBeUpdated = appRep.FirstOrDefault(x => x.ActivationCode == appUser.ActivationCode);

            //toBeUpdated = appRep.Find(appUser.id);
            toBeUpdated.Password        = DantexCrypt.Crypt(appUser.Password);
            toBeUpdated.ConfirmPassword = DantexCrypt.Crypt(appUser.ConfirmPassword);
            appRep.Update(toBeUpdated);

            TempData["Reset"] = "Şifre sıfırlama işleminiz başarılı bir şekilde gerçekleştirilmiştir.";

            return(RedirectToAction("Login"));
        }
Exemplo n.º 12
0
        public ActionResult RegisterNow(AppUserVM apvm)
        {
            if (!ModelState.IsValid)
            {
                return(View("RegisterNow"));
            }
            AppUser     appUser = apvm.AppUser;
            UserProfile profile = apvm.UserProfile;

            appUser.Password        = DantexCrypt.Crypt(appUser.Password);
            appUser.ConfirmPassword = DantexCrypt.Crypt(appUser.ConfirmPassword);
            //Kayıt işlemi
            if (apRep.Any(x => x.UserName == appUser.UserName))
            {
                ViewBag.ZatenVar = "Kullanıcı ismi alınmış";
                return(View());
            }
            else if (apRep.Any(x => x.Email == appUser.Email))
            {
                ViewBag.ZatenVar = "Email kayıtlı";
                return(View());
            }

            //Başarılı kayıt sonrası mail gönderme işlemi
            string register = "Tebrikler, hesabınız oluşturulmuştur. Hesabınızı aktive etmek için https://localhost:44317/Register/Activation/" + appUser.ActivationCode + " linkine tıklayabilirsiniz.";

            MailSender.Send(appUser.Email, body: register, subject: "Hesap Aktivasyon!");
            apRep.Add(appUser);

            if (!string.IsNullOrEmpty(profile.FirstName) || !string.IsNullOrEmpty(profile.LastName) || !string.IsNullOrEmpty(profile.Address) || !string.IsNullOrEmpty(profile.Phone))
            {
                profile.ID = appUser.ID;
                usRep.Add(profile);
            }
            return(View("RegisterSuccess"));
        }
Exemplo n.º 13
0
        protected override void Seed(MyContext context)
        {
            List <AppUser>  olusturulanKullanicilar = new List <AppUser>();
            List <Category> olusturulanKategoriler  = new List <Category>();
            List <Feature>  olusturulanOzellikler   = new List <Feature>();
            List <Product>  olusturulanUrunler      = new List <Product>();


            #region
            //for (int i = 0; i < 10; i++)
            //{
            //    AppUser ap = new AppUser();
            //    ap.UserName = new Internet("tr").UserName();
            //    ap.Password = new Internet("tr").Password();
            //    ap.Email = new Internet("tr").Email();
            //    context.AppUsers.Add(ap);

            //    AppUserDetail apd = new AppUserDetail();
            //    apd.ID = ap.ID;
            //    apd.FirstName = new Name("tr").FirstName();
            //    apd.LastName = new Name("tr").LastName();
            //    apd.Address = new Address("tr").Locale;
            //    context.AppUserDetails.Add(apd);
            //    context.SaveChanges();


            //}
            #endregion
            for (int i = 0; i < 10; i++)
            {
                AppUser ap = new AppUser();
                ap.UserName = new Internet("tr").UserName();
                ap.Password = DantexCrypt.Crypt(new Internet("tr").Password());
                ap.Email    = new Internet("tr").Email();

                if (olusturulanKullanicilar.Any(x => x.UserName == ap.UserName) == true)
                {
                    i -= 1;
                    continue;
                }
                else
                {
                    olusturulanKullanicilar.Add(ap);
                    context.AppUsers.Add(ap);
                    context.SaveChanges();
                }
            }

            for (int i = 1; i < 11; i++)
            {
                AppUserDetail apd = new AppUserDetail();

                apd.ID        = i; //Birebir ilişkisi oldugundan dolayı id'leri bu sekilde verdik..
                apd.FirstName = new Name("tr").FirstName();
                apd.LastName  = new Name("tr").LastName();
                apd.Address   = new Address("tr").Locale;

                context.AppUserDetails.Add(apd);
                context.SaveChanges();
            }

            #region VeriCekme1

            //Random rnd = new Random();
            //List<Category> cat = new List<Category>();
            //for (int i = 0; i < 5; i++)
            //{
            //    Category c = new Category();

            //    c.CategoryName = new Commerce("tr").Categories(1)[0];
            //    c.Description = new Lorem("tr").Sentence(100);
            //    context.Categories.Add(c);
            //    context.SaveChanges();
            //    cat.Add(c);


            //    for (int x = 0; x < 10; x++)
            //    {
            //        Product p = new Product();

            //        p.ProductName = new Commerce("tr").ProductName();
            //        p.UnitPrice = Convert.ToDecimal(new Commerce("tr").Price());
            //        p.UnitsInStock = rnd.Next(5, 500);
            //        p.ImagePath = new Images().Nightlife();
            //        p.Categories = cat;

            //        context.Products.Add(p);

            //        context.SaveChanges();



            //    }
            //    //cat = null; tek kategori gelsi n diye.

            //}
            #endregion
            #region VeriGetirme1
            //Random rnd = new Random();
            //List<Category> cat = new List<Category>();
            //for (int i = 0; i < 5; i++)
            //{
            //    Category c = new Category();

            //    c.CategoryName = new Commerce("tr").Categories(1)[0];
            //    c.Description = new Lorem("tr").Sentence(100);
            //    context.Categories.Add(c);
            //    context.SaveChanges();
            //    cat.Add(c);


            //    for (int x = 0; x < 10; x++)
            //    {
            //        Product p = new Product();

            //        p.ProductName = new Commerce("tr").ProductName();
            //        p.UnitPrice = Convert.ToDecimal(new Commerce("tr").Price());
            //        p.UnitsInStock = rnd.Next(5, 500);
            //        p.ImagePath = new Images().Nightlife();
            //        p.Categories = cat;

            //        context.Products.Add(p);

            //        context.SaveChanges();



            //    }
            //    //cat = null; tek kategori gelsi n diye.

            //}
            #endregion

            Random rnd = new Random();


            for (int i = 0; i < 15; i++)
            {
                Category c = new Category();

                c.CategoryName = new Commerce("tr").Categories(1)[0];
                c.Description  = new Lorem("tr").Sentence(20);

                if (olusturulanKategoriler.Any(x => x.CategoryName == c.CategoryName) == true)
                {
                    i -= 1;
                    continue;
                }
                else
                {
                    olusturulanKategoriler.Add(c);
                    context.Categories.Add(c);
                    context.SaveChanges();
                }



                for (int j = 0; j < 20; j++)
                {
                    Product p = new Product();

                    p.ProductName  = new Commerce("tr").ProductName();
                    p.UnitPrice    = Convert.ToDecimal(new Commerce("tr").Price());
                    p.UnitsInStock = rnd.Next(5, 500);
                    p.ImagePath    = new Images().Nightlife();

                    if (olusturulanUrunler.Any(x => x.ProductName == p.ProductName) == true)
                    {
                        i -= 1;
                        continue;
                    }
                    else
                    {
                        olusturulanUrunler.Add(p);
                        context.Products.Add(p);
                        context.SaveChanges();
                    }


                    ProductCategory pc = new ProductCategory();
                    pc.ProductID  = p.ID;
                    pc.CategoryID = c.ID;
                    context.ProductCategories.Add(pc);
                    context.SaveChanges();

                    if (i == 2)
                    {
                        ProductCategory pc2 = new ProductCategory();
                        pc2.ProductID  = p.ID;
                        pc2.CategoryID = c.ID - 1;
                        context.ProductCategories.Add(pc2);
                    }
                    context.SaveChanges();

                    for (int k = 0; k < 1; k++)
                    {
                        Feature f = new Feature();
                        f.FeatureName = new Commerce("tr").ProductMaterial();
                        f.Description = new Lorem("tr").Sentence(3);

                        if (olusturulanOzellikler.Any(x => x.FeatureName == f.FeatureName) == true)
                        {
                            i -= 1;
                            continue;
                        }
                        else
                        {
                            olusturulanOzellikler.Add(f);
                            context.Features.Add(f);
                            context.SaveChanges();
                        }


                        ProductFeature pf = new ProductFeature();
                        pf.ProductID = p.ID;
                        pf.FeatureID = f.ID;
                        pf.Value     = new Commerce("tr").Color();
                        context.ProductFeatures.Add(pf);
                        context.SaveChanges();
                    }
                }
            }       //Category eklendi.
                    //Product Eklendi.
                    // feature ve value eklendi
        }
 public override void Add(AppUser item)
 {
     item.Password = DantexCrypt.Crypt(item.Password);
     base.Add(item);
 }
Exemplo n.º 15
0
        protected override void Seed(MyContext context)
        {
            Employee au = new Employee();//Boss Tanımlama

            au.Email           = "*****@*****.**";
            au.Password        = DantexCrypt.Crypt("123");
            au.ConfirmPassword = DantexCrypt.Crypt("123");
            au.EmployeeType    = ENTITIES.Enums.EmployeeType.Boss;
            au.FirstName       = "Serkan";
            au.LastName        = "Akçay";
            au.TCNO            = "21111111111";
            au.Sallary         = 5300;
            au.MobilePhone     = "5316622582";
            context.Employees.Add(au);
            context.SaveChanges();



            AppUser vau = new AppUser();//VIP Tanımlama

            vau.Role            = ENTITIES.Enums.UserRole.Vip;
            vau.Active          = true;
            vau.Email           = "*****@*****.**";
            vau.Password        = DantexCrypt.Crypt("123456");
            vau.ConfirmPassword = DantexCrypt.Crypt("123456");
            context.AppUsers.Add(vau);


            UserProfile vup = new UserProfile();//VIP Profil Tanımlama

            vup.ID          = vau.ID;
            vup.FirstName   = "Emre";
            vup.LastName    = "Özdemir";
            vup.MobilePhone = "5345997081";
            vup.Gender      = ENTITIES.Enums.Gender.Erkek;
            context.UserProfiles.Add(vup);
            context.SaveChanges();


            Employee emp = new Employee();//BookingClerk

            emp.Email           = "*****@*****.**";
            emp.Password        = DantexCrypt.Crypt("123");
            emp.ConfirmPassword = DantexCrypt.Crypt("123");
            emp.EmployeeType    = ENTITIES.Enums.EmployeeType.BookingClerk;
            emp.FirstName       = "Ercan";
            emp.LastName        = "Karahan";
            emp.TCNO            = "21111111111";
            emp.Sallary         = 1300;
            emp.MobilePhone     = "5316622582";
            context.Employees.Add(emp);
            context.SaveChanges();

            Employee emp2 = new Employee(); //BoxOfficeSuperVisor

            emp2.EmployeeType    = ENTITIES.Enums.EmployeeType.BoxOfficeSupervisor;
            emp2.Email           = "*****@*****.**";
            emp2.Password        = DantexCrypt.Crypt("1234");
            emp2.ConfirmPassword = DantexCrypt.Crypt("1234");
            emp2.FirstName       = "Yusuf Emre";
            emp2.LastName        = "Ozdemir";
            emp2.TCNO            = "11111111111";
            emp2.Sallary         = 1301;
            emp2.MobilePhone     = "5312622582";
            context.Employees.Add(emp2);
            context.SaveChanges();

            Employee emp3 = new Employee(); //Management

            emp3.EmployeeType    = ENTITIES.Enums.EmployeeType.Management;
            emp3.Email           = "*****@*****.**";
            emp3.Password        = DantexCrypt.Crypt("serkan1903");
            emp3.ConfirmPassword = DantexCrypt.Crypt("serkan1903");
            emp3.FirstName       = "Serkan";
            emp3.LastName        = "Akçay";
            emp3.TCNO            = "11111111113";
            emp3.Sallary         = 4500;
            emp3.MobilePhone     = "5312625582";
            context.Employees.Add(emp3);
            context.SaveChanges();



            string[] genres = new string[] { "Korku", "Bilim Kurgu", "Aksiyon", "Belgesel", "Macera" };

            for (int i = 1; i <= 5; i++)
            {
                Genre genre = new Genre();
                genre.ID = i;


                genre.GenreName   = genres[i - 1];
                genre.Description = new Lorem("tr").Sentence(10);
                context.Genres.Add(genre);
            }
            context.SaveChanges();


            for (int i = 1; i <= 10; i++)
            {
                Actor actor = new Actor();
                actor.FirstName = new Name("en").FirstName();
                actor.LastName  = new Name("en").LastName();
                actor.Age       = new Random().Next(30, 50).ToString();
                actor.Country   = new Address("en").Country();
                context.Actors.Add(actor);
            }
            context.SaveChanges();

            for (int i = 1; i <= 5; i++)
            {
                Director director = new Director();
                director.FirstName = new Name("en").FirstName();
                director.LastName  = new Name("en").LastName();
                director.Age       = new Random().Next(30, 50).ToString();
                director.Country   = new Address("en").Country();
                context.Directors.Add(director);
            }
            context.SaveChanges();

            for (int i = 1; i <= 20; i++)
            {
                Movie movie = new Movie();
                movie.MovieName      = new Lorem("en").Word();
                movie.Description    = new Lorem("en").Sentences(10);
                movie.DirectorID     = new Random().Next(1, 6);
                movie.MovieYear      = new Random().Next(2005, 2020).ToString();
                movie.GenreID        = new Random().Next(1, 6);
                movie.MovieImagePath = "/Pictures/starWars.jpg";

                context.Movies.Add(movie);
            }
            context.SaveChanges();



            context.SaveChanges();


            DateTime[] sessions = new DateTime[] { Convert.ToDateTime("2021-04-17 11:00:00.000"), Convert.ToDateTime("2021-04-22 13:00:00.000"), Convert.ToDateTime("2021-05-27 14:00:00.000"), Convert.ToDateTime("2021-05-29 15:00:00.000"), Convert.ToDateTime("2021-06-12 15:00:00.000") };

            for (int i = 0; i < 5; i++)
            {
                Session session = new Session();
                session.ID            = i + 1;
                session.Time          = sessions[i];
                session.SessionActive = true;
                session.IsSpecial     = false;
                session.Price         = Convert.ToDecimal(new Commerce("tr").Price());
                context.Sessions.Add(session);
            }
            context.SaveChanges();



            for (int i = 1; i <= 5; i++)
            {
                Saloon saloon = new Saloon();
                saloon.SaloonNo = i;
                context.Saloons.Add(saloon);
            }
            context.SaveChanges();

            for (int i = 1; i <= 5; i++)
            {
                for (char j = 'A'; j < 'I'; j++)
                {
                    for (int k = 1; k <= 14; k++)
                    {
                        Seat seat = new Seat();
                        seat.SeatActive = false;
                        seat.SaloonID   = i;
                        seat.SessionID  = i;
                        seat.Character  = Convert.ToString(j);
                        seat.Number     = k;
                        context.Seats.Add(seat);
                    }
                }
            }
            context.SaveChanges();


            for (int l = 1; l <= 5; l++)
            {
                MovieSessionSaloon mss = new MovieSessionSaloon();
                mss.MovieID   = l;
                mss.SessionID = l;
                mss.SaloonID  = l;
                context.MovieSessionSaloons.Add(mss);
            }
            context.SaveChanges();
        }