Example #1
0
        public void VehicleReports(string strHeader, String strVehicleReport)
        {
            bool   blnEmailSent;
            int    intCounter;
            int    intNumberOfRecords;
            string strEmailAddress;

            TheVehicleInspectionEmailListDataSet = TheSafetyClass.GetVehicleInspectionEmailListInfo();

            intNumberOfRecords = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist.Rows.Count - 1;

            for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
            {
                strEmailAddress = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist[intCounter].EmailAddress;

                blnEmailSent = SendEmail(strEmailAddress, strHeader, strVehicleReport);
            }
        }
Example #2
0
        public void EmailMessage(string strVehicleNumber, string strVehicleProblem)
        {
            bool   blnEmailSent;
            string strVehicleFailed;
            int    intCounter;
            int    intNumberOfRecords;
            string strEmailAddress;
            string strHeader = "Vehicle Inspection Failure - Do Not Reply";

            strVehicleFailed = "<h1>" + strHeader + "</h1>" + "<h3>" + "Vehicle Number " + strVehicleNumber + "</h3>" + "<p> Has Failed The Vehicle Inspection and Can Not Be Driven " + strVehicleProblem + "</p>";

            TheVehicleInspectionEmailListDataSet = TheSafetyClass.GetVehicleInspectionEmailListInfo();

            intNumberOfRecords = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist.Rows.Count - 1;

            for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
            {
                strEmailAddress = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist[intCounter].EmailAddress;

                blnEmailSent = SendEmail(strEmailAddress, strHeader, strVehicleFailed);
            }
        }
        public bool EmailMessage(string strVehicleNumber, string strVehicleProblem)
        {
            bool   blnFatalError = false;
            string strVehicleFailed;
            int    intCounter;
            int    intNumberOfRecords;
            string strEmailAddress;

            try
            {
                strVehicleFailed = strVehicleNumber + " Has Failed The Vehicle Inspection and Can Not Be Driven " + strVehicleProblem;

                TheVehicleInspectionEmailListDataSet = TheSafetyClass.GetVehicleInspectionEmailListInfo();

                intNumberOfRecords = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    strEmailAddress = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist[intCounter].EmailAddress;

                    blnFatalError = SendEmail(strEmailAddress, "Vehicle Inspection Failure - Do Not Reply", strVehicleFailed);

                    if (blnFatalError == true)
                    {
                        throw new Exception();
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Event Log Tracker // Send Email Class // Email Message " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());

                blnFatalError = true;
            }

            return(blnFatalError);
        }
        public bool VehicleReports(string strHeader, String strVehicleReport)
        {
            int    intCounter;
            int    intNumberOfRecords;
            string strEmailAddress;
            bool   blnFatalError = false;

            try
            {
                TheVehicleInspectionEmailListDataSet = TheSafetyClass.GetVehicleInspectionEmailListInfo();

                intNumberOfRecords = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist.Rows.Count - 1;

                for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++)
                {
                    strEmailAddress = TheVehicleInspectionEmailListDataSet.vehicleinspectionemaillist[intCounter].EmailAddress;

                    blnFatalError = SendEmail(strEmailAddress, strHeader, strVehicleReport);

                    if (blnFatalError == true)
                    {
                        throw new Exception();
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Event Log Tracker // Send Email Class // Vehicle Reports " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());

                blnFatalError = true;
            }

            return(blnFatalError);
        }