private static async Task ExportFileAFSJobAsync() { using (var client = new CSMFileServiceClient()) { Task <ExportAFSTaskResponse> t = client.ExportFileAFSAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword()); ExportAFSTaskResponse result = await t; } }
private static void SendMailTask(ExportAFSTaskResponse result) { _mailSender = TaskMailSender.GetTaskMailSender(); if (Constants.StatusResponse.Failed.Equals(result.StatusResponse.Status)) { _mailSender.NotifyExportActivityFailed(WebConfig.GetTaskEmailToAddress(), result.SchedDateTime, result.StatusResponse.Description); } Thread.Sleep(5000); }
public void SaveLogExportError(ExportAFSTaskResponse taskResponse) { if (taskResponse != null) { StringBuilder sb = new StringBuilder(""); sb.AppendFormat("Error Message = {0}\n", taskResponse.StatusResponse.Description); _auditLog = new AuditLogEntity(); _auditLog.Module = Constants.Module.Batch; _auditLog.Action = Constants.AuditAction.Export; _auditLog.IpAddress = ApplicationHelpers.GetClientIP(); _auditLog.Status = LogStatus.Fail; _auditLog.Detail = sb.ToString(); _auditLog.CreateUserId = null; _auditLog.CreatedDate = taskResponse.SchedDateTime; AppLog.AuditLog(_auditLog); } }
public void SaveLogExportSuccess(ExportAFSTaskResponse taskResponse) { if (taskResponse != null) { StringBuilder sb = new StringBuilder(""); sb.Append("Success to export activity\n"); sb.Append(taskResponse.ToString()); _auditLog = new AuditLogEntity(); _auditLog.Module = Constants.Module.Batch; _auditLog.Action = Constants.AuditAction.Export; _auditLog.IpAddress = ApplicationHelpers.GetClientIP(); _auditLog.Status = LogStatus.Success; _auditLog.Detail = sb.ToString(); _auditLog.CreateUserId = null; _auditLog.CreatedDate = taskResponse.SchedDateTime; AppLog.AuditLog(_auditLog); } }