Exemple #1
0
        public void LogEvent(string sUnid, string sMsg, int iStatus, int iBatch)
        {
            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();

            ws.Logger(sUnid, sMsg, iStatus, iBatch);
            ws.Dispose();
        }
Exemple #2
0
        public string ChkInstall(string sUnid)
        {
            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
            // ws.Timeout = 20000;

            try
            {
                string sRes = "";
                if (sEmail.Contains(@"cookconsulting"))
                {
                    sRes = "go";
                }
                else
                {
                    sRes = ws.ChkInstall(sUnid);
                }

                return(sRes);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
        }
Exemple #3
0
        public void LogEvent()
        {
            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
            // ws.Timeout = 20000;
            IBatchNo = -1;
            try
            {
                int iBatch = int.Parse(ws.FindNextId(sUnid));
                IBatchNo = iBatch;
// 15 May 2012
// skip logging the cook stuff
                if (sEmail.Contains(@"cookconsulting"))
                {
                }
                else
                {
                    ws.Logger(sUnid, sXmlDoc, 99999, iBatch);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
        }
Exemple #4
0
        private static void wcDownLoadDone(object sender, AsyncCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Console.WriteLine("  Error Downloading  - Message - {0}", e.Error.Message);
                Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
                ws.Logger(sUnid, sCurrentFile + " - " + e.Error.Message, -1, iBatchCl);
                //       throw   new Exception(e.Error.Message ) ;
                //   Console.ReadLine();
            }

            Console.WriteLine("File Download Complete");
        }
Exemple #5
0
        public void LogEvent(string sUnid, string sMsg, int iStatus, int iBatch)
        {
            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();

            if (iStatus == 10000)
            {
                ws.Logger(sUnid, sCustomerName + "&" + sUserName, iStatus, iBatch);
            }
            else
            {
                ws.Logger(sUnid, sMsg, iStatus, iBatch);
            }

            ws.Dispose();
        }
Exemple #6
0
 public void LogEvent()
 {
     Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
     // ws.Timeout = 20000;
     IBatchNo = -1;
     try
     {
         int iBatch = int.Parse(ws.FindNextId(sUnid));
         IBatchNo = iBatch;
         ws.Logger(sUnid, sXmlDoc, 99999, iBatch);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         ws.Dispose();
     }
 }
Exemple #7
0
        public string PackXml(string sXml, string sUnid)
        {
            string sOut = "";

            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
            // ws.Timeout = 20000;

            try
            {
                sOut = ws.RndCustXml(sXml, sUnid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
            return(sOut);
        }
Exemple #8
0
        public string ChkInstall(string sUnid)
        {
            Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
            // ws.Timeout = 20000;

            try
            {
                string sRes = "";
                sRes = ws.ChkInstall(sUnid);

                return(sRes);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
        }
Exemple #9
0
        public void LogEvent(string sUnid, string sMsg, int iStatus, int iBatch)
        {
            if (sEmail.Contains(@"cookconsulting.net"))
            {
            }

            else
            {
                Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();

                if (iStatus == 10000)
                {
                    ws.Logger(sUnid, sCustomerName + "&" + sUserName, iStatus, iBatch);
                }
                else
                {
                    ws.Logger(sUnid, sMsg, iStatus, iBatch);
                }

                ws.Dispose();
            }
        }
        private static void DownLoadASheet(string sAddr, string sFileName)
        {
            try
            {
                if (File.Exists(sFileName))
                {
                    FileInfo fi = new FileInfo(sFileName);

                    fi.Delete();
                }
            }
            catch { }


            RequestCachePolicy policy = new RequestCachePolicy(RequestCacheLevel.Reload);

            string address = sAddr;

            //"http://localhost/Sheets/" + sFileName + ".xls";

            System.Threading.AutoResetEvent waiter = new System.Threading.AutoResetEvent(false);
            Uri uri = new Uri(address);

            try
            {
                WebClient wc = new WebClient();
                wc.Proxy       = null;
                wc.Credentials = CredentialCache.DefaultCredentials;
                wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0)");
                wc.CachePolicy = policy;


                wc.DownloadFileCompleted   += new AsyncCompletedEventHandler(wcDownLoadDone);
                wc.DownloadDataCompleted   += new DownloadDataCompletedEventHandler(wcDownLoadDone1);
                wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wcCallbackDown);

                wc.DownloadFileAsync(uri, sFileName);
                Console.Write("DownLoading with {0} ", sFileName);
                while (wc.IsBusy)
                {
                    try
                    {
                        waiter.WaitOne(100);
                    }
                    catch { }
                }

                try
                {
                    Debug.Print("Done");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message + " Error in Download");
                }


                Console.WriteLine("Done with {0} ", sFileName);
                // Got the File
                // Download the Files
            }

            catch (WebException ex)
            {
                if (ex.Response is WebResponse)
                {
                    HttpWebResponse o = (HttpWebResponse)ex.Response;
                    Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
                    ws.Logger(sUnid, o.StatusDescription, -1, iBatchCl);
                    Console.WriteLine(o.StatusDescription + "  Download Error -" + ex.Message);
                    if (o.StatusCode == HttpStatusCode.OK)
                    {
                    }
                    else
                    {
                        Console.WriteLine(ex.Status + "  Download Error -" + ex.Message);
                        Console.ReadLine();
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                Installer.wslogger.WS_Logger ws = new Installer.wslogger.WS_Logger();
                ws.Logger(sUnid, ex.Message, -1, iBatchCl);

                Console.WriteLine(ex.Message);
                throw ex;
            }
        }