public Employees CreateEmployee(string email, string name, string role, int salary) { if (string.IsNullOrWhiteSpace(email)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(email)); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(name)); } if (string.IsNullOrWhiteSpace(role)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(role)); } if (salary < 0) { throw new ArgumentException("The parameter cannot be negative or empty.", nameof(salary)); } var d = new CreateEmployeeDataDelegate(email, name, role, salary); return(executor.ExecuteNonQuery(d)); }
public Employee CreateEmployee(string employeeName, string workPositionName, string departmentName, double hourlyPay) { if (string.IsNullOrWhiteSpace(employeeName)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(employeeName)); } if (string.IsNullOrWhiteSpace(workPositionName)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(workPositionName)); } if (string.IsNullOrWhiteSpace(departmentName)) { throw new ArgumentException("The parameter cannot be null or empty.", nameof(departmentName)); } var d = new CreateEmployeeDataDelegate(employeeName, workPositionName, departmentName, hourlyPay); return(executor.ExecuteNonQuery(d)); }