Пример #1
0
 private static async Task ReSubmitActivityToCBSHPSystem()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <ReSubmitActivityToCBSHPSystemTaskResponse> t      = client.ReSubmitActivityToCBSHPSystemAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         ReSubmitActivityToCBSHPSystemTaskResponse        result = await t;
     }
 }
Пример #2
0
 private async Task ExportDailySRReport()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <ExportSRTaskResponse> t      = client.DailySRReportAsync();
         ExportSRTaskResponse        result = await t;
     }
 }
Пример #3
0
 private static async Task CreateSRActivityFromReplyEmail()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <CreateSrFromReplyEmailTaskResponse> t      = client.CreateSRActivityFromReplyEmailAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         CreateSrFromReplyEmailTaskResponse        result = await t;
     }
 }
Пример #4
0
 private async Task ExportDailySRReport()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <CSM.Service.Messages.SchedTask.ExportSRTaskResponse> t      = client.DailySRReportAsync();
         CSM.Service.Messages.SchedTask.ExportSRTaskResponse        result = await t.ConfigureAwait(false);
     }
 }
Пример #5
0
 private static async Task ReSubmitActivityToCBSHPSystem()
 {
     using (var client = new CSMSRServiceClient())
     {
         Task <CSM.Service.Messages.SchedTask.ReSubmitActivityToCBSHPSystemTaskResponse> t      = client.ReSubmitActivityToCBSHPSystemAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         CSM.Service.Messages.SchedTask.ReSubmitActivityToCBSHPSystemTaskResponse        result = await t.ConfigureAwait(false);
     }
 }
Пример #6
0
 private static async Task CreateSRActivityFromReplyEmail()
 {
     using (var client = new CSMSRServiceClient())
     {
         //Task<CSM.Service.Messages.SchedTask.CreateSrFromReplyEmailTaskResponse> t = client.CreateSRActivityFromReplyEmailAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword());
         //CSM.Service.Messages.SchedTask.CreateSrFromReplyEmailTaskResponse result = await t.ConfigureAwait(false);
         using (Task <CSM.Service.Messages.SchedTask.CreateSrFromReplyEmailTaskResponse> t = client.CreateSRActivityFromReplyEmailAsync(WebConfig.GetWebUsername(), WebConfig.GetWebPassword()))
         {
             CSM.Service.Messages.SchedTask.CreateSrFromReplyEmailTaskResponse result = await t.ConfigureAwait(false);
         }
     }
 }
Пример #7
0
        public static void ReSubmitActivityToCARSystem()
        {
            try
            {
                Logger.Info("I:--START--");

                Task <ReSubmitActivityToCARSystemTaskResponse> task;
                using (var client = new CSMSRServiceClient())
                {
                    task = client.ReSubmitActivityToCARSystemAsync(WebConfig.GetTaskUsername(),
                                                                   WebConfig.GetTaskPassword());
                }

                while (!task.IsCompleted)
                {
                    Thread.Sleep(1000);
                }

                if (task.Exception != null)
                {
                    Logger.InfoFormat("O:--FAILED--:Exception/{0}", task.Exception);
                    Logger.Error("Exception occur:\n", task.Exception);

                    // Send mail to system administrator
                    _mailSender = TaskMailSender.GetTaskMailSender();
                    _mailSender.NotifyReSubmitActivityToCARSystemFailed(WebConfig.GetTaskEmailToAddress(), DateTime.Now, task.Exception);
                    Thread.Sleep(5000);
                }
                //else
                //{
                //    var result = task.GetAwaiter().GetResult();
                //    Logger.InfoFormat("O:--SUCCESS--:Task Result/{0}", result);

                //    // Send mail to system administrator
                //    SendMailTask(result);
                //}
            }
            catch (Exception ex)
            {
                Logger.InfoFormat("O:--FAILED--:Exception/{0}", ex.Message);
                Logger.Error("Exception occur:\n", ex);

                // Send mail to system administrator
                _mailSender = TaskMailSender.GetTaskMailSender();
                _mailSender.NotifyReSubmitActivityToCARSystemFailed(WebConfig.GetTaskEmailToAddress(), DateTime.Now, new AggregateException(ex));
                Thread.Sleep(5000);
            }
        }
Пример #8
0
        public static SearchSRResponse GetSrDelegateDataTab18_4(string employeeCode, int pageIndex, int pageSize)
        {
            var request = new SearchSRRequest();

            request.Header = new WebServiceHeader2();
            request.Header.service_name       = AppConstant.GetCSMServiceName;
            request.Header.user_name          = AppConstant.GetCSMUsername;
            request.Header.system_code        = AppConstant.GetCSMSystemCode;
            request.Header.password           = AppConstant.GetCSMPassword;
            request.Header.command            = "SearchSr";
            request.EmployeeCodeforDelegateSR = employeeCode;
            request.StartPageIndex            = pageIndex;
            request.PageSize = pageSize;

            CSMSRServiceClient client = new CSMSRServiceClient();

            return(client.SearchSR(request));
        }