using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Payroll.BO; using Ease.CoreV35.Model; using System.Threading; using System.IO; using Payroll.UI; namespace Payroll.Report { public partial class fLeavereport : Form { private ObjectsTemplate _employees; public fLeavereport() { InitializeComponent(); } #region Events private void btnEmployees_Click(object sender, EventArgs e) { _employees = null; lblEmployee.Text = ""; fSearchEmployee emp = new fSearchEmployee(); emp.SearchForSalary = false; emp.MultipleSelection = true; emp.ShowDialog(); lblEmployee.Text = emp.SelectedEmployees.Count.ToString() + " Employees has been seleted."; if (emp.SelectedEmployees.Count > 0) _employees = emp.GetEmployees(); } private void btnPreview_Click(object sender, EventArgs e) { Leave _oLeave = new Leave(); rptLeave oLeave = new rptLeave(); if (_employees == null) { MessageBox.Show("Please select employee.", "Input validation", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.Cursor = Cursors.WaitCursor; LeaveYear lyy = new LeaveYear(); lyy = (LeaveYear)cboLeaveYear.SelectedItem; oLeave.ShowLeaveReport(_employees, lyy); this.Cursor = Cursors.Default; } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } private void fLeavereport_Load(object sender, EventArgs e) { LoadcboLeaveYear(); } #endregion #region Functions private void LoadcboLeaveYear() { List _oLeaveYears = LeaveYear.Get(); foreach (LeaveYear item in _oLeaveYears) { cboLeaveYear.Items.Add(item); cboLeaveYear.DisplayMember = "Name"; } LeaveYear yer = _oLeaveYears.Where(obj => obj.IsCurrent).SingleOrDefault(); cboLeaveYear.SelectedItem = yer; lblEmployee.Text = "No Employee Selected !!!"; } #endregion } }