コード例 #1
0
        public FindEmployeeProductivityMiscTotalHoursDataSet FindEmplolyeeProductivityMiscTotalHours()
        {
            try
            {
                aFindEmployeeProductivityMiscTotalhoursDataSet      = new FindEmployeeProductivityMiscTotalHoursDataSet();
                aFindEmployeeProductivityMiscTotalHoursTableAdpater = new FindEmployeeProductivityMiscTotalHoursDataSetTableAdapters.FindEmployeeProductivityMiscTotalHoursTableAdapter();
                aFindEmployeeProductivityMiscTotalHoursTableAdpater.Fill(aFindEmployeeProductivityMiscTotalhoursDataSet.FindEmployeeProductivityMiscTotalHours);
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Employee Project Assignment // Find Employee Productivity " + Ex.Message);
            }

            return(aFindEmployeeProductivityMiscTotalhoursDataSet);
        }
コード例 #2
0
        public void CreateEmployeeMiscReport()
        {
            //setting local variables
            int      intCounter;
            int      intNumberOfRecords;
            decimal  decTotalHours   = 0;
            string   strEmailAddress = "*****@*****.**";
            string   strHeader;
            string   strMessage;
            DateTime datPayDate    = DateTime.Now;
            bool     blnFatalError = false;
            int      intRecordsReturned;

            try
            {
                TheFindEmployeeProductionForMiscCodeDataSet = TheEmployeeProjectAssignmentClass.FindEmployeeProductionForMiscCode();

                intNumberOfRecords = TheFindEmployeesOverFortyHoursDataSet.FindEmployeesOverFortyHours.Rows.Count;

                TheFindEmployeeProductivityMiscTotalHoursDataSet = TheEmployeeProjectAssignmentClass.FindEmplolyeeProductivityMiscTotalHours();

                intRecordsReturned = TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode.Rows.Count;

                if (intRecordsReturned > 0)
                {
                    decTotalHours = TheFindEmployeeProductivityMiscTotalHoursDataSet.FindEmployeeProductivityMiscTotalHours[0].TotalHours;
                }

                strHeader = "Employee Production for Misc with a Total Hours of " + Convert.ToString(decTotalHours);

                strMessage  = "<h1>Employee Production for Misc with a Total Hours of " + Convert.ToString(decTotalHours) + "</h1>";
                strMessage += "<p>               </p>";
                strMessage += "<p>               </p>";
                strMessage += "<table>";
                strMessage += "<tr>";
                strMessage += "<td><b>Date</b></td>";
                strMessage += "<td><b>BJC Project ID</b></td>";
                strMessage += "<td><b>Customer Project ID</b></td>";
                strMessage += "<td><b>Project Name</b></td>";
                strMessage += "<td><b>First Name</b></td>";
                strMessage += "<td><b>Last Name</b></td>";
                strMessage += "<td><b>Home Office</b></td>";
                strMessage += "<td><b>Total Hours</b></td>";
                strMessage += "</tr>";
                strMessage += "<p>               </p>";

                if (intNumberOfRecords > 0)
                {
                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        strMessage += "<tr>";
                        strMessage += Convert.ToString(TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].TransactionDate);
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].AssignedProjectID + "</td>";
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].CustomerAssignedID + "</td>";
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].ProjectName + "</td>";
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].FirstName + "</td>";
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].LastName + "</td>";
                        strMessage += "<td>" + TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].HomeOffice + "</td>";
                        strMessage += "<td>" + Convert.ToString(TheFindEmployeeProductionForMiscCodeDataSet.FindEmployeeProductionForMiscCode[intCounter].TotalHours) + "</td>";
                        strMessage += "</tr>";
                        strMessage += "<p>               </p>";
                    }
                }

                strMessage += "</table>";

                blnFatalError = TheSendEmailClass.SendEmail(strEmailAddress, strHeader, strMessage);

                if (blnFatalError == true)
                {
                    throw new Exception();
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Event Log Tracker // Run Punched Vs Production Class // Create Employee Misc Report " + Ex.Message);

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