Example #1
0
 partial void AuditFindings_Validate(AuditFinding entity, EntitySetValidationResultsBuilder results)
 {
     if (entity.DateFindingClosed != null & entity.FindingDate != null)
     {
         if (entity.DateFindingClosed < entity.FindingDate)
         {
             results.AddEntityError("An audit finding cannot be closed before it is opened");
         }
     }
 }
 partial void AuditFindings_Validate(AuditFinding entity, EntitySetValidationResultsBuilder results)
 {
     if (entity.DateFindingClosed != null & entity.FindingDate != null)
     {
         if (entity.DateFindingClosed < entity.FindingDate)
         {
             results.AddEntityError("An audit finding cannot be closed before it is opened");
         }
     }
 }
Example #3
0
        partial void AuditFindings_Inserted(AuditFinding entity)
        {
            if (entity.AssignedTo.Email != string.Empty)
            {
                string subject = "New Audit Finding Assigned to you";

                string message = string.Format("<html><body>Dear {0} {1}.<br></br><p>The following audit finding has been assigned to you for resolution:<br></br>Audit Code: {2}.<br></br>Audit Description: {3}.<br></br>Finding Reference: {4}.<br></br>Finding Description: {5}<br></br></p></body></html>", entity.AssignedTo.FirstName, entity.AssignedTo.LastName, entity.Audit.AuditCode, entity.Audit.AuditDescription, entity.FindingReference, entity.FindingDescription);

                List <string> mailTos = new List <string>();

                mailTos.Add(entity.AssignedTo.Email);

                SendEmail(mailTos, subject, message);
            }
        }
        partial void AuditFindings_Inserted(AuditFinding entity)
        {
            if (entity.AssignedTo.Email != string.Empty)
            {
                string subject = "New Audit Finding Assigned to you";

                string message = string.Format("<html><body>Dear {0} {1}.<br></br><p>The following audit finding has been assigned to you for resolution:<br></br>Audit Code: {2}.<br></br>Audit Description: {3}.<br></br>Finding Reference: {4}.<br></br>Finding Description: {5}<br></br></p></body></html>", entity.AssignedTo.FirstName, entity.AssignedTo.LastName, entity.Audit.AuditCode, entity.Audit.AuditDescription, entity.FindingReference, entity.FindingDescription);

                List<string> mailTos = new List<string>();

                mailTos.Add(entity.AssignedTo.Email);

                SendEmail(mailTos, subject, message);
            }
        }