private void expProecess_Expanded(object sender, RoutedEventArgs e)
        {
            string strValueForValidation;
            string strErrorMessage    = "";
            bool   blnThereIsAProblem = false;
            bool   blnFatalError      = false;

            try
            {
                expProecess.IsExpanded = false;

                strValueForValidation = txtStartDate.Text;
                blnThereIsAProblem    = TheDataValidationClass.VerifyDateData(strValueForValidation);
                if (blnThereIsAProblem == true)
                {
                    blnFatalError    = true;
                    strErrorMessage += "The Start Date is not a Date\n";
                }
                else
                {
                    gdatStartDate = Convert.ToDateTime(strValueForValidation);
                }
                strValueForValidation = txtEndDate.Text;
                blnThereIsAProblem    = TheDataValidationClass.VerifyDateData(strValueForValidation);
                if (blnThereIsAProblem == true)
                {
                    blnFatalError    = true;
                    strErrorMessage += "The End Date is not a Date\n";
                }
                else
                {
                    gdatEndDate = Convert.ToDateTime(strValueForValidation);
                }
                if (blnFatalError == true)
                {
                    TheMessagesClass.ErrorMessage(strErrorMessage);
                    return;
                }

                TheFindAlohaEmployeePunchesForManagerDataSet = TheEmployeePunchedHoursClass.FindAlohaPunchesByManager(gintManagerID, gdatStartDate, gdatEndDate);

                dgrResults.ItemsSource = TheFindAlohaEmployeePunchesForManagerDataSet.FindAlohaEmployeesPunchesByManager;
            }
            catch (Exception EX)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Employee Hours Punched // Process Expander " + EX.Message);

                TheMessagesClass.ErrorMessage(EX.ToString());
            }
        }
Example #2
0
        public FindAlohaEmployeePunchesByManagerDataSet FindAlohaPunchesByManager(int intManagerID, DateTime datStartDate, DateTime datEndDate)
        {
            try
            {
                aFindAlohaEmployeePunchesByManagerDataSet      = new FindAlohaEmployeePunchesByManagerDataSet();
                aFindAlohaEmployeePunchesByManagerTableAdapter = new FindAlohaEmployeePunchesByManagerDataSetTableAdapters.FindAlohaEmployeesPunchesByManagerTableAdapter();
                aFindAlohaEmployeePunchesByManagerTableAdapter.Fill(aFindAlohaEmployeePunchesByManagerDataSet.FindAlohaEmployeesPunchesByManager, intManagerID, datStartDate, datEndDate);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee Punched Hours Class // Find Aloha Punches By Manager " + Ex.Message);
            }

            return(aFindAlohaEmployeePunchesByManagerDataSet);
        }
        private void ResetControls()
        {
            int intCounter;
            int intNumberOfRecords;

            try
            {
                TheEmployeeDateEntryClass.InsertIntoEmployeeDateEntry(MainWindow.TheVerifyLogonDataSet.VerifyLogon[0].EmployeeID, "New Blue Jay ERP // Employee Hours Punched");

                cboSelectManager.Items.Clear();
                cboSelectManager.Items.Add("Select Manager");

                TheFindSortedEmployeeManagersDataSet = TheEmployeeClass.FindSortedEmployeeManagers();

                intNumberOfRecords = TheFindSortedEmployeeManagersDataSet.FindSortedEmployeeManagers.Rows.Count;

                for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                {
                    cboSelectManager.Items.Add(TheFindSortedEmployeeManagersDataSet.FindSortedEmployeeManagers[intCounter].FullName);
                }

                cboSelectManager.SelectedIndex = 0;

                txtEndDate.Text   = "";
                txtStartDate.Text = "";

                TheFindAlohaEmployeePunchesForManagerDataSet = TheEmployeePunchedHoursClass.FindAlohaPunchesByManager(-1, DateTime.Now, DateTime.Now);

                dgrResults.ItemsSource = TheFindAlohaEmployeePunchesForManagerDataSet.FindAlohaEmployeesPunchesByManager;
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Employee Hours Punched // Reset Controls " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }