// Save/Add button. Manage. private void saveSkillManageButton_Click(object sender, EventArgs e) { string title; string message; bool edit = false; if (UtilFormFunctions.BoxContain(listBoxSkill, comboBoxSkill.Text)) { edit = true; } if (edit) { title = SaveConfirmTitle; message = SaveConfirmMessage; } else { title = CreateConfirmTitle; message = CreateConfirmMessage; } DialogResult result = MessageBox.Show(message, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (edit) { PSkill.SaveSkillAssign(UserID); MessageBox.Show(SaveSuccess); } else { PSkill.SkillAssign(UserID); MessageBox.Show(CreateSuccess); } RefreshForm(); } }
// Add Button. Skill Edit. private void addSkillButton_Click(object sender, EventArgs e) { string title = CreateConfirmTitle; string message = EditCreateConfirmMessage; if (UtilFormFunctions.BoxContain(listBoxSkillEdit, txtSkillName.Text)) { MessageBox.Show(SkillDupWarn, SkillDupWarnTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DialogResult result = MessageBox.Show(message, title, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { PSkillEdit.AddSkill(); MessageBox.Show(CreateSuccess); RefreshForm(); } }