private void Button_Click(object sender, RoutedEventArgs e) { string Name = DiseaseName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Disease, Name); if (Name == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("疾病名称不能为空", "The disease name can not be null")); } else if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("疾病名称已存在", "The name of the disease has already existed")); } else { string value = this.DiseaseName.Text; customDataService.InsertCustomData(CustomDataEnum.Disease, value); this.Close(); } }
private void Button_SaveClick(object sender, RoutedEventArgs e) { //获取文本框的值 string Name = GroupName.Text; CustomData CustomData = CustomDataDAO.GetListByTypeIDAndName(CustomDataEnum.Group, Name); if (Name == "") { MessageBoxX.Info(LanguageUtils.ConvertLanguage("小组名称不能为空", "The group name can not be null")); } else if (CustomData != null) { MessageBoxX.Info(LanguageUtils.ConvertLanguage("小组名称已存在", "The group has already existed")); } else { string value = this.GroupName.Text; Console.WriteLine(value); customDataService.InsertCustomData(CustomDataEnum.Group, value); this.Close(); } }