public DataContext(DbContextOptions <DataContext> options) : base(options)
        {
            if (!Questions.Any())
            {
                Questions.Add(new QuestionModel()
                {
                    //Id = 1,
                    Name = "Reikia atlikti rangos darbus"
                });
                Questions.Add(new QuestionModel()
                {
                    //Id = 2,
                    Name = "Rangos darbos atliks"
                });
                Questions.Add(new QuestionModel()
                {
                    //Id = 3,
                    Name = "Verslo klientas"
                });
                Questions.Add(new QuestionModel()
                {
                    //Id = 4,
                    Name = "Skaiciavimo budas"
                });
                Questions.Add(new QuestionModel()
                {
                    //Id = 5,
                    Name = "Svarbus klientas"
                });
                SaveChanges();

                if (!DropDowns.Any())
                {
                    DropDowns.Add(new DropDownModel()
                    {
                        //Id = 1,
                        Name       = "Reikia atlikti rangos darbus",
                        QuestionId = 1
                    });
                    DropDowns.Add(new DropDownModel()
                    {
                        //Id = 2,
                        Name       = "Rangos darbos atliks",
                        QuestionId = 2
                    });
                    DropDowns.Add(new DropDownModel()
                    {
                        //Id = 3,
                        Name       = "Verslo klientas",
                        QuestionId = 3
                    });
                    DropDowns.Add(new DropDownModel()
                    {
                        //Id = 4,
                        Name       = "Skaiciavimo budas",
                        QuestionId = 4
                    });
                    DropDowns.Add(new DropDownModel()
                    {
                        //Id = 5,
                        Name       = "Svarbus klientas",
                        QuestionId = 5
                    });
                    SaveChanges();
                }

                if (!DropDownValues.Any())
                {
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 1,
                        Name       = "Paprastas klientas",
                        DropDownId = 1
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 2,
                        Name       = "Svarbus klientas",
                        DropDownId = 1
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 3,
                        Name       = "",
                        DropDownId = 1
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 4,
                        Name       = "Rankinis",
                        DropDownId = 2
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 5,
                        Name       = "Automatinis",
                        DropDownId = 2
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 6,
                        Name       = "Taip",
                        DropDownId = 3
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 7,
                        Name       = "Ne",
                        DropDownId = 3
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 8,
                        Name       = "Kiti rangovai",
                        DropDownId = 4
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 9,
                        Name       = "Mėnesio rangovas",
                        DropDownId = 4
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 10,
                        Name       = "Metinis rangovas",
                        DropDownId = 4
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 11,
                        Name       = "Ne",
                        DropDownId = 5
                    });
                    DropDownValues.Add(new DropDownValueModel()
                    {
                        //Id = 12,
                        Name       = "Taip",
                        DropDownId = 5
                    });
                    SaveChanges();
                }
            }
        }
Exemple #2
0
        public void AddElement(BrowserElement element)
        {
            element.OrderIndex = AddedElements++;
            //element.Position = this.Position;
            switch (element.Type)
            {
            case BrowserElementType.BrowserBoxSelection:
                BrowserBoxSelection boxSelection = element as BrowserBoxSelection;

                break;

            case BrowserElementType.Button:
                BrowserButton button = element as BrowserButton;
                Buttons.Add(button);
                break;

            case BrowserElementType.Title:
                BrowserTitle title = element as BrowserTitle;
                Titles.Add(title);
                break;

            case BrowserElementType.Text:
                BrowserText text = element as BrowserText;
                Texts.Add(text);
                break;

            case BrowserElementType.TextBox:
                BrowserTextBox textBox = element as BrowserTextBox;
                TextBoxes.Add(textBox);
                break;

            case BrowserElementType.Card:
                BrowserCard card = element as BrowserCard;
                Cards.Add(card);
                break;

            case BrowserElementType.Password:
                BrowserPasswordTextBox passwordTextBox = element as BrowserPasswordTextBox;
                PasswordTextBoxes.Add(passwordTextBox);
                break;

            //case BrowserElementType.YesNoDialog:
            //    BrowserYesNoDialog yesNoDialog = element as BrowserYesNoDialog;
            //    YesNoDialog = yesNoDialog;
            //    break;
            case BrowserElementType.Checkbox:
                BrowserCheckBox checkBox = element as BrowserCheckBox;
                CheckBoxes.Add(checkBox);
                break;

            case BrowserElementType.DropDown:
                BrowserDropDown dropDown = element as BrowserDropDown;
                DropDowns.Add(dropDown);
                break;

            case BrowserElementType.ProgressBar:
                BrowserProgressBar progressBar = element as BrowserProgressBar;
                ProgressBars.Add(progressBar);
                break;

            case BrowserElementType.Container:
                BrowserContainer container = element as BrowserContainer;
                Container.Add(container);
                break;

            case BrowserElementType.Icon:
                BrowserButtonIcon icon = element as BrowserButtonIcon;
                Icons.Add(icon);
                break;

            default:
                NAPI.Util.ConsoleOutput($"UNKNOWN ELEMENT OF TYPE {element.Type}");
                break;
            }
        }