private void btnView_Click(object sender, RoutedEventArgs e)
        {
            //try
            //{
            db    = new LetranIntegratedSystemEntities();
            HList = new List <HistoryList>();

            if (!String.IsNullOrEmpty(cbEmployee.Text))
            {
                var empid = Convert.ToInt32(cbEmployee.SelectedValue);
                var hist  = db.GetHRiSLeaveEmployeeHistory(empid).OrderByDescending(m => m.EndDate).ToList();

                if (hist != null)
                {
                    foreach (var x in hist)
                    {
                        HistoryList hl = new HistoryList();
                        hl.Days    = x.Days.Value;
                        hl.EndDate = x.EndDate.Value;
                        //hl.FiledDate = x.FiledDate.Value;
                        hl.LeaveID     = x.LeaveID;
                        hl.LeaveType   = x.LeaveType;
                        hl.LeaveTypeID = x.LeaveTypeID;
                        hl.Reason      = x.Reason;
                        hl.StartDate   = x.StartDate.Value;
                        // hl.Status = x.ApprovedStatus;
                        hl.EmployeeID   = db.Employees.Find(x.EmployeeID).EmployeeID;
                        hl.EmployeeNo   = db.Employees.Find(x.EmployeeID).EmployeeNo;
                        hl.EmployeeName = db.Employees.Find(x.EmployeeID).LastName.ToUpper() + ", " + db.Employees.Find(x.EmployeeID).FirstName.ToUpper();
                        HList.Add(hl);
                    }
                    if (String.IsNullOrEmpty(cbType.Text))
                    {
                        HList = HList.ToList();
                    }
                    else
                    {
                        var typeid = Convert.ToInt32(cbType.SelectedValue);
                        HList = HList.Where(m => m.LeaveTypeID == typeid).ToList();
                    }
                    dgLeaveHistory.ItemsSource = HList;
                }
            }
            else
            {
                MessageBox.Show("Employee cannot be empty!", "System Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            //}
            //catch
            //{
            //    MessageBox.Show("Something went wrong!", "System Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            //}
        }