private void CheckTableVeranstaltung()
        {
            bool year, lang;
            var  query = conn.Table <Table_Veranstaltung>();

            foreach (var entry in query)
            {
                year = entry.Jahr >= 2017;
                lang = GtkHelper.FindInArray(API_Contract.SupportedLanguages, entry.Sprache) != -1;
                if (!year || !lang)
                {
                    var invalid = new InvalidStruct(entry);
                    if (!year)
                    {
                        invalid.errors.Add("JAHR");
                    }
                    if (!lang)
                    {
                        invalid.errors.Add("SPRACHE");
                    }
                    invalidEntrys.Add(invalid);
                }
                // Add pks
                EventPKs.Add(entry.Id);
            }
        }
        private static bool ValidateKrzl(GetUserArgs arg)
        {
            var krzlLabel = arg.textLabel;
            var krzlEntry = (Entry)arg.inputEntry;

            krzlEntry.Text = krzlEntry.Text.ToUpper();
            if (GtkHelper.FindInArray(API_Contract.SupportedKrzl, krzlEntry.Text) == -1)
            {
                krzlLabel.OverrideColor(0, API_Contract.validColor);
                return(true);
            }
            else
            {
                krzlLabel.OverrideColor(0, API_Contract.invalidColor);
                return(false);
            }
        }
Exemple #3
0
        protected override void HookEditTreeRow(TreeView treeView, RowActivatedArgs args, object tabData)
        {
            string nameString, krzlString, langString;
            string timeString = (string)currTreeStore.GetValue(currTreeIter, (int)EventColumnId.Zeit);
            int    krzlPos, langPos;

            if (IsParent(args))
            {
                // Event is parent, just get values
                currParentIter = currTreeIter;

                nameString = (string)currTreeStore.GetValue(currTreeIter, (int)EventColumnId.Name);
                krzlString = (string)currTreeStore.GetValue(currTreeIter, (int)EventColumnId.Krzl);
                langString = (string)currTreeStore.GetValue(currTreeIter, (int)EventColumnId.Sprache);

                textEntryEditable = true;
                cbLang.Sensitive  = cbKrzl.Sensitive = true;
            }
            else
            {
                // Instanz, is child, get parent, and necessary parent vals
                TreeIter parentIter;
                currTreeStore.IterParent(out parentIter, currTreeIter);
                currParentIter = parentIter;

                nameString = "";
                krzlString = (string)currTreeStore.GetValue(currParentIter, (int)EventColumnId.Krzl);
                langString = (string)currTreeStore.GetValue(currParentIter, (int)EventColumnId.Sprache);

                textEntryEditable = false;
                cbLang.Sensitive  = cbKrzl.Sensitive = false;
            }

            // Set new values
            langPos = GtkHelper.FindInArray(API_Contract.SupportedLanguages, langString);
            krzlPos = GtkHelper.FindInArray(availKrzl, krzlString);

            cbKrzl.Active = krzlPos;
            cbLang.Active = langPos;
            timeBox.Time  = timeString;
            CurrText      = nameString;
            // Set default values
            origKrzlIndex = krzlPos;
            origLangIndex = langPos;
        }