var query = "SELECT [tblemployee].[id] ,[tblemployee].[EMP ID], [tblemployee].[FIRST NAME], [tblemployee].[LAST NAME], [tblemployee].[MIDDLE NAME], [tblempworkinfo].[NAME], [tblemployee].[EMAIL], [tblemployee].[EMAIL PASSWORD], [tblemployee].[ADDRESS], [tblemployee].[CONTACT], [tblemployee].[CIVIL STATUS], [tblemployee].[BIRTH DATE], [tblemployee].[BIRTH PLACE], [tblemployee].[EMERGENCY CONTACT], [tblemployee].[USERNAME], [tblemployee].[PASSWORD], [tblempworkinfo].[d_hired], [tblempworkinfo].[d_rate], [tblempworkinfo].DEPARTMENT, [tblempworkinfo].position, [tblempworkinfo].w_status, [tblempworkinfo].w_type FROM[tblemployee] INNER JOIN tblempworkinfo ON tblemployee.[EMP ID]=tblempworkinfo.[EMP ID]";
_sqlhelper.ViewDatagrid(dgEmployeeList, query);
var msgBoxResult = MessageBox.Show("Modify Employee Information", "Confirmation",
MessageBoxButton.YesNo, MessageBoxImage.Question);
switch(msgBoxResult)
{
case MessageBoxResult.Yes:
var row = (DataRowView)dgEmployeeList.SelectedItems[0];
{
var EditEmployee = new frmAddEmployee
{
txtID = { Text = (row["id"]).ToString(), Visibility = Visibility.Hidden },
txtEmpID = { Text = (row["EMP ID"]).ToString() },
txtFName = { Text = (row["FIRST NAME"]).ToString() },
txtLastName = { Text = (row["LAST NAME"]).ToString() },
txtMname = { Text = (row["MIDDLE NAME"]).ToString() },
txtEmail = { Text = (row["EMAIL"]).ToString() },
txtEmailPassword = { Text = row["EMAIL PASSWORD"].ToString() },
txtAddress = { Text = (row["ADDRESS"]).ToString() },
txtContacNo = { Text = row["CONTACT"].ToString() },
cmbStatus = { Text = row["CIVIL STATUS"].ToString() },
dtpdbirth = { Text = row["BIRTH DATE"].ToString() },
txtPlaceOfBirth = { Text = row["BIRTH PLACE"].ToString() },
txtEmergencyNo = { Text = row["EMERGENCY CONTACT"].ToString() },
txtPassword = { Text = row["password"].ToString() },
txtUsername = { Text = row["username"].ToString() },
txtRate = { Text = row["d_rate"].ToString() },
txtCompleteName = {Text = row["NAME"].ToString() },
cmbEmployeeStatus = { Text = row["w_status"].ToString() },
cmbPosition = { Text = row["position"].ToString() },
cmbDepartment = { Text = row["DEPARTMENT"].ToString() },
cmbWorkStatus = { Text = row["w_type"].ToString() },
dtpdatehired = { Text = row["d_hired"].ToString() },
btnSave = {Visibility = Visibility.Hidden },
btnUpdate = { Visibility = Visibility.Visible },
btnDelete = { Visibility = Visibility.Visible },