public void UpdateOrInsert(Employee employee)
 {
     string query = $@"IF EXISTS (SELECT TOP 1 *
                                  FROM Employees
                                  WHERE EmployeeID = {employee.ID})
                         BEGIN
                         UPDATE Employees
                         SET FirstName = '{employee.FirstName}'
                         SET LastName = '{employee.LastName}'
                         SET Email = '{employee.Email}'
                         SET [Date of Birth] = '{employee.BirthDate.ToString(@"yyyy-MM-dd")}'
                         SET ManagerID = {employee.ManagerID}
                         SET DepartmentID = {employee.DepartmentID}
                         WHERE EmployeeID = {employee.ID}
                         END
                        ELSE
                         BEGIN
                         SET IDENTITY_INSERT Employees ON
                         INSERT INTO Employees
                         VALUES ({employee.ID}, '{employee.FirstName}', '{employee.LastName}', '{employee.Email}', '{employee.BirthDate.ToString(@"yyyy-MM-dd")}', {employee.ManagerID}, {employee.DepartmentID})
                         SET IDENTITY_INSERT Employees OFF
                         END";
     ExecuteNonQuery(query);
 }
        public void UpdateOrInsert(Employee emp)
        {
            string query = $@"IF EXISTS (SELECT TOP 1 *
                                        FROM Employees
                                        WHERE EmployeeID = {emp.Id})
                                BEGIN
                                    UPDATE Employees
                                    SET FirstName = '{emp.FirstName}'
                                    SET LastName = '{emp.LastName}'
                                    SET Email = '{emp.Email}'
                                    SET BirthDate = '{emp.BirthDate.ToString(@"yyyy-MM-dd")}'
                                    SET Manager = {emp.ManagerId}
                                    SET Department = {emp.ManagerId}
                                    WHERE EmployeeID = {emp.Id}
                                END
                              ELSE
                                BEGIN
                                    SET IDENTITY_INSERT Employees ON
                                    INSERT INTO Employees
                                    VALUES ({emp.Id}, '{emp.FirstName}', '{emp.LastName}', '{emp.Email}', '{emp.BirthDate.ToString(@"dd-MM-yyyy")}', {emp.ManagerId}, {emp.DepartmentId});
                                    SET IDENTITY_INSERT Employees OFF
                                END";

            ExecuteNonQuery(query);
        }