private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { if (e.Node != null && e.Node.ParentNode != null) { this.employee = employeeManager.Get(e.Node.Tag.ToString()); try { } catch { MessageBox.Show("开始日期填写错误!", "系統提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { } catch { MessageBox.Show("结束日期填写错误!", "系統提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (this.employee != null) { this.lookUpEmployeeId.EditValue = this.employee.EmployeeId; } } }
private void btn_UpdateSelectedEmpSalary_Click(object sender, EventArgs e) { try { DateTime baseDate = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy/MM") + "/1"); foreach (DataRow dr in dataSet.Tables[0].Rows) { if (dr["IsChecked"].ToString() == "True") { Model.Employee emp = employeeManager.Get(dr["EmployeeId"].ToString()); if (emp != null) { ms.UpMonthSalFromClockFrm(emp, baseDate); } } } } catch (Exception ex) { MessageBox.Show("更新失敗!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } MessageBox.Show("更新成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); }