示例#1
0
        private void CreateTR()
        {
            WSTranslation           ws   = HyperCatalog.WebServices.WSInterface.Translation;
            CreateInstantTRDelegate dlgt =
                new CreateInstantTRDelegate(ws.CreateInstantTR);
            string credential = ws.SignOn(SessionState.User.Pseudo, SessionState.User.ClearPassword);

            if (credential != string.Empty)
            {
                // call BeginInvoke to initiate the asynchronous operation
                //PCF Requirement -- Regional project Management (Deepak.S)
                IAsyncResult ar =
                    dlgt.BeginInvoke(credential, Guid.NewGuid(), item.Id, cultureCode, true, txtComment.Text, string.Empty, null, null);

                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TRDone", "<script>OnTRCreatedUpdateParent(" + item.Id + ");</script>");
                ws.SignOff(credential);
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TRDone", "<script>alert('Sorry, the system was not able to connect to the web service. Please contact support');window.close();</script>");
            }
        }
示例#2
0
        public void DoWork()
        {
            try
            {
                // Next line is a placeholder for your "job" - a DTS package or other long-running task
                // Replace the following line with your code.
                WSTranslation ws = HyperCatalog.WebServices.WSInterface.Translation;
                System.Net.CookieContainer cookies = new System.Net.CookieContainer();
                ws.CookieContainer = cookies;
                string      credential = ws.SignOn(SessionState.User.Pseudo, SessionState.User.ClearPassword);
                System.Guid logId      = new Guid();
                string      zipFileName;
                ws.ProcessZipRequest(credential, logId, zipFileName);
                ws.SignOff(credential);
                // Set Success property.
                _lastTaskSuccess = true;
            }

            catch (Exception e)

            {
                // Task Failed.
                _lastTaskSuccess  = false;
                _exceptionOccured = e;
            }

            finally
            {
                _running        = false;
                _lastFinishTime = DateTime.Now;
                if (!_firstRunComplete)
                {
                    _firstRunComplete = true;
                }
            }
        }