private static void SeedForms(this CaseFileContext context, string formCode, bool diaspora)
        {
            context.Forms.Add(
                new Form {
                Code = formCode, Description = "Description " + formCode, CurrentVersion = 1, Draft = false, CreatedByUserId = 1, Type = FormType.Public
            }                                                                                                                                                          //, Diaspora = diaspora
                );

            context.SaveChanges();
        }
        private static void SeedCities(this CaseFileContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            context.Cities.Add(
                new City {
                Name = "Test City", CountyId = context.Counties.First().CountyId
            }
                );

            context.SaveChanges();
        }
        private static void SeedOptions(this CaseFileContext context)
        {
            if (context.Options.Any())
            {
                return;
            }

            context.Options.AddRange(
                new Option {
                Text = "Da",
            },
                new Option {
                Text = "Nu",
            },
                new Option {
                Text = "Nu stiu",
            },
                new Option {
                Text = "Dark Island",
            },
                new Option {
                Text = "London Pride",
            },
                new Option {
                Text = "Zaganu",
            },
                new Option {
                Text = "Transmisia manualã",
            },
                new Option {
                Text = "Transmisia automatã",
            },
                new Option {
                Text = "Altele (specificaţi)", IsFreeText = true
            },
                new Option {
                Text = "Metrou"
            },
                new Option {
                Text = "Tramvai"
            },
                new Option {
                Text = "Autobuz"
            }
                );

            context.SaveChanges();
        }
        private static void SeedBeneficiaries(this CaseFileContext context)
        {
            if (context.Beneficiaries.Any())
            {
                return;
            }

            context.Beneficiaries.Add(
                new Beneficiary()
            {
                BirthDate = new DateTime(1987, 6, 15), CityId = 1, CountyId = 1, Name = "Test Beneficiary", UserId = 1
            }
                );

            context.SaveChanges();
        }
        private static void SeedObservers(this CaseFileContext context)
        {
            if (context.Users.Any())
            {
                return;
            }

            context.Users.Add(
                // pwd: ACgti/NZu42h6KR5js3dO9RQvBPCKhnJ67yyXfR69zWQZDjBVKz1xQPRthfPZZNJEQ==
                //new User() { NgoId = 0, FromTeam = false, NgoId = 1, Phone = "0722222222", Name = "Test", Password = "******", MobileDeviceId = Guid.NewGuid().ToString(), DeviceRegisterDate = DateTime.Now }
                new User()
            {
                NgoId = 1, Phone = "0722222222", Name = "CaseFile Test", Email = "*****@*****.**", Password = "******"
            }
                );

            context.SaveChanges();
        }
        private static void SeedFormSections(this CaseFileContext context, string formCode)
        {
            var form = context.Forms.SingleOrDefault(f => f.Code == formCode);

            if (form == null)
            {
                return;
            }

            context.FormSections.AddRange(
                new FormSection {
                Code = formCode + "B", Description = "Despre Bere", FormId = form.FormId
            },
                new FormSection {
                Code = formCode + "C", Description = "Description masini", FormId = form.FormId
            }
                );

            context.SaveChanges();
        }
        private static void SeedNGOs(this CaseFileContext context)
        {
            if (context.Ngos.Any())
            {
                return;
            }

            context.Ngos.Add(new Ngo
            {
                Name = "FDP Cluj",
                //Organizer = true,
                ShortName = "FDP",
                IsActive  = true
            });
            context.Ngos.Add(new Ngo
            {
                Name = "Guest NGO",
                //Organizer = false,
                ShortName = "GUE",
                IsActive  = true
            });
            context.SaveChanges();
        }
        private static void SeedQuestions(this CaseFileContext context, string formCode, bool diaspora)
        {
            var f = context.Forms.FirstOrDefault(ff => ff.Code == formCode);

            if (f == null)
            {
                f = new Form {
                    Code = formCode, Draft = false
                };                                               //, Diaspora = diaspora
                context.Forms.Add(f);
                context.SaveChanges();
            }

            var fsB = context.FormSections
                      .FirstOrDefault(ff => ff.FormId == f.FormId && ff.Code == $"{formCode}B");
            var fsC = context.FormSections
                      .FirstOrDefault(ff => ff.FormId == f.FormId && ff.Code == $"{formCode}C");

            if (fsB == null)
            {
                fsB = new FormSection {
                    FormId = f.FormId, Code = $"{formCode}B", Description = $"section B of Form {f.FormId}"
                };
                context.FormSections.Add(fsB);
                context.SaveChanges();
            }
            if (fsC == null)
            {
                fsC = new FormSection {
                    FormId = f.FormId, Code = $"{formCode}C", Description = $"section C of Form {f.FormId}"
                };
                context.FormSections.Add(fsC);
                context.SaveChanges();
            }
            context.Questions.AddRange(
                // primul formular
                new Question
            {
                SectionId          = fsB.FormSectionId, //B
                QuestionType       = QuestionType.SingleOption,
                Text               = $"{f.FormId}: Iti place berea? (se alege o singura optiune selectabila)",
                OptionsToQuestions = new List <OptionToQuestion>
                {
                    new OptionToQuestion {
                        OptionId = 1
                    },
                    new OptionToQuestion {
                        OptionId = 2, Flagged = true
                    },
                    new OptionToQuestion {
                        OptionId = 3
                    }
                }
            },
                new Question
            {
                SectionId          = fsB.FormSectionId, //B
                QuestionType       = QuestionType.MultipleOption,
                Text               = $"{f.FormId}: Ce tipuri de bere iti plac? (se pot alege optiuni multiple)",
                OptionsToQuestions = new List <OptionToQuestion>
                {
                    new OptionToQuestion {
                        OptionId = 4, Flagged = true
                    },
                    new OptionToQuestion {
                        OptionId = 5
                    },
                    new OptionToQuestion {
                        OptionId = 6
                    }
                }
            },
                new Question
            {
                SectionId          = fsC.FormSectionId, //C
                QuestionType       = QuestionType.SingleOptionWithText,
                Text               = $"{f.FormId}: Ce tip de transmisie are masina ta? (se poate alege O singura optiune selectabila + text pe O singura optiune)",
                OptionsToQuestions = new List <OptionToQuestion>
                {
                    new OptionToQuestion {
                        OptionId = 7, Flagged = true
                    },
                    new OptionToQuestion {
                        OptionId = 8
                    },
                    new OptionToQuestion {
                        OptionId = 9
                    }
                }
            },
                new Question
            {
                SectionId          = fsC.FormSectionId, //C
                QuestionType       = QuestionType.MultipleOptionWithText,
                Text               = $"{f.FormId}: Ce mijloace de transport folosesti sa ajungi la birou? (se pot alege mai multe optiuni + text pe O singura optiune)",
                OptionsToQuestions = new List <OptionToQuestion>
                {
                    new OptionToQuestion {
                        OptionId = 10, Flagged = true
                    },
                    new OptionToQuestion {
                        OptionId = 11
                    },
                    new OptionToQuestion {
                        OptionId = 12
                    },
                    new OptionToQuestion {
                        OptionId = 9
                    }
                }
            }
                );

            context.SaveChanges();
        }