コード例 #1
0
ファイル: Heartbeat.cs プロジェクト: 0huah0/csharp-samples
        private static BaseResponse GetResponse(Methods methodCalled, PingRequest ahRequest)
        {
            string className = "SFGWrapper.Heartbeat";
            BaseResponse baseResponse = new BaseResponse();
            try
            {
                using (HeartbeatService svc = new HeartbeatService())
                {
                    svc.Timeout = 20000;
                    svc.Credentials = new System.Net.NetworkCredential(ahRequest.ServiceUsername, ahRequest.ServicePassword);
                    argtype sfgRequest = HeartbeatTranslators.TranslateToSfgRequest(ahRequest);
                    switch (methodCalled)
                    {
                        case Methods.PING:
                            baseResponse = HeartbeatTranslators.Ping(svc.process_wsdl(sfgRequest));
                            break;
                    }
                }
                if (baseResponse == null)
                {
                    baseResponse = new BaseResponse();
                    FatalErrorResponse fatalError = new FatalErrorResponse();
                    baseResponse.TypedResponse = fatalError;
                    baseResponse.Messages.Add(new Message("SFGFatalError"));
                }

            }
            catch (Exception ex)
            {
                baseResponse = new BaseResponse();
                FatalErrorResponse fatalError = new FatalErrorResponse();
                baseResponse.TypedResponse = fatalError;
                Message error = new Message("UnknownException");
                baseResponse.DebugStringLog.Add(ex.TargetSite.Name);
                baseResponse.DebugStringLog.Add(ex.Message);
                baseResponse.DebugStringLog.Add(ex.StackTrace);
                baseResponse.Messages.Add(error);
                EventLogger.LogError(string.Format("{0}.{1}()", new object[] { className, methodCalled.ToString() }),
                    string.Format("Message: {0} \r\nStackTrace: {1}", ex.Message, ex.StackTrace));
            }
            return baseResponse;
        }
コード例 #2
0
        public void LogEnd(Methods Method, string parameter, string processingTime, string Count, string UserHost)
        {
            switch (Method)
            {
                case Methods.GetVariables:
                case Methods.GetVariablesObject:
                    LogQueryFormatted(
                        Method.ToString(),
                        null,
                        parameter,
                        null,
                        null,
                        processingTime,
                        Count, UserHost);
                    break;
                case Methods.GetSites:
                case Methods.GetSitesObject:
                case Methods.GetSiteInfo:
                case Methods.GetSiteInfoObject:
                    LogQueryFormatted(
                        Method.ToString(),
                        parameter,
                        null,
                        null,
                        null,
                        processingTime,
                        Count, UserHost);
                    break;
                default:
                    LogQueryUnformatted(
                        Method.ToString(),
                        parameter
                        );
                    break;

            }
        }
コード例 #3
0
 public void LogValuesStart(Methods Method, string Location, string Variable, string start, string end, string UserHost)
 {
     LogQueryFormatted(
         Method.ToString(),
         Location,
         Variable,
         start,
         end,
         null,
         null, UserHost);
 }
コード例 #4
0
 public void LogValuesEnd(Methods Method, string Location, string Variable, string start, string end, long ProcessingTime, int Count, string UserHost)
 {
     LogQueryFormatted(
         Method.ToString(),
         Location,
         Variable,
         start,
         end,
         ProcessingTime.ToString(),
         Count.ToString(), UserHost);
 }
コード例 #5
0
 private void trvMethods_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (!string.IsNullOrEmpty((string)trvMethods.SelectedNode.Tag))
     {
         LoadXml(trvMethods.SelectedNode.Name.ToString());
         _testMethod = (Methods)Convert.ToInt32(trvMethods.SelectedNode.Tag);
         btnExecute.Text = "Test " + _testMethod.ToString();
         btnExecute.Enabled = true;
         btnBrowse.Enabled = true;
     }
     else
     {
         txtDetails.Clear();
         btnExecute.Text = "Test ";
         btnExecute.Enabled = false;
         btnBrowse.Enabled = false;
     }
 }
コード例 #6
0
ファイル: RTest.cs プロジェクト: ashenfern/FFCF
 public static void MethodManipulation(REngine engine, Methods method)
 {
     engine.Evaluate(String.Format("Fit <- {0}(tsValue)", method.ToString())); // Fit <- Arima(tsValue)
 }
コード例 #7
0
ファイル: TestController.cs プロジェクト: yulObraz/Test
 public ActionResult Operation3(Methods unexpected) {
     return View("Message", (object)(MethodBase.GetCurrentMethod().Name + " Method = " + unexpected.ToString()));
 }
コード例 #8
0
ファイル: CoreForm.cs プロジェクト: MaximGomon/BARS-Emulyator
        private string CreatePostString(Methods methodName)
        {
            string result = String.Empty;

            switch (methodName)
            {
                case Methods.StartSession:
                    result = MethodHelper.StartSession(_setParam.UserLoginSs, _setParam.UserNameSs, _setParam.UserPasswordSs, "StartSession");
                    break;
                case Methods.CloseSession:
                    result = MethodHelper.CloseSession(_setParam.SessionId, "CloseSession");
                    break;
                case Methods.SetAgreementData:
                    result = MethodHelper.SetAgreementData(_setParam.SessionId, _setParam.MethodsName["SetAgreementData"], GetAgreementItem());
                    break;
                case Methods.SetDocumentDataWithOutBinary:
                    result = MethodHelper.SetDocumentDataWithOutBinary(_setParam.SessionId, _setParam.MethodsName["SetDocumentDataWithOutBinary"], GetDocumentItem());
                    break;
                case Methods.SetDocumentDataWithBinary:
                    string base64String = Util.ConvertImageToBase64Strimg(paramsGridView.Rows[11].Cells[1].Value.ToString());
                    result = MethodHelper.SetDocumentDataWithBinary(_setParam.SessionId, _setParam.MethodsName["SetDocumentDataWithBinary"], GetDocumentItem(),
                            base64String);
                    break;
                case Methods.ActualizeIdDocs:
                    result = MethodHelper.ActualizeIdDocs(_setParam.SessionId, _setParam.MethodsName["ActualizeIdDocs"], GetActualizeDocItem());
                    break;
                case Methods.SetClientData:
                    result = MethodHelper.SetClientData(_setParam.SessionId, _setParam.MethodsName["SetClientData"], GetClientItem());
                    break;
                case Methods.GetDocumentData:
                    result = MethodHelper.GetDocumentData(_setParam.SessionId, _setParam.MethodsName["GetDocumentData"], GetDocumentBinaryItem());
                    break;
                case Methods.SetAccountDataU:
                    result = MethodHelper.SetAccountData(_setParam.SessionId, _setParam.MethodsName["SetAccountDataU"], GetAccountItem());
                    break;
                case Methods.SetClientDataU:
                    result = MethodHelper.SetCorpClientData(_setParam.SessionId, _setParam.MethodsName["SetClientDataU"], GetCorpClientItem());
                    break;
                case Methods.SetAgreementDataU:
                    result = MethodHelper.SetCorpAgreementData(_setParam.SessionId, _setParam.MethodsName["SetAgreementDataU"], GetCorpAgreementItem());
                    break;
                case Methods.SetDictionaryData:
                    result = MethodHelper.SetDictionaryData(_setParam.SessionId, _setParam.MethodsName["SetDictionaryData"], GetBranchItem());
                    break;
                case Methods.GetClientDataSed:
                    result = MethodHelper.GetClientDataSed(_setParam.SessionId, _setParam.MethodsName["GetClientDataSed"], GetClientDataSedItem());
                    break;
                case Methods.GetDocumentMetaDataSed:
                    result = MethodHelper.GetDocumentMetaDataSed(_setParam.SessionId, _setParam.MethodsName["GetDocumentMetaDataSed"], GetDocumentMetaDataSedItem());
                    break;
                case Methods.GetDictionaryDataSed:
                    result = MethodHelper.GetDictionaryDataSed(_setParam.SessionId, _setParam.MethodsName["GetDictionaryDataSed"], GetDictionaryDataSedItem());
                    break;
                case Methods.SetDocumentAttributesSed:
                    result = MethodHelper.SetDocumentAttributesSed(_setParam.SessionId, _setParam.MethodsName["SetDocumentAttributesSed"], SetDocumentAttributesSedItem());
                    break;
            }

            _userHistory.CurrentItem.MethodName = methodName.ToString();
            //_userHistory.CurrentItem.Key = 5;

            return result;
        }