Beispiel #1
0
        protected override void AdjustHeight()
        {
            if ((_browser == null) || (_browser.Document == null))
            {
                return;
            }

            var content = (GeckoOptionElement)_browser.Document.GetElementById("optionElement");

            if (content != null)
            {
                _optionElement = (GeckoOptionElement)content;
                _optionHeight  = _optionElement.ClientHeight;
                _selectElement = (GeckoSelectElement)_optionElement.Parent;
            }

            var selectElement = (GeckoSelectElement)_browser.Document.GetElementById("main");

            if (selectElement != null)
            {
                int numberOfEntries = (Height / (_optionHeight + 1)) - 1;
                if (numberOfEntries <= 0)
                {
                    numberOfEntries = 10;
                }
                selectElement.Size = (uint)numberOfEntries;
            }
        }
Beispiel #2
0
        private Boolean BuyDecision(GeckoDocument document, Uri uri)
        {
            logger.Info("2-1.매출내역 ( 주문관리 > 구매결정완료 )");
            if (!String.IsNullOrEmpty(idkey))
            {
                try
                {
                    DateTime enddate   = DateTime.Now;
                    DateTime startdate = enddate.AddYears(-1).AddDays(1);
                    this.buffer.Append("https://www.esmplus.com/Escrow/Delivery/BuyDecisionExcel?");
                    this.buffer.Append(CreateGetParameter(new Dictionary <String, String>()
                    {
                        { "siteGbn", "0" },
                        { "searchAccount", idkey },
                        { "searchDateType", "TRD" },
                        { "searchSDT", startdate.ToString("yyyy-MM-dd") },
                        { "searchEDT", enddate.ToString("yyyy-MM-dd") },
                        { "searchKey", "ON" },
                        { "searchKeyword", "" },
                        { "searchStatus", "5010" },
                        { "searchAllYn", "N" },
                        { "searchDistrType", "AL" },
                        { "searchGlobalShopType", "" },
                        { "searchOverseaDeliveryYn", "" }
                    }));
                    logger.Debug(this.buffer.ToString());
                    PostAjaxJson(document, this.buffer.ToString(), new Dictionary <String, Object>()
                    {
                        { "eSortType", "" },
                    });
                }
                finally
                {
                    this.buffer.Clear();
                }
                return(true);
            }
            GeckoSelectElement item = document.GetElementById <GeckoSelectElement>("searchAccount");

            for (uint i = 0; i < item.Length; i++)
            {
                GeckoOptionElement option = item.Options.item(i);
                if (String.Equals(option.Label, "A_" + Parameter.Id))
                {
                    //10757^id^_1
                    DateTime enddate   = DateTime.Now;
                    DateTime startdate = enddate.AddYears(-1).AddDays(1);
                    idkey  = option.Value;
                    idcode = idkey.Split('^')[0];
                    this.logger.Info("idkey - " + idkey);
                    this.logger.Info("idcode - " + idcode);
                    try
                    {
                        this.buffer.Append("https://www.esmplus.com/Escrow/Delivery/BuyDecision?");
                        this.buffer.Append(CreateGetParameter(new Dictionary <String, String>()
                        {
                            { "siteGbn", "0" },
                            { "status", "5010" },
                            { "type", "N" },
                            { "searchTotal", "-" },
                            { "searchAccount", idkey },
                            { "searchDateType", "TRD" },
                            { "searchSDT", startdate.ToString("yyyy-MM-dd") },
                            { "searchEDT", enddate.ToString("yyyy-MM-dd") },
                            { "searchKey", "ON" },
                            { "searchKeyword", "" },
                            { "searchStatus", "5010" },
                            { "listAllView", "false" },
                            { "searchDistrType", "AL" },
                            { "searchGlobalShopType", "" },
                            { "searchOverseaDeliveryYn", "" }
                        }));
                        base.Navigate(this.buffer.ToString());
                    }
                    finally
                    {
                        this.buffer.Clear();
                    }
                    return(true);
                }
            }
            throw new ScraperException("Failed to get id key..");
        }