Hi guys I need to make notification icon to any computers in Hr department when i added new Employee

because my employee in my company forget to tell each others about any new employee added

so that some process will by delayed


IF i have 4 computers in HR Department and 4 computers connected BY DOMAIN
computer 1 ip

computer 2 ip

computer 3 ip

computer 4 ip

and computer 1 his ip added new Employee successfully

after added employee computer 2 AND computer 3 AND computer 4 must have notification from computer 1

that new employee added

SqlConnection con = new SqlConnection();
cmd = new SqlCommand("INSERT_EmployeEa12", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@DriverID", textBox1.Text);
cmd.Parameters.AddWithValue("@DriverName", textBox2.Text);
cmd.Parameters.AddWithValue("@EmplyeeName", textBox18.Text);
cmd.Parameters.AddWithValue("@ResidentNo", textBox6.Text);
cmd.Parameters.AddWithValue("@PlaceOfBirth", textBox17.Text);
cmd.Parameters.AddWithValue("@PassportNo", textBox21.Text);
int n = cmd.ExecuteNonQuery();
if (n > 0)
MessageBox.Show("record inserted Success");
MessageBox.Show("record inserted Failed");

Code insert OK working but my problem how to implement notification for new Employee added

2 Years
Discussion Span
Last Post by cgeier

Off the top of my head, I might approach it two ways:

  1. Simply have the application check periodically for new records. This would be the easiest to implement, but it may see derading performance over time.

  2. Use a notification service that pushes new records to client applications so that they can pop up a notification box or something. This would be my preference, probably using a WCF service.


You could create an additional table, called "NewUsers". Create a trigger that populates this table when a record is added (Alternatively, rather than using a trigger, your application could create an entry in "NewUsers" table when it adds a new user to the employee table.) You probably want to create one entry for each HR employee. So the primary key would be a combination of newUserEmpId and empId of each HR user (HREmpId). The application periodically checks this table. When an entry is found, a pop-up message occurs (or whatever other notification method you want to use. Maybe a form with a datagridview that shows new users). When the HR employee clicks "Acknowledge" (or "OK") delete the entry from "NewUsers" (for that particular HREmpId).

This should eliminate/reduce performance impact as it is checking a table with only a few rows, rather than the entire employee table.

Ex: NewUsers

EmpId HREmpId
------- ---------
255000 1234
255000 120001
255000 230122
255001 1234
255001 120001
255001 230122

In the above example, there are new new employees: 255000 and 255001. There are 3 HR employees that need to be notified: 1234, 120001, and 230122.

After HR employee 1234 acknowledges that he/she is now aware that new employee "255000" exists, the entry is deleted. The "NewUsers" table now looks like the following:

EmpId HREmpId
------- ---------
255000 120001
255000 230122
255001 1234
255001 120001
255001 230122

You could change HREmpId to an IP address. Which I wouldn't recommended, because an IP address change would break your application.

Note: If you use a trigger, issues may arise if for some reason the trigger didn't fire.

Edited by cgeier

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.