private void SaveRoleInfo() { try { Roles role = new Roles(); role.roleName = ucRoles1.txtRoleName.Text; role.note = ucRoles1.txtNote.Text; role.description = ucRoles1.txtDescription.Text; role.fixedSalary = Convert.ToDouble(ucRoles1.txtSalaryRate.Text); if (isAdd == true) { _rolesRepository.Add(role); MessageBox.Show("Successful added!"); isAdd = false; LoadData(); Init(); } else if (isUpdate == true) { _rolesRepository.Update(selectedId, role); MessageBox.Show("Successful updated!"); isUpdate = false; LoadData(); Init(); } } catch (Exception) { } }
private void SaveRoleInfo() { try { Roles role = new Roles(); role.roleName = ucRoles1.txtRoleName.Text; role.note = ucRoles1.txtNote.Text; role.description = ucRoles1.txtDescription.Text; _rolesRepository.Add(role); MessageBox.Show("Successful added!"); } catch (Exception ex) { } }
public void Add([FromBody] Role role) { _rolesRepository.Add(role); }