Ejemplo n.º 1
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string method = "GET";
                string url    = @"http://biz.wemakeprice.com/dealer/deal_list/do_xsl_download/{GoodsCode}/1";

                DateTime dtNow = DateTime.Now;

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                foreach (var pData in GoodsInfoList_)
                {
                    if (CancelDownInfo_.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        string sendurl    = url.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                        string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                          , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks));

                        HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, sendurl, "", Cookie_, null, null, 180000);

                        if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                        {
                            FileStream fs = File.OpenWrite(downString);

                            string d = pResponse.CharacterSet;
                            Stream responsestream = pResponse.GetResponseStream();
                            byte[] buffer         = new byte[2048];

                            long totalBytesRead = 0;
                            int  bytesRead;

                            while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                            {
                                totalBytesRead += bytesRead;
                                fs.Write(buffer, 0, bytesRead);
                            }
                            fs.Close();
                            fs.Dispose();
                        }

                        CancelDownInfo_.Add(pData.Value.Goods_Code_, downString);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Web_DownLoad_CancelList - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();

                DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string method = "GET";
                string url    = @"http://partner.weekon.co.kr/pay_info_all/excel";
                string param  = "searchType=all_search&searchText=&mt_sdate=&mt_edate=";

                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls", makefolder, "C", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, param, Cookie_);

                FileStream fs = File.OpenWrite(downString);

                string d = pResponse.CharacterSet;
                Stream responsestream = pResponse.GetResponseStream();
                byte[] buffer         = new byte[2048];

                long totalBytesRead = 0;
                int  bytesRead;

                while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                {
                    totalBytesRead += bytesRead;
                    fs.Write(buffer, 0, bytesRead);
                }
                fs.Close();
                fs.Dispose();

                CancelDownInfo_.Add("C", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string   method     = "GET";
                string   url        = @"https://wing.coupang.com/refund/approval/exceldown?coupangSrl={GoodsCode}&status=NONE&productTitle=%5B%EB%8C%80%EC%B2%9C%5D+%EC%A7%9A%ED%8A%B8%EB%9E%99+1%EC%9D%B8+%EC%9D%B4%EC%9A%A9%EA%B6%8C&excelDownload=true";
                DateTime dtNow      = DateTime.Now;
                string   makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                foreach (var pData in GoodsInfoList_)
                {
                    if (CancelDownInfo_.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        string sendurl    = url.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                        string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                          , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks));

                        HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, sendurl, "", Cookie_, null, null, 180000);


                        FileStream fs = File.OpenWrite(downString);

                        string d = pResponse.CharacterSet;
                        Stream responsestream = pResponse.GetResponseStream();
                        byte[] buffer         = new byte[2048];

                        long totalBytesRead = 0;
                        int  bytesRead;

                        while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                        {
                            totalBytesRead += bytesRead;
                            fs.Write(buffer, 0, bytesRead);
                        }
                        fs.Close();
                        fs.Dispose();


                        CancelDownInfo_.Add(pData.Value.Goods_Code_, downString);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error Web_DownLoad_CancelList {0}", ex.Message));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow      = DateTime.Now;
                DateTime beforeData = dtNow.AddDays(-7);
                string   eDate      = string.Format("{0:D4}{1:D2}{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                string   sDate      = string.Format("{0:D4}{1:D2}{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                {
                    string url = "";
                    if (LQCrawlerInfo_.AuthoritySeq_ == 17)
                    {
                        url = @"https://soffice.11st.co.kr/escrow/AuthSellerClaimManager.tmall?method=getClaimExcelList";
                    }
                    else
                    {
                        url = @"https://partner.11st.co.kr/escrow/AuthSellerClaimManager.tmall?method=getClaimExcelList";
                    }
                    string method = "POST";
                    string param  = @"clmOccrTyp=01&currentPageNo=1&lastSearchKind=02&smartSearchClmStat=&searchVer=02&townSellerYn=&key=searchALL&keyValue=&clmStat=106&shDateType=reqDt&shDateFrom={sDate}&shDateTo={eDate}&searchDt=8";



                    string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                    makefolder += "\\";
                    makefolder += CINIManager.Instance.channelseq_;
                    makefolder += "\\";
                    makefolder += dtNow.ToShortDateString();
                    HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);
                    string sendparam = param.Replace("{sDate}", sDate);
                    sendparam = sendparam.Replace("{eDate}", eDate);
                    string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                      , makefolder, "C", Convert.ToString(dtNow.Ticks));

                    HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, null, null, 180000);

                    if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                    {
                        FileStream fs = File.OpenWrite(downString);

                        string d = pResponse.CharacterSet;
                        Stream responsestream = pResponse.GetResponseStream();
                        byte[] buffer         = new byte[2048];

                        long totalBytesRead = 0;
                        int  bytesRead;

                        while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                        {
                            totalBytesRead += bytesRead;
                            fs.Write(buffer, 0, bytesRead);
                        }
                        fs.Close();
                        fs.Dispose();
                    }
                    else
                    {
                        TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                        string     htmlBuffer = textReader.ReadToEnd();
                        HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                        textReader.Close();
                        textReader.Dispose();
                    }

                    CancelDownInfo_.Add("C", downString);
                }

                {
                    string url = "";
                    if (LQCrawlerInfo_.AuthoritySeq_ == 17)
                    {
                        url = @"https://soffice.11st.co.kr/escrow/OrderCancelManageList.tmall?method=getSellListToExcel&ver=2nd";
                    }
                    else
                    {
                        url = @"https://partner.11st.co.kr/escrow/OrderCancelManageList.tmall?method=getSellListToExcel&ver=2nd";
                    }
                    string method = "POST";
                    string param  = @"listType=cancel&pagePerSize=500&currentPageNo=1&ordPrdCnSeq=&ordNoList=&ordPrdSeqList=&ordPrdCnSeqList=&searchFlag=&shBuyerType=&shBuyerText=&key=02&shDateType=07&shDateFrom={sDate}&shDateTo={eDate}&searchDt=8&dataGrid=0";

                    string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                    makefolder += "\\";
                    makefolder += CINIManager.Instance.channelseq_;
                    makefolder += "\\";
                    makefolder += dtNow.ToShortDateString();
                    HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);
                    string sendparam = param.Replace("{sDate}", sDate);
                    sendparam = sendparam.Replace("{eDate}", eDate);
                    string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                      , makefolder, "R", Convert.ToString(dtNow.Ticks));

                    HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, null, null, 180000);

                    if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                    {
                        FileStream fs = File.OpenWrite(downString);

                        string d = pResponse.CharacterSet;
                        Stream responsestream = pResponse.GetResponseStream();
                        byte[] buffer         = new byte[2048];

                        long totalBytesRead = 0;
                        int  bytesRead;

                        while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                        {
                            totalBytesRead += bytesRead;
                            fs.Write(buffer, 0, bytesRead);
                        }
                        fs.Close();
                        fs.Dispose();
                    }
                    else
                    {
                        TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                        string     htmlBuffer = textReader.ReadToEnd();
                        HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                        textReader.Close();
                        textReader.Dispose();
                    }

                    CancelDownInfo_.Add("R", downString);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error public override bool Web_DownLoad_CancelList() - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 5
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                bool  bContinue = true;
                Int32 PageCount = 1;

                string url      = @"https://wing.coupang.com/dailyDeal/refundConfirms.pang";
                string param    = @"cancelId=&orderId=&returnInvoiceNumber=&originInvoiceNumber=&returnDeliveryId=&pageNum={Page}&searchOk=true&page={Page}&download=Y&coupangSrl={GoodsCode}&isDelivery=N&coupangSrlList={GoodsCode}_N&statusType=";
                string checkend = "해당하는 항목이 없습니다";

                DateTime dtNow      = DateTime.Now;
                string   makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string downString = "";
                Dictionary <string, string> DoneList = new Dictionary <string, string>();
                foreach (var pData in GoodsInfoList_)
                {
                    if (DoneList.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        bContinue = true;
                        PageCount = 1;
                        while (bContinue)
                        {
                            string sendparam = param.Replace("{Page}", Convert.ToString(PageCount));
                            sendparam  = sendparam.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                            downString = string.Format(@"{0}\Cancel_{1}_{2}_{3}.xls"
                                                       , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks), PageCount);

                            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", url, sendparam, Cookie_, null, null, 180000);

                            TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                            string     htmlBuffer = textReader.ReadToEnd();

                            if (htmlBuffer.IndexOf(checkend) >= 0)
                            {
                                bContinue = false;
                                textReader.Close();
                                textReader.Dispose();
                                break;
                            }

                            HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                            textReader.Close();
                            textReader.Dispose();

                            string GoodsCode = string.Format("{0}_{1}", pData.Value.Goods_Code_, PageCount);
                            CancelDownInfo_.Add(GoodsCode, downString);

                            PageCount++;
                        }

                        DoneList.Add(pData.Value.Goods_Code_, pData.Value.Goods_Code_);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error Web_DownLoad_CancelList {0}", ex.Message));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 6
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();

                DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string method    = "GET";
                string url       = @"https://www.esmplus.com/Escrow/Claim/ExcelDownload";
                string reffer    = @"https://www.esmplus.com/Escrow/Claim/ReturnRequestManagement?menuCode=TDM118";
                string param     = @"from=ReturnRequest&gridID=GEC012&type=A&searchAccount=TA^140935&searchDateType=&searchSDT={sDate}&searchEDT={eDate}&searchType=RF&searchKey=ON&searchKeyword=&searchStatus=RR&searchAllYn=Y";
                string useragent = @"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36";


                string sendparam = param.Replace("{sDate}", sDate);
                sendparam = sendparam.Replace("{eDate}", eDate);
                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                  , makefolder, "C", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, reffer, useragent, 180000);

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }
                CancelDownInfo_.Add("C", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            try
            {
                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();

                DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string method    = "GET";
                string url       = @"https://www.esmplus.com/Escrow/Claim/ExcelDownload";
                string reffer    = @"https://www.esmplus.com/Escrow/Claim/ReturnRequestManagement?menuCode=TDM118";
                string param     = @"from=CancelRequest&gridID=GEC011&type=A&searchAccount=TA&searchDateType=PAD&searchSDT={sDate}&searchEDT={eDate}&searchType=CC&searchKey=ON&searchKeyword=&searchStatus=CC&searchAllYn=N&tabGbn=1";
                string useragent = @"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36";

                string sendparam = param.Replace("{sDate}", sDate);
                sendparam = sendparam.Replace("{eDate}", eDate);
                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                  , makefolder, "R", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, reffer, useragent, 180000);

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }

                CancelDownInfo_.Add("R", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 7
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();

                DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string method = "GET";
                string url    = @"http://kb.lifecarestory.kr/mim/order/order_ex_list.excel2.asp";
                string param  = "menu=cancel&page=1&skey=ordname&sword=";

                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls", makefolder, "C", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, param, Cookie_, "",
                                                                            "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
                                                                            , 180000
                                                                            , "application/x-www-form-urlencoded");

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }
                CancelDownInfo_.Add("C", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string method = "GET";
                string url1   = @"http://www.goodbuyselly.com/shop/order_list_excel?state=C&type=&start_date={sDate}&end_date={eDate}";
                string param  = @"";

                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                DateTime beforeData = dtNow.AddDays(-7);
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                string tempurl = url1.Replace("{sDate}", sDate);
                tempurl = tempurl.Replace("{eDate}", eDate);
                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                  , makefolder, "C", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, tempurl, param, Cookie_, null, null, 180000);

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }

                CancelDownInfo_.Add("C", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            try
            {
                string method = "GET";
                string url1   = @"http://www.goodbuyselly.com/shop/order_list_excel?state=I&type=&start_date={sDate}&end_date={eDate}";
                string param  = @"";

                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                DateTime beforeData = dtNow.AddDays(-7);
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                string tempurl = url1.Replace("{sDate}", sDate);
                tempurl = tempurl.Replace("{eDate}", eDate);
                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                  , makefolder, "R", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, tempurl, param, Cookie_, null, null, 180000);

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }

                CancelDownInfo_.Add("R", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 9
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string method = "GET";
                string url    = @"https://ps.ticketmonster.co.kr/daily/cancellist";
                string param  = @"main_deal_srl={GoodsCode}&branch_srl=&start_date={sDate}&end_date={eDate}&searchKey=&searchVal=&excel=Y";

                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                foreach (var pData in GoodsInfoList_)
                {
                    if (CancelDownInfo_.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        if (pData.Value.eDateFormat_ != null)
                        {
                            DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                            eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                            sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);
                        }

                        string sendparam = param.Replace("{sDate}", sDate);
                        sendparam = sendparam.Replace("{eDate}", eDate);
                        sendparam = sendparam.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                        string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                          , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks));

                        HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, null, null, 180000);

                        if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                        {
                            FileStream fs = File.OpenWrite(downString);

                            string d = pResponse.CharacterSet;
                            Stream responsestream = pResponse.GetResponseStream();
                            byte[] buffer         = new byte[2048];

                            long totalBytesRead = 0;
                            int  bytesRead;

                            while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                            {
                                totalBytesRead += bytesRead;
                                fs.Write(buffer, 0, bytesRead);
                            }
                            fs.Close();
                            fs.Dispose();
                        }
                        else
                        {
                            TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                            string     htmlBuffer = textReader.ReadToEnd();
                            HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                            textReader.Close();
                            textReader.Dispose();
                        }

                        CancelDownInfo_.Add(pData.Value.Goods_Code_, downString);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error override bool Web_DownLoad_CancelList - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 10
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow       = DateTime.Now;
                DateTime beforeData  = dtNow.AddDays(-50);
                DateTime CbeforeDate = dtNow.AddDays(-7);
                string   eDate       = string.Format("{0:D4}{1:D2}{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                string   sDate       = string.Format("{0:D4}{1:D2}{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);
                string   yDate       = string.Format("{0:D4}", dtNow.Year);
                string   ceDate      = string.Format("{0:D4}{1:D2}{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                string   csDate      = string.Format("{0:D4}{1:D2}{2:D2}", CbeforeDate.Year, CbeforeDate.Month, CbeforeDate.Day);



                string method = "POST";
                string url    = @"http://partneradmin.ezwel.com/cpadm/shop/order/orderListExcel.ez";
                string param  = "";

                if (LQCrawlerInfo_.AuthoritySeq_ != 26)
                {
                    param = @"kind=submit&currentPage=1&chk=csp&applYear={yDate}&goodsNm=&orderStatus=1003&orderDt1={sDate}&orderDt2={eDate}&modiDt1={csDate}&modiDt2={ceDate}&orderNum=&sndNm=&dlvrHopeDt1=&dlvrHopeDt2=&dlvrStatus=&clientType=&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001";
                }
                else
                {
                    param = @"kind=submit&currentPage=1&chk=csp&applYear={yDate}&goodsNm=&orderStatus=1003&orderDt1={sDate}&orderDt2={eDate}&modiDt1={csDate}&modiDt2={ceDate}&orderNum=&sndNm=&dlvrHopeDt1=&dlvrHopeDt2=&dlvrStatus=&clientType=&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001&orderStatusVal=1003&dlvrStatusVal=1001";
                }


                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string sendparam = param.Replace("{sDate}", sDate);
                sendparam = sendparam.Replace("{yDate}", yDate);
                sendparam = sendparam.Replace("{eDate}", eDate);
                sendparam = sendparam.Replace("{csDate}", csDate);
                sendparam = sendparam.Replace("{ceDate}", ceDate);
                string downString = string.Format(@"{0}\Cancel_{1}.xls"
                                                  , makefolder, Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, sendparam, Cookie_, null, null, 180000);

                if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                {
                    FileStream fs = File.OpenWrite(downString);

                    string d = pResponse.CharacterSet;
                    Stream responsestream = pResponse.GetResponseStream();
                    byte[] buffer         = new byte[2048];

                    long totalBytesRead = 0;
                    int  bytesRead;

                    while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        totalBytesRead += bytesRead;
                        fs.Write(buffer, 0, bytesRead);
                    }
                    fs.Close();
                    fs.Dispose();
                }
                else
                {
                    TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                    string     htmlBuffer = textReader.ReadToEnd();
                    HKLibrary.UTIL.HKFileHelper.SaveToFile(downString, htmlBuffer);
                    textReader.Close();
                    textReader.Dispose();
                }

                CancelDownInfo_.Add("CANCEL", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error Web_DownLoad_CancelList {0}", ex.Message));
                return(false);
            }

            return(true);
        }