Beispiel #1
0
        public WebServiceRequest(string method)
        {
            Timeout           = 900000;
            Method            = method;
            _rnConnectService = RightNowConnectService.GetService();
            string webServiceLoginValue = _rnConnectService.GetConfigValue("CUSTOM_CFG_EBS_WS_LOGIN");

            if (webServiceLoginValue != null)
            {
                var s          = new JavaScriptSerializer();
                var loginValue = s.Deserialize <WebServiceLoginCredential>(webServiceLoginValue);
                _userName = loginValue.UserName;
                _password = loginValue.Password;
            }
        }
        /// <summary>
        /// Get required details to build WebRequest
        /// </summary>
        public void MultiVinWarrantyCheck(IIncident incidentRecord)
        {
            try
            {
                _rnConnectService = RightNowConnectService.GetService();
                _incidentRecord   = incidentRecord;
                string multiWarrantyConfigValue = _rnConnectService.GetConfigValue("CUSTOM_CFG_NEW_BOM_QUERY");
                if (multiWarrantyConfigValue != null)
                {
                    var s = new JavaScriptSerializer();

                    var configVerb = s.Deserialize <ConfigVerbs.RootObject>(multiWarrantyConfigValue);
                    _curlURL         = configVerb.URL;
                    _headerURL       = configVerb.xmlns;
                    _xmlnsURL        = configVerb.RESTHeader.xmlns;
                    _respApplication = configVerb.RESTHeader.RespApplication;
                    _responsibility  = configVerb.RESTHeader.Responsibility;
                    _securityGroup   = configVerb.RESTHeader.SecurityGroup;
                    _nLSLanguage     = configVerb.RESTHeader.NLSLanguage;
                    _orgID           = configVerb.RESTHeader.Org_Id;
                }

                _rnConnectService._incidentVINObjects.Clear();//Clear the _incidentVINObjects variable that holds all incident_vin record to be updated with response

                _causalPart = RightNowConnectService.GetService().getFieldFromIncidentRecord("CO", "causal_part_nmbr", incidentRecord);

                string[] internalIncInfo = _rnConnectService.GetInternalIncident(incidentRecord.ID);
                if (internalIncInfo != null)
                {
                    _allInternalincident = internalIncInfo.ToList();
                }
                if (_allInternalincident.Count > 0)
                {
                    var tasks = new Task[_allInternalincident.Count];
                    int ii    = 0;
                    foreach (string internalIncident in _allInternalincident)
                    {
                        tasks[ii++] = Task.Factory.StartNew(() => RequestPerSR(internalIncident));
                    }
                    Task.WaitAll(tasks);
                    _rnConnectService.updateIncidentVinRecords();//Once all task over, call batch job to update Incident_VIN record
                }
            }
            catch (Exception ex)
            {
                WorkspaceAddIn.InfoLog("Exeption in GetDetails: " + ex.Message);
            }
        }
        public SupplierWarrantyCheckModel()
        {
            _rnConnectService = RightNowConnectService.GetService();
            string supplierWarrantyConfigValue = _rnConnectService.GetConfigValue("CUSTOM_CFG_SUPPLIER_WARRANTY");

            if (supplierWarrantyConfigValue != null)
            {
                var s          = new JavaScriptSerializer();
                var configVerb = s.Deserialize <WebServiceConfigVerbs.RootObject>(supplierWarrantyConfigValue);
                _curlURL         = configVerb.URL;
                _xmlnsURL        = configVerb.xmlns;
                _headerURL       = configVerb.RESTHeader.xmlns;
                _respApplication = configVerb.RESTHeader.RespApplication;
                _responsibility  = configVerb.RESTHeader.Responsibility;
                _securityGroup   = configVerb.RESTHeader.SecurityGroup;
                _nlsLanguage     = configVerb.RESTHeader.NLSLanguage;
                _orgID           = configVerb.RESTHeader.Org_Id;
            }
        }
Beispiel #4
0
        public PartsOrderModel()
        {
            _rnConnectService = RightNowConnectService.GetService();
            string partsConfigValue = _rnConnectService.GetConfigValue("CUSTOM_CFG_PARTS_ORDER");

            if (partsConfigValue != null)
            {
                var s = new JavaScriptSerializer();

                var configVerb = s.Deserialize <ConfigVerbs.RootObject>(partsConfigValue);
                _curlURL         = configVerb.URL;
                _headerURL       = configVerb.xmlns;
                _xmlnsURL        = configVerb.RESTHeader.xmlns;
                _respApplication = configVerb.RESTHeader.RespApplication;
                _responsibility  = configVerb.RESTHeader.Responsibility;
                _securityGroup   = configVerb.RESTHeader.SecurityGroup;
                _nLSLanguage     = configVerb.RESTHeader.NLSLanguage;
                _orgID           = configVerb.RESTHeader.Org_Id;
            }
        }