protected sealed override void SetCustomProperties(Dictionary <string, object> customProperties)
        {
            if (_apiLogVerbosity == ApiLogVerbosity.LogEverything)
            {
                customProperties["request"]  = Request.ToString();
                customProperties["response"] = Response.ToString();
            }
            else if (_apiLogVerbosity == ApiLogVerbosity.LogMinimalRequest)
            {
                customProperties["requestQueryString"] = Request.QueryString;
                customProperties["requestBody"]        = Request.Body;
                customProperties["responseStatusCode"] = Response.StatusCode;
                customProperties["responseBody"]       = Response.Body;
            }

            customProperties["remoteIpAddress"]             = Request.RemoteIpAddress;
            customProperties["requestExecutionTimeMS"]      = RequestExecutionTime;
            customProperties["requestExecutionTimeMinutes"] = RequestExecutionTimeMinutes;

            if (!ActivityId.IsNullOrEmpty())
            {
                customProperties["activityId"] = ActivityId;
            }
            if (!ParentActivityId.IsNullOrEmpty())
            {
                customProperties["parentActivityId"] = ParentActivityId;
            }
            if (!UserId.IsNullOrEmpty())
            {
                customProperties["userId"] = UserId;
            }
            SetDerivedClassCustomProperties(customProperties);
        }
Example #2
0
        public IEnumerable <string> ReadAPI()
        {
            var login = this.GetUpperRawler <TwitterLogin>();

            if (login == null)
            {
                ReportManage.ErrReport(this, "TwitterLoginをTweetUserTimelineの上流に配置してください");
                yield break;
            }

            Dictionary <string, object> dic = new Dictionary <string, object>()
            {
                { "cursor", cursor },
                { "count", 5000 }
            };

            if (ScreenName.IsNullOrEmpty() == false)
            {
                dic.Add("screen_name", ScreenName.Convert(this));
            }
            else if (UserId.IsNullOrEmpty() == false)
            {
                dic.Add("user_id", UserId.Convert(this));
            }
            else
            {
                if (ParentUserIdType == RawlerTwitter.ParentUserIdType.ScreenName)
                {
                    dic.Add("screen_name", GetText());
                }
                else if (ParentUserIdType == RawlerTwitter.ParentUserIdType.UserId)
                {
                    dic.Add("user_id", GetText());
                }
            }
            var result = login.Token.Friends.Ids(dic);

            foreach (var item in result.Result)
            {
                yield return(item.ToString());
            }
            if (result.NextCursor > 0)
            {
                cursor = result.NextCursor;
            }
            else
            {
                cursor = -1;
            }
        }
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.IsImageTiled = true;
            indexListVM.Heading.Main = "Menu";


            IMenuManager mm = makeMenuManager(parameters);

            indexListVM.MenuManager    = mm;
            indexListVM.Heading.Column = "Menu Items";
            int    webClicksCount = PageViewBiz.IsNull() ? 0 : PageViewBiz.GetClickCount();
            string recordStr      = (webClicksCount == 1 ? "view" : "views");

            indexListVM.MenuManager.WebClicksCount = string.Format("{0:n0} {1}",
                                                                   webClicksCount,
                                                                   recordStr);

            if (!UserId.IsNullOrEmpty())
            {
                Person userPerson = UserBiz.GetPersonFor(UserId);
                userPerson.IsNullThrowException("userPerson");
                indexListVM.MenuManager.UserPersonId = userPerson.Id;
            }

            if (!parameters.ReturnUrl.IsNullOrWhiteSpace())
            {
                indexListVM.MenuManager.ReturnUrl = parameters.ReturnUrl;
            }


            //indexListVM.MainLocationSelectorClass = new MainLocationSelectorClass(addressBiz.FindAll().ToList());
            indexListVM.MainLocationSelectorClass = new MainLocationSelectorClass();
            indexListVM.MainLocationSelectorClass.AddCountries(addressBiz.FindAll().ToList());
        }
Example #4
0
        public ProductChild LoadProductChildForLandingPage(string productChildId, string searchFor, string returnUrl)
        {
            //ProductChild productChild = _icrudBiz.Factory() as ProductChild;
            //productChildId.IsNullThrowExceptionArgument("Id not received. Bad Request");

            ProductChild productChild = Find(productChildId);

            productChild.IsNullThrowException("Product Child not found.");

            string productIdDud      = "";
            string isandForSearchDud = "";
            string selectIdDud       = "";
            string menuPathMainIdDud = "";
            string logoAddress       = "";
            string buttonDud         = "";
            //string sortByDud = "";
            LikeUnlikeParameters likeUnlikeParameters = null;

            bool isMenuDud   = false;
            bool isUserAdmin = false;
            BuySellDocumentTypeENUM buySellDocumentTypeEnum = BuySellDocumentTypeENUM.Unknown; //DUD
            BuySellDocStateENUM     BuySellDocStateEnum     = BuySellDocStateENUM.Unknown;     //dud

            if (!UserId.IsNullOrWhiteSpace())
            {
                isUserAdmin = UserBiz.IsAdmin(UserId);
            }

            ControllerIndexParams parms = new ControllerIndexParams(
                productChildId,
                menuPathMainIdDud,
                searchFor,
                isandForSearchDud,
                selectIdDud,
                MenuENUM.IndexMenuProductChildLandingPage,
                SortOrderENUM.Item1_Asc,
                logoAddress,
                productChild,
                productChild,
                UserId,
                UserName,
                isUserAdmin,
                isMenuDud,
                BreadCrumbManager,
                ActionNameENUM.Unknown,
                likeUnlikeParameters,
                productIdDud,
                returnUrl,
                buySellDocumentTypeEnum,
                BuySellDocStateEnum,
                buttonDud);

            InitializeMenuManagerForEntity(parms);

            //IHasUploads hasUploadsEntity = parms.Entity as IHasUploads;
            //MenuManager menuManager = new MenuManager(parms.Entity.MenuManager.MenuPathMain, null, null, parms.Menu.MenuEnum, BreadCrumbManager, parms.LikeUnlikeCounter, UserId, parms.ReturnUrl, UserName);
            IMenuManager menuManager = parms.Entity.MenuManager;

            if (menuManager.IndexMenuVariables.IsNull())
            {
                menuManager.IndexMenuVariables = new IndexMenuVariables(UserId);
            }



            Person person = UserBiz.GetPersonFor(UserId);

            if (!person.IsNull())
            {
                string userPersonId         = person.Id;
                string productChildPersonId = productChild.Owner.PersonId;
                menuManager.IndexMenuVariables.updateRequiredProperties(userPersonId, productChildPersonId);
            }



            List <string> pictureAddresses = GetCurrItemsPictureList(productChild);

            //if none are available get them from the product
            if (pictureAddresses.IsNullOrEmpty())
            {
                productChild.Product.IsNullThrowException();
                pictureAddresses = GetCurrItemsPictureList(productChild.Product);
            }

            if (pictureAddresses.IsNullOrEmpty())
            {
                pictureAddresses = GetDefaultPicture();
            }



            menuManager.PictureAddresses = pictureAddresses;

            ////also add the ProductChildperson and UserPerson
            //Person userPerson = UserBiz.GetPersonFor(UserId);

            //if (!productChild.Owner.IsNull())
            //    menuManager.IndexMenuVariables.ProductChildPersonId = productChild.Owner.PersonId;

            productChild.AllFeatures = Get_All_ProductChild_Features_For(productChild);



            if (UserId.IsNullOrEmpty())
            {
                //Log an annonymous user as a visitor
            }
            else
            {
                //Log user as visitor to this product child
                LogPersonsVisit(UserId, productChild);
            }


            return(productChild);
        }