private void btnSave_Click(object sender, EventArgs e) { if (!Valid()) { return; } RecipeService service = new RecipeService(); var result = service.Save(Entity); if (!string.IsNullOrEmpty(result)) { MessageBox.Show(result, "错误"); return; } MessageBox.Show("保存成功"); DialogResult = DialogResult.OK; }
private void btnMerge_Click(object sender, EventArgs e) { RecipeService recipeService = new RecipeService(); string result; try { result = recipeService.Merge(Entity); } catch (Exception ex) { result = ex.Message; } if (!string.IsNullOrEmpty(result)) { MessageBox.Show(result); return; } MessageBox.Show("文件创建成功:" + Entity.OutputConfigFile); DialogResult = DialogResult.OK; }