Example #1
0
        /// <summary>
        /// Approve business method.
        /// </summary>
        /// <param name="trainingRequest">A trainingRequest value.</param>
        public void Approve(TrainingRequest trainingRequest)
        {
            // Data access component declarations.
            var trainingRequestDAC = new TrainingRequestDAC();
            // trainingRequestDAC.SelectById(trainingRequest.TRequestID);

            TrainingRequest oldRequest = trainingRequestDAC.SelectById(trainingRequest.TRequestID);


            // Step 1 - Calling UpdateById on TrainingRequestDAC.
            trainingRequestDAC.UpdateById(trainingRequest);

            var auditLog = new AuditLog();

            auditLog.Module      = "Approve Training";
            auditLog.Action      = "Approve  Training";
            auditLog.Description = "Approve Training";
            auditLog.CreateBy    = Environment.MachineName;

            var auditor = new Auditor();

            auditor.AuditModified(auditLog, trainingRequest.RequestStatus, trainingRequest.RequestStatus);
            // auditor.AuditModified(auditLog, trainingRequest);
            //auditor.AuditAdded(auditLog, trainingRequest);
        }