protected void LoadData() { all_rows = MonthlyRembursementSalaryItem.GetMonthlyWageLoanItems(Convert.ToInt32(year.Value), Convert.ToInt32(month.EditValue)); all_rows = all_rows.OrderByDescending(a => a.报账标准_税前_年).ThenBy(a => a.部门).ThenBy(a => a.职务).ToList(); gridControl1.DataSource = all_rows; gridControl1.RefreshDataSource(); gridControl1.Refresh(); }
public RembursementSalaryVoucher(MonthlyRembursementSalaryItem item) { InitializeComponent(); 报账记录 = item; xr标题.Text = string.Format("{0} 年 {1}月份支出单", 报账记录.年, 报账记录.月); xr实支金额.Text = 报账记录.实际报销金额_大写; xr复核金额.Text = "¥" + 报账记录.实际报账金额.ToString("0.00"); xr核销金额.Text = "¥" + 报账记录.实际报账金额.ToString("0.00"); }
private void bandedGridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { MonthlyRembursementSalaryItem item = bandedGridView1.GetRow(bandedGridView1.FocusedRowHandle) as MonthlyRembursementSalaryItem; if (item != null && e.Column.Caption == "打印") { RembursementSalaryVoucher report = new RembursementSalaryVoucher(item); ReportPrintTool tool = new ReportPrintTool(report); tool.PrintDialog(); } }
private void ShowPrintDialog() { MonthlyRembursementSalaryItem item = bandedGridView1.GetRow(bandedGridView1.FocusedRowHandle) as MonthlyRembursementSalaryItem; if (item != null) { RembursementSalaryVoucher report = new RembursementSalaryVoucher(item); ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); } }
private void OnEmployeeSelectd(object sender, EmployeeInfo emp) { if (currEntryRows.Find(a => a.员工编号 == emp.员工编号) == null) { MonthlyRembursementSalaryItemEntry item = MonthlyRembursementSalaryItemEntry.AddMonthlyRembursementSalaryItemEntry(emp.员工编号, emp.姓名, year, month, isCheck); //如果记录已生效,清除生效标记 if (item.已生效) { item.生效时间 = DateTime.MinValue; item.Save(); MonthlyRembursementSalaryItemEntry opposite = item.另一人录入的记录; if (opposite != null) { opposite.生效时间 = DateTime.MinValue; opposite.Save(); } } //更新上月剩余金额 MonthlyRembursementSalaryItem lastMonthItem = item.月发放记录; if (lastMonthItem != null) { item.月剩余金额 = lastMonthItem.本月剩余可报账金额; //如果上个月是1月 if (lastMonthItem.月 == 12) { item.年剩余金额 = lastMonthItem.本年剩余可报账金额; } else { item.年剩余金额 = lastMonthItem.年剩余可报账金额; } item.Save(); //更新对向 MonthlyRembursementSalaryItemEntry opposite = item.另一人录入的记录; if (opposite != null) { opposite.月剩余金额 = item.月剩余金额; opposite.年剩余金额 = item.年剩余金额; opposite.Save(); } } currEntryRows.Add(item); gridControl1.RefreshDataSource(); bandedGridView1.FocusedRowHandle = bandedGridView1.RowCount - 1; MyHelper.WriteLog(LogType.信息, "新增员工每月报账工资录入记录", item.ToString <MonthlyRembursementSalaryItemEntry>()); } }
private void EditMonthlyRembursementSalaryItemForm_Load(object sender, EventArgs e) { this.Text = "员工报账金额录入 - " + currMonthlyRembursementSalaryItemEntry.员工编号 + " - " + (currMonthlyRembursementSalaryItemEntry.是验证录入 ? "验证录入" : "初次录入"); MonthlyRembursementSalaryItem lastMonthItem = currMonthlyRembursementSalaryItemEntry.月发放记录; groupControl期初数据.Visible = lastMonthItem == null; if (groupControl期初数据.Visible == false) { this.Size = new Size(this.Size.Width, this.Size.Height - 60); } if (lastMonthItem == null) { spinEdit上年剩余金额.Enabled = true; spinEdit上月剩余金额.Enabled = true; spinEdit本月可报账金额.Value = currMonthlyRembursementSalaryItemEntry.本月报账工资标准; } else { spinEdit上年剩余金额.Enabled = false; spinEdit上月剩余金额.Enabled = false; spinEdit上月剩余金额.Value = lastMonthItem.本月剩余可报账金额; //如果上个月是1月 if (lastMonthItem.月 == 12) { spinEdit上年剩余金额.Value = lastMonthItem.本年剩余可报账金额; } else { spinEdit上年剩余金额.Value = lastMonthItem.年剩余可报账金额; } spinEdit本月可报账金额.Value = currMonthlyRembursementSalaryItemEntry.本月报账工资标准 + lastMonthItem.本月剩余可报账金额; } LoadData(); }