Example #1
0
 /// <summary>
 /// 添加学校
 /// </summary>
 public void Create(School school)
 {
     EventBus<School>.Instance().OnBefore(school, new CommonEventArgs(EventOperationType.Instance().Create()));
     school.PinyinName = Pinyin.GetPinyin(school.Name);
     school.ShortPinyinName = Pinyin.GetInitials(school.Name);
     schoolRepository.Insert(school);
     school.DisplayOrder = school.Id;
     schoolRepository.Update(school);
     EventBus<School>.Instance().OnAfter(school, new CommonEventArgs(EventOperationType.Instance().Create()));
 }
Example #2
0
        public static School New()
        {
            School school = new School()
            {
                Name = string.Empty,
                PinyinName = string.Empty,
                ShortPinyinName = string.Empty

            };
            return school;
        }