Esempio n. 1
0
        public IDictionary <string, object> ToData(KindsOfTextCase txtCase)
        {
            Func <string, string> textFormat = (x) => VocaBase.TransformText(x, txtCase);
            var itemData = ToData(txtCase, HighSchools.Cast <IObviate>().ToList());
            var moreData = ToData(txtCase, Universities.Cast <IObviate>().ToList());

            foreach (var k in moreData.Keys)
            {
                if (itemData.ContainsKey(k))
                {
                    itemData[k] = moreData[k];
                }
                else
                {
                    itemData.Add(k, moreData[k]);
                }
            }

            itemData.Add(textFormat(nameof(EduFlag)), EduFlag);
            var lvl = EduLevel;

            if (!string.IsNullOrWhiteSpace(lvl))
            {
                itemData.Add(textFormat(nameof(EduLevel)), lvl);
            }

            return(itemData);
        }
Esempio n. 2
0
        public void RefreshHighSchoolsProperty()
        {
            HighSchools.Clear();

            try
            {
                HighSchool item0 = new HighSchool {
                    Id = 0, Name = string.Empty
                };
                HighSchools.Add(item0);
                DbContext.HighSchools.OrderBy(x => x.Name).ToList().ForEach(x => HighSchools.Add(x));
                OnPropertyChanged(nameof(HighSchools));
            }
            catch (EntityException e)
            {
                OnEntityException(e);
            }
            catch (DbEntityValidationException e)
            {
                OnDbEntityValidationException(e);
            }
        }
Esempio n. 3
0
        public void RefreshHighSchoolsForSearchProperty()
        {
            HighSchools.Clear();

            try
            {
                HighSchool item0 = new HighSchool {
                    Id = 0, Name = DafaultConstant.DefaultHighSchool
                };
                HighSchoolsForSearch.Add(item0);
                DbContext.HighSchools.OrderBy(x => x.Name).ToList().ForEach(x => HighSchoolsForSearch.Add(x));
                OnPropertyChanged(nameof(HighSchoolsForSearch));
            }
            catch (EntityException e)
            {
                OnEntityException(e);
            }
            catch (DbEntityValidationException e)
            {
                OnDbEntityValidationException(e);
            }
        }