private void startClearAndInitAttendRecord() { DateTime dtstart = DateTime.Parse(txtStartDate.Text); DateTime dtEnd = DateTime.Parse(txtEndDate.Text); DialogResult MsgBoxResult;//设置对话框的返回值 MsgBoxResult = MessageBox.Show("开始处理:" + dtstart.ToShortDateString() + "-" + dtEnd.ToShortDateString() + "的异常及考勤,确认继续?", //对话框的显示内容 "提示", //对话框的标题 MessageBoxButtons.YesNo, //定义对话框的按钮,这里定义了YSE和NO两个按钮 MessageBoxIcon.Exclamation, //定义对话框内的图表式样,这里是一个黄色三角型内加一个感叹号 MessageBoxDefaultButton.Button2); //定义对话框的按钮式样 if (MsgBoxResult == DialogResult.Yes) //如果对话框的返回值是YES(按"Y"按钮) { ShowMessageAsny("*********************************开始处理指定公司员工的考勤异常及初始化考勤记录"); int j = 0; OracleHelp.Connect(); for (int i = 0; i < dataGridEmployees.RowCount; i++) { try { GlobalParameters.employeeName = dataGridEmployees.Rows[i].Cells["employeename"].EditedFormattedValue.ToString(); GlobalParameters.employeeid = dataGridEmployees.Rows[i].Cells["employeeid"].EditedFormattedValue.ToString(); string sql = CleareEployeesignindetail1() + ClearePersonalrecord() + Clearet_wf_dotask3() + CleareEmployeesigninrecord4() + CleareEmployeeabnormrecord5() + CleareEmployeeabnormrecord6(); ShowMessageAsny("*******开始处理:" + GlobalParameters.employeeName + " 清理考勤异常及初始化考勤记录"); j = OracleHelp.Excute(CleareEployeesignindetail1()); ShowMessageAsny("第一步完成,处理了:" + j + "条数据!"); j = OracleHelp.Excute(ClearePersonalrecord()); ShowMessageAsny("第二步完成,处理了:" + j + "条数据!"); j = OracleHelp.Excute(Clearet_wf_dotask3()); ShowMessageAsny("第三步完成,处理了:" + j + "条数据!"); j = OracleHelp.Excute(CleareEmployeesigninrecord4()); ShowMessageAsny("第四步完成,处理了:" + j + "条数据!"); j = OracleHelp.Excute(CleareEmployeeabnormrecord5()); ShowMessageAsny("第五步完成,处理了:" + j + "条数据!"); j = OracleHelp.Excute(CleareEmployeeabnormrecord6()); ShowMessageAsny("第六步完成,处理了:" + j + "条数据!"); ShowMessageAsny("*******处理完成:" + GlobalParameters.employeeName + " 清理考勤异常及初始化考勤记录"); } catch (Exception ex) { ShowMessageAsny("处理异常:" + GlobalParameters.employeeName + " 异常信息:" + ex.ToString()); } } OracleHelp.close(); ShowMessageAsny("*********************************已处理完成所有指定公司员工的考勤异常及初始化考勤记录"); } }
private void UpdateSalaryBlancePostid(string salaryarchiveid) { bool needAdd = false; DateTime date = DateTime.Parse(txtStartDate.Text); string sql = @"update smthrm.t_hr_salaryarchive t set "; if (!string.IsNullOrEmpty(txBalancePostid.Text)) { sql += @" t.balancepostid='" + txBalancePostid.Text + @"' ,t.balancepostname='" + txtBlancePostName.Text + @"'"; needAdd = true; } if (!string.IsNullOrEmpty(txtPayCompany.Text)) { if (needAdd) { sql += @" ,"; } sql += @" t.paycompany='" + txtPayCompany.Text + @"'"; needAdd = true; } if (!string.IsNullOrEmpty(txtAttendCompany.Text)) { if (needAdd) { sql += @" ,"; } sql += @" t.attendanceorgid='" + txtAttendCompany.Text + @"' ,t.attendanceorgname='" + txtAttendCompanyName.Text + @"'"; } sql += @" where t.salaryarchiveid='" + salaryarchiveid + @"'"; OracleHelp.Connect(); int i = OracleHelp.Excute(sql); txtMessagebox.Text = "更新员工薪资档案信息成功,影响记录数:" + i; OracleHelp.close(); }
private void UpdateEmployeeState(string employeeId) { DialogResult MsgBoxResult; //设置对话框的返回值 MsgBoxResult = MessageBox.Show("是否更新此员工状态为在职?", //对话框的显示内容 "提示", //对话框的标题 MessageBoxButtons.YesNo, //定义对话框的按钮,这里定义了YSE和NO两个按钮 MessageBoxIcon.Exclamation, //定义对话框内的图表式样,这里是一个黄色三角型内加一个感叹号 MessageBoxDefaultButton.Button2); //定义对话框的按钮式样 if (MsgBoxResult == DialogResult.Yes) //如果对话框的返回值是YES(按"Y"按钮) { string sql = @"update smthrm.t_hr_employee t set t.employeestate='1' where t.employeeid='" + GlobalParameters.employeeid + "'"; OracleHelp.Connect(); int i = OracleHelp.Excute(sql); txtMessagebox.Text = "更新员工状态完成,处理了:" + i + "条数据!" + System.Environment.NewLine + txtMessagebox.Text; OracleHelp.close(); } }
private void UpdatePost(string isAgence, string isActived, string employeePostId) { DialogResult MsgBoxResult; //设置对话框的返回值 MsgBoxResult = MessageBox.Show("是否确认更新此员工岗位?", //对话框的显示内容 "提示", //对话框的标题 MessageBoxButtons.YesNo, //定义对话框的按钮,这里定义了YSE和NO两个按钮 MessageBoxIcon.Exclamation, //定义对话框内的图表式样,这里是一个黄色三角型内加一个感叹号 MessageBoxDefaultButton.Button2); //定义对话框的按钮式样 if (MsgBoxResult == DialogResult.Yes) //如果对话框的返回值是YES(按"Y"按钮) { string sql = @"update smthrm.t_hr_employeepost t set t.isagency='" + isAgence + @"',t.editstate='" + isActived + @"' where t.employeepostid='" + employeePostId + "'"; OracleHelp.Connect(); int i = OracleHelp.Excute(sql); txtMessagebox.Text = "处理完成,处理了:" + i + "条数据!" + System.Environment.NewLine + txtMessagebox.Text; OracleHelp.close(); } }
private void delAttendrecordAll() { ShowMessageAsny("----------------------开始删除员工考勤初始化记录......"); OracleHelp.Connect(); for (int i = 0; i < dataGridEmployees.RowCount; i++) { GlobalParameters.employeeid = dataGridEmployees.Rows[i].Cells["employeeid"].EditedFormattedValue.ToString(); GlobalParameters.employeeName = dataGridEmployees.Rows[i].Cells["employeename"].EditedFormattedValue.ToString(); string sql = @"delete smthrm.t_hr_attendancerecord a where a.ownercompanyid = '" + GlobalParameters.employeeMasterCompanyid + @"' and a.ownerid = '" + GlobalParameters.employeeid + @"' and a.attendancedate >= To_Date('" + GlobalParameters.StartDate + @"', 'yyyy-MM-dd') and a.attendancedate <= To_Date('" + GlobalParameters.EndDate + @"', 'yyyy-MM-dd')"; int j = OracleHelp.Excute(sql); ShowMessageAsny("删除员工:" + GlobalParameters.employeeName + " 考勤初始化记录完成,处理了:" + j + "条数据!"); } OracleHelp.close(); ShowMessageAsny("----------------------删除员工考勤初始化记录完成!"); }
private void delSalaryrecord(string salaryrecordid) { string sql = @"delete from smthrm.T_HR_EmployeeSalaryRecordItem t where t.employeesalaryrecordid in ( select a.employeesalaryrecordid from smthrm.t_hr_employeesalaryrecord a where a.EMPLOYEESALARYRECORDID='" + salaryrecordid + @"' )"; OracleHelp.Connect(); int i = OracleHelp.Excute(sql); txtMessagebox.Text = "删除员工薪资记录项目成功,影响记录数:" + i + System.Environment.NewLine + txtMessagebox.Text; sql = @"delete from smthrm.t_hr_employeesalaryrecord a where a.EMPLOYEESALARYRECORDID ='" + salaryrecordid + @"'"; i = OracleHelp.Excute(sql); txtMessagebox.Text = "删除员工薪资记录成功,影响记录数:" + i + System.Environment.NewLine + txtMessagebox.Text;; OracleHelp.close(); }