コード例 #1
0
ファイル: Index.cs プロジェクト: dovanduy/Library
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);

            CashTrx cashTrx = icommonWithId as CashTrx;

            cashTrx.IsNullThrowException("Unable to unbox cashTrx");

            //get current user's PersonId first...
            Person person = UserBiz.GetPersonFor(UserId);

            if (person.IsNull())
            {
                indexItem.AllowDelete = false;
                indexItem.AllowEdit   = false;
            }
            else
            if (person.Id == cashTrx.PersonToId)
            {
                indexItem.AllowDelete = true;
                indexItem.AllowEdit   = false;
            }
            else
            {
                indexItem.AllowDelete = false;
                indexItem.AllowEdit   = false;
            }
        }
コード例 #2
0
        //private static string fixSorting(IndexItemVM indexItem, IndexListVM indexListVM)
        //{
        //    string startSort = getStartSort(indexItem, indexListVM);


        //    string sortString = startSort + indexItem.Input1SortString;
        //    return sortString;
        //}

        private static string getStartSort(IndexItemVM indexItem, IndexListVM indexList)
        {
            string startSort = "";



            switch (indexList.SortOrderEnum)
            {
            case SortOrderENUM.Item1_Asc:
            case SortOrderENUM.Item2_Asc:
            case SortOrderENUM.Item3_Asc:
                startSort = ascendingSort(indexItem, startSort);
                break;

            case SortOrderENUM.Item1_Dsc:
            case SortOrderENUM.Item2_Dsc:
            case SortOrderENUM.Item3_Dsc:
                startSort = decendingSort(indexItem, startSort);
                break;

            default:
                startSort = ascendingSort(indexItem, startSort);
                break;
            }


            return(startSort);
        }
コード例 #3
0
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
            PhoneEmailAddressAbstract phoneEmailAddressAbstract = icommonWithId as PhoneEmailAddressAbstract;

            phoneEmailAddressAbstract.IsNullThrowException("Unable to unbox Phone Email Address Abstract");

            //this causes the MailerIcon to display
            //indexItem.VerificationStatus = phoneEmailAddressAbstract.VerificationStatusEnum;
            indexItem.VerificationIconResult = GetVerificationIconResult(indexItem.VerificationStatus);
        }
コード例 #4
0
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
            ProductChild productChild = ProductChild.Unbox(icommonWithId);

            indexItem.IsHidden = productChild.Hide;
            indexItem.IsTokenPaymentAccepted       = productChild.IsNonRefundablePaymentAccepted;
            indexItem.MenuManager                  = new MenuManager(null, null, productChild, MenuENUM.IndexMenuPath1, BreadCrumbManager, null, UserId, indexListVM.MenuManager.ReturnUrl, UserName);
            indexItem.MenuManager.PictureAddresses = GetCurrItemsPictureList(productChild);
            indexItem.Price = productChild.Sell.SellPrice;
        }
コード例 #5
0
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);

            Product product = icommonWithId as Product;

            product.IsNullThrowException("Unable to unbox product.");

            product.MenuManager   = new MenuManager(null, product, null, MenuENUM.IndexDefault, BreadCrumbManager, null, UserId, indexListVM.MenuManager.ReturnUrl, UserName);
            indexItem.MenuManager = new MenuManager(null, product, null, MenuENUM.IndexMenuPath1, BreadCrumbManager, null, UserId, indexListVM.MenuManager.ReturnUrl, UserName);

            indexItem.MenuManager.PictureAddresses = GetCurrItemsPictureList(product);
        }
コード例 #6
0
 /// <summary>
 /// This marks the user as an owner of the shop. Basicly if the OwnerId in product has a value, then it is a shop.
 /// if ownerId of the shop matches the ownerId of the user, then the user is the owner of the shop
 /// </summary>
 /// <param name="indexItem"></param>
 /// <param name="product"></param>
 private void markUserAsOwnerOfShop(IndexItemVM indexItem, Product product)
 {
     if (!UserId.IsNullOrWhiteSpace())
     {
         Owner owner = OwnerBiz.GetPlayerFor(UserId);
         if (owner.IsNull())
         {
         }
         else
         {
             indexItem.IsShopAndOwnerOfShop = product.OwnerId == owner.Id;
         }
     }
 }
コード例 #7
0
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, InterfacesLibrary.SharedNS.ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
            MenuPath3 mp3 = icommonWithId as MenuPath3;

            mp3.IsNullThrowException("Unable to unbox");
            //send in a MenuPathMain that is a part of this MenuPath3
            MenuPathMain mpm = mp3.MenuPathMains.FirstOrDefault();

            indexItem.MenuManager = new MenuManager(mpm, null, null, MenuENUM.EditMenuPath3, BreadCrumbManager, null, UserId, indexListVM.MenuManager.ReturnUrl, UserName);


            indexItem.MenuManager.PictureAddresses = GetCurrItemsPictureList(mp3);
        }
コード例 #8
0
ファイル: Index.cs プロジェクト: dovanduy/Library
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithid)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithid);

            ApplicationUser user = icommonWithid as ApplicationUser;

            if (user.IsNull())
            {
                ErrorsGlobal.Add("Unable to convert to User", MethodBase.GetCurrentMethod());
                throw new Exception(ErrorsGlobal.ToString());
            }

            indexItem.Name = string.Format("{0} [{1}]", user.UserName, user.PhoneNumber);
        }
コード例 #9
0
        //public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        //{
        //    base.Event_ModifyIndexList(indexListVM, parameters);

        //    indexListVM.Heading.Column = "All Addresses for User";
        //    indexListVM.Show.EditDeleteAndCreate = true;
        //    indexListVM.Show.VerificationIcon = true;
        //    indexListVM.Show.MakeDefaultIcon = true;

        //}

        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, InterfacesLibrary.SharedNS.ICommonWithId icommonWithId)
        {
            UserId.IsNullOrWhiteSpaceThrowException("You are not logged in.");
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);

            //get the current Person from user
            Person person = UserBiz.GetPersonFor(UserId);

            person.IsNullThrowException("Person");

            if (indexItem.Id == person.DefaultBillAddressId)
            {
                indexItem.IsDefault = true;
            }
        }
コード例 #10
0
ファイル: Index.cs プロジェクト: dovanduy/Library
        //public BuySellDocStatementENUM IsSaleOrPurchase(BuySellDoc buySellDoc)
        //{
        //    if (buySellDoc.CustomerId.IsNullOrWhiteSpace() && buySellDoc.OwnerId.IsNullOrWhiteSpace())
        //    {
        //        ErrorsGlobal.Add("Both Customer and Owner are empty.", "Event_CreateViewAndSetupSelectList");
        //        throw new Exception();

        //    }

        //    if (buySellDoc.CustomerId.IsNullOrWhiteSpace())
        //    {
        //        //this is a purchase order
        //        return BuySellDocStatementENUM.SaleOrderStatement;

        //    }
        //    if (buySellDoc.OwnerId.IsNullOrWhiteSpace())
        //    {
        //        //this is a sale.
        //        return BuySellDocStatementENUM.PurchaseOrderStatement;


        //    }

        //    ApplicationUser ownerUser = OwnerBiz.GetUserForEntityrWhoIsNotAdminFor(buySellDoc.OwnerId);
        //    ownerUser.IsNullThrowException();

        //    if (UserId == ownerUser.Id)
        //    {
        //        //this is a purchase
        //        return BuySellDocStatementENUM.SaleOrderStatement;
        //    }



        //    //get the CustomerUser
        //    ApplicationUser customerUser = CustomerBiz.GetUserForEntityrWhoIsNotAdminFor(buySellDoc.CustomerId);
        //    customerUser.IsNullThrowException();
        //    if (UserId == customerUser.Id)
        //    {
        //        //this is a sale
        //        return BuySellDocStatementENUM.PurchaseOrderStatement;
        //    }

        //    throw new Exception("Unknown type");
        //}


        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);

            BuySellDoc buySellDoc = icommonWithId as BuySellDoc;

            buySellDoc.IsNullThrowException("Unable to unbox buySellDoc");

            //we need to know if this is a sale or a purchase order

            ////get current user's PersonId first...
            //BuySellDocumentTypeENUM buySellDocumentTypeEnum = IsSaleOrPurchaseOrDelivery(buySellDoc);
            //buySellDoc.BuySellDocumentTypeEnum = buySellDocumentTypeEnum;
            indexItem.Name = buySellDoc.FullName();
            //Person person = UserBiz.GetPersonFor(UserId);
        }
コード例 #11
0
        //public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        //{
        //    base.Event_ModifyIndexList(indexListVM, parameters);

        //    //indexListVM.Heading_Column = "All Files";
        //    indexListVM.Heading.Column = "All Files";

        //    indexListVM.Show.EditDeleteAndCreate = true;
        //    indexListVM.Show.Create = true;

        //    indexListVM.NameInput2 = "File Number";
        //    indexListVM.Show.ImageInList = false;


        //}

        //public override IList<ICommonWithId> GetListForIndex()
        //{

        //    try
        //    {


        //        //errIfNotLoggedIn();


        //        var lstAsFileDoc = base.GetListForIndex().ToList() as IList<FileDoc>;

        //        if (lstAsFileDoc.IsNullOrEmpty())
        //            return null;

        //        var lst = lstAsFileDoc.Where(x => x.UserId == UserId).ToList();

        //        if (lst.IsNullOrEmpty())
        //            return null;

        //        var lstIcommonwithId = lst as IList<ICommonWithId>;
        //        return lstIcommonwithId;
        //    }
        //    catch (Exception e)
        //    {
        //        ErrorsGlobal.Add("Unable to continue", MethodBase.GetCurrentMethod(), e);
        //        throw new Exception(ErrorsGlobal.ToString());
        //    }
        //}



        //public override async Task<IList<ICommonWithId>> GetListForIndexAsync(ControllerIndexParams parms)
        //{
        //    // errIfNotLoggedIn();

        //    var lst = (await base.GetListForIndexAsync(parms)).Cast<FileDoc>().ToList();

        //    if (lst.IsNullOrEmpty())
        //        return null;


        //    var lstIcommonwithId = (lst.Where(x => x.UserId == UserId)).Cast<ICommonWithId>().ToList();

        //    return lstIcommonwithId;
        //}

        //private void errIfNotLoggedIn()
        //{
        //    if (UserId.IsNullOrWhiteSpace())
        //    {
        //        ErrorsGlobal.Add("You must log in to continue", "");
        //    }
        //}

        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithid)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithid);
            FileDoc filedoc = icommonWithid as FileDoc;

            if (filedoc.IsNull())
            {
                ErrorsGlobal.Add("Unable to convert to File Doc", MethodBase.GetCurrentMethod());
                throw new Exception(ErrorsGlobal.ToString());
            }
            indexItem.Name = filedoc.FullNameWithFileNumber();

            indexItem.PrintLineNumber = filedoc.FileNumber.ToString();
            if (!filedoc.OldFileNumber.IsNullOrWhiteSpace())
            {
                indexItem.PrintLineNumber = filedoc.OldFileNumber.ToString();
            }
        }
コード例 #12
0
ファイル: ModifyIndex.cs プロジェクト: dovanduy/Library
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithid)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithid);

            UploadedFile uploadedFile = icommonWithid as UploadedFile;

            uploadedFile.IsNullThrowException("Unable to convert to Upload");


            indexItem.Name = string.Format("{0}", uploadedFile.MetaData.Created.Date_NotNull_Min.ToLongDateString());

            //this is the tool tip.
            if (indexItem.Description.IsNullOrWhiteSpace())
            {
                indexItem.Description = string.Format("This is a file uploaded by you on {0}.", uploadedFile.MetaData.Created.Date_NotNull_Min.ToLongDateString());
            }

            indexItem.ImageAddressStr = uploadedFile.GetRelativePathWithFileName();
        }
コード例 #13
0
 private static string decendingSort(IndexItemVM indexItem, string startSort)
 {
     if (indexItem.IsShop)
     {
         startSort = "Z";
     }
     else
     {
         if (indexItem.NoOfItems > 0 || indexItem.NoOfShops > 0)
         {
             startSort = "Y";
         }
         else
         {
             startSort = "X";
         }
     }
     return(startSort);
 }
コード例 #14
0
ファイル: BuySellItemBiz.cs プロジェクト: dovanduy/Library
        /// <summary>
        /// This is being used for Pickups.
        /// </summary>
        /// <param name="indexListVM"></param>
        /// <param name="indexItemVM"></param>
        /// <param name="icommonWithId"></param>
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItemVM, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItemVM, icommonWithId);

            //conversions
            BuySellItem buySellItem = icommonWithId as BuySellItem;

            buySellItem.IsNullThrowException();
            buySellItem.ProductChild.IsNullThrowException();

            ProductChild productChild = buySellItem.ProductChild;

            productChild.IsNullThrowException();
            indexItemVM.Description = productChild.DetailInfoToDisplayOnWebsite;


            BuySellDoc buySellDoc = buySellItem.BuySellDoc;

            buySellDoc.IsNullThrowException();

            UploadedFile uf = productChild.MiscFiles.FirstOrDefault(x => !x.MetaData.IsDeleted);

            //product child has no image?
            if (uf.IsNull())
            {
                uf = productChild.Product.MiscFiles.FirstOrDefault(x => !x.MetaData.IsDeleted);
            }

            indexItemVM.MenuManager = new MenuManager(null, null, productChild, MenuENUM.IndexMenuProductChild, BreadCrumbManager, new LikeUnlikeParameters(0, 0, ""), UserId, indexListVM.MenuManager.ReturnUrl, UserName);

            //get the pictures list from the productChild
            List <string> pictureAddresses = GetCurrItemsPictureList(productChild);

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

            indexItemVM.MenuManager.PictureAddresses = pictureAddresses;
            //indexItem.PictureViews = productChild.NoOfVisits.Amount;
            //indexItem.CompleteMenuPathViews = productChild.NoOfVisits.Amount;

            //indexItem.Price = productChild.Sell.SellPrice;

            AddEntryToIndex = buySellItem.BuySellDocStateEnum == BuySellDocStateENUM.ReadyForPickup;

            string countyName = buySellDoc.AddressShipToComplex.CountryName;
            string cityName   = buySellDoc.AddressShipToComplex.CityName;
            string townName   = buySellDoc.AddressShipToComplex.TownName;

            //add the price into the 2nd heading

            if (!countyName.IsNullOrWhiteSpace() && !cityName.IsNullOrWhiteSpace() && !townName.IsNullOrWhiteSpace())
            {
                indexItemVM.Amount2ndLine = string.Format("{0} {1}, {2}", townName, cityName, countyName);
            }
            else
            {
                if (!countyName.IsNullOrWhiteSpace() && !cityName.IsNullOrWhiteSpace() && townName.IsNullOrWhiteSpace())
                {
                    indexItemVM.Amount2ndLine = string.Format("{0}, {1}", cityName, countyName);
                }
                else
                {
                    throw new Exception("Address incomplete");
                }
            }

            indexItemVM.IsPickup = true;
            indexItemVM.ParentId = buySellDoc.Id;
            //buySellDoc.BuySellDocumentTypeEnum = BuySellDocumentTypeENUM.Delivery;
        }
コード例 #15
0
ファイル: Index.cs プロジェクト: dovanduy/Library
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithid)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithid);
     AddEntryToIndex = !icommonWithid.Name.IsNullOrWhiteSpace();
 }
コード例 #16
0
ファイル: Index.cs プロジェクト: dovanduy/Library
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, InterfacesLibrary.SharedNS.ICommonWithId icommonWithId)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
 }
コード例 #17
0
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
     indexListVM.Show.EditDeleteAndCreate = true;
 }
コード例 #18
0
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
 }
コード例 #19
0
        /// <summary>
        /// The Menu will always run the MenuBiz.
        /// We do not care about the MenuManager in the ICommonWithId level. That is used in Create/Edit
        /// We need to load the MenuManager with the correct MainMenuPath so that it can be used in the _IndexMiddlePart - TiledPictures.cshtml
        /// We cant use the one in the list because that is a single one and the one that is used in the itme needs to have the
        /// MenuPath1 id. Moreover, the Id of the IndexItem is MenuPathMainId, so it is of no use.
        /// I want the menu's to be dimmed if they have no products. Moreover, The pictures from products need to bubble up to the top, at least 5...
        /// </summary>
        /// <param name="indexListVM"></param>
        /// <param name="indexItem"></param>
        /// <param name="icommonWithId"></param>
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            //The icommonWithId is the item that is running in the Forloop in the calling procedure
            //The icommonWithId comes here for the first 3 menus as a MenuPathMain item.
            //Then on the 4th it comes as a product.
            //You must select the correct MenuState Here as well
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
            int returnNoOfPictures = MenuPath1.MaxNumberOfPicturesInMenu() + 1;


            MenuPathMain mpm          = icommonWithId as MenuPathMain;
            ProductChild productChild = icommonWithId as ProductChild;
            Product      product      = icommonWithId as Product;


            LikeUnlikeParameters likeUnlikeCounter;
            //UploadedFile uf;
            List <string> pictureAddresses = new List <string>();
            List <string> currPcs          = new List <string>();

            //List<string> lstOfPictures = new List<string>();
            //string theUserId = indexListVM.UserId ?? "";
            string theUserId = UserId;



            MenuEnumForDefaultPicture = indexListVM.MenuManager.MenuState.MenuEnum;
            switch (indexListVM.MenuManager.MenuState.MenuEnum)
            {
            case MenuENUM.IndexMenuPath1:
                mpm.IsNullThrowException();
                mpm.MenuPath1.IsNullThrowException();

                //get the likes and unlikes for MenuPath1
                likeUnlikeCounter            = LikeUnlikeBiz.Count(mpm.MenuPath1.Id, null, null, null, null, theUserId, false);
                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.MenuENUM.IndexMenuPath1";

                indexItem.MenuManager = new MenuManager(mpm, product, productChild, MenuENUM.IndexMenuPath1, BreadCrumbManager, likeUnlikeCounter, UserId, indexListVM.MenuManager.ReturnUrl, UserName);

                indexItem.PictureViews = mpm.MenuPath1.NoOfVisits.Amount;

                //we need to change the image address to image of MenuPath1

                currPcs          = GetCurrItemsPictureList(mpm.MenuPath1 as IHasUploads);
                pictureAddresses = picturesForMenuPath(mpm.MenuPath1);

                //pictureAddresses = joinCurrPicsAndPictureAddresses(pictureAddresses, currPcs);

                if (!currPcs.IsNullOrEmpty())
                {
                    pictureAddresses = pictureAddresses.Concat(currPcs).ToList();
                }

                indexItem.Name               = mpm.MenuPath1.FullName();
                indexItem.Description        = mpm.MenuPath1.DetailInfoToDisplayOnWebsite;
                indexItem.HasProductsForSale = mpm.HasLiveProductChildren;
                indexItem.NoOfItems          = mpm.NoOfItems;
                indexItem.NoOfShops          = mpm.NoOfShops;
                break;


            case MenuENUM.IndexMenuPath2:
                mpm.IsNullThrowException();
                mpm.MenuPath2.IsNullThrowException();
                indexItem.Description = mpm.MenuPath2.DetailInfoToDisplayOnWebsite;

                //uf = mpm.MenuPath2.MiscFiles.FirstOrDefault(x => !x.MetaData.IsDeleted);
                //getPictureList(indexItem, mpm.MenuPath2);

                //indexItem.ImageAddressStr = getImage(uf);
                indexItem.Name               = mpm.MenuPath2.FullName();
                likeUnlikeCounter            = LikeUnlikeBiz.Count(null, mpm.MenuPath2.Id, null, null, null, theUserId, false);
                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.MenuENUM.IndexMenuPath2";
                indexItem.MenuManager        = new MenuManager(mpm, product, productChild, MenuENUM.IndexMenuPath2, BreadCrumbManager, likeUnlikeCounter, UserId, indexListVM.MenuManager.ReturnUrl, UserName);


                indexItem.CompleteMenuPathViews = getMp2Count(mpm);
                indexItem.PictureViews          = mpm.MenuPath2.NoOfVisits.Amount;

                indexItem.HasProductsForSale = mpm.HasLiveProductChildren;
                indexItem.NoOfItems          = mpm.NoOfItems;
                indexItem.NoOfShops          = mpm.NoOfShops;

                currPcs          = GetCurrItemsPictureList(mpm.MenuPath2 as IHasUploads);
                pictureAddresses = picturesForMenuPath(mpm.MenuPath1, mpm.MenuPath2);

                //pictureAddresses = joinCurrPicsAndPictureAddresses(pictureAddresses, currPcs);


                break;



            case MenuENUM.IndexMenuPath3:
                mpm.IsNullThrowException();
                //mpm.MenuPath3.IsNullThrowException(""); //this means there are no menu 3s. This is not allowed.
                if (mpm.MenuPath3.IsNull())
                {
                    return;
                }


                indexItem.Description = mpm.MenuPath3.DetailInfoToDisplayOnWebsite;
                //uf = mpm.MenuPath3.MiscFiles.FirstOrDefault(x => !x.MetaData.IsDeleted);

                //indexItem.ImageAddressStr = getImage(uf);
                //getPictureList(indexItem, mpm.MenuPath3);

                indexItem.Name    = mpm.MenuPath3.FullName();
                likeUnlikeCounter = LikeUnlikeBiz.Count(null, null, mpm.MenuPath3.Id, null, null, theUserId, false);

                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.MenuENUM.IndexMenuPath3";
                indexItem.MenuManager        = new MenuManager(mpm, product, productChild, MenuENUM.IndexMenuPath3, BreadCrumbManager, likeUnlikeCounter, UserId, indexListVM.MenuManager.ReturnUrl, UserName);

                indexItem.PictureViews          = mpm.MenuPath3.NoOfVisits.Amount;
                indexItem.CompleteMenuPathViews = mpm.NoOfVisits.Amount;

                indexItem.HasProductsForSale = mpm.HasLiveProductChildren;

                indexItem.NoOfItems = mpm.NoOfItems;
                indexItem.NoOfShops = mpm.NoOfShops;


                currPcs          = GetCurrItemsPictureList(mpm.MenuPath3 as IHasUploads);
                pictureAddresses = picturesForMenuPath(mpm);
                //pictureAddresses = joinCurrPicsAndPictureAddresses(pictureAddresses, currPcs);


                break;



            case MenuENUM.IndexMenuProduct:     //Products are coming
                product.IsNullThrowException();
                indexItem.Description = product.DetailInfoToDisplayOnWebsite;

                //uf = product.MiscFiles.FirstOrDefault(x => !x.MetaData.IsDeleted);

                likeUnlikeCounter            = LikeUnlikeBiz.Count(null, null, null, product.Id, null, theUserId, false);
                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.MenuENUM.IndexMenuProduct";
                indexItem.MenuManager        = new MenuManager(mpm, product, productChild, MenuENUM.IndexMenuProduct, BreadCrumbManager, likeUnlikeCounter, UserId, indexListVM.MenuManager.ReturnUrl, UserName);

                currPcs = GetCurrItemsPictureList(product as IHasUploads);
                if (product.IsShop)
                {
                    pictureAddresses = getShopPictures(product);
                }
                else
                {
                    pictureAddresses = picturesForProducts(product);
                }


                indexItem.MenuManager.PictureAddresses = pictureAddresses;

                indexItem.PictureViews          = product.NoOfVisits.Amount;
                indexItem.CompleteMenuPathViews = product.NoOfVisits.Amount;

                indexItem.HasProductsForSale = product.HasLiveProductChildren;
                indexItem.NoOfItems          = product.ProductChildren_Fixed_Not_Hidden.Count;

                markUserAsOwnerOfShop(indexItem, product);
                indexItem.IsShop = product.IsShop;
                if (indexItem.IsShopAndOwnerOfShop)
                {
                    indexItem.ShopExpiresStr = ExpiryDateInNoOfDays(product.ShopExpiryDate.Date_NotNull_Max);
                }
                break;


            case MenuENUM.IndexMenuProductChild:
                productChild.IsNullThrowException();
                indexItem.Description            = productChild.DetailInfoToDisplayOnWebsite;
                indexItem.IsTokenPaymentAccepted = productChild.IsNonRefundablePaymentAccepted;
                indexItem.IsHidden = productChild.Hide;

                likeUnlikeCounter            = LikeUnlikeBiz.Count(null, null, null, null, productChild.Id, theUserId, false);
                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.MenuENUM.IndexMenuProductChild";
                indexItem.MenuManager        = new MenuManager(mpm, product, productChild, MenuENUM.IndexMenuProductChild, BreadCrumbManager, likeUnlikeCounter, UserId, indexListVM.MenuManager.ReturnUrl, UserName);

                Person person = UserBiz.GetPersonFor(UserId);
                if (!person.IsNull())
                {
                    string userPersonId         = person.Id;
                    string productChildPersonId = productChild.Owner.PersonId;
                    indexItem.MenuManager.IndexMenuVariables.updateRequiredProperties(userPersonId, productChildPersonId);
                }

                //get the pictures list from the productChild
                currPcs = GetCurrItemsPictureList(productChild);

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

                //}

                indexItem.PictureViews          = productChild.NoOfVisits.Amount;
                indexItem.CompleteMenuPathViews = productChild.NoOfVisits.Amount;

                indexItem.Price = productChild.Sell.SellPrice;
                break;


            case MenuENUM.EditMenuPath1:
            case MenuENUM.EditMenuPath2:
            case MenuENUM.EditMenuPath3:
            case MenuENUM.EditMenuPathMain:
            case MenuENUM.EditMenuProduct:
            case MenuENUM.EditMenuProductChild:
            case MenuENUM.CreateMenuPath1:
            case MenuENUM.CreateMenuPath2:
            case MenuENUM.CreateMenuPath3:
            case MenuENUM.CreateMenuPathMenuPathMain:
            case MenuENUM.CreateMenuProduct:
            case MenuENUM.CreateMenuProductChild:
            default:
                likeUnlikeCounter            = LikeUnlikeBiz.Count(null, null, null, null, null, theUserId, false);
                likeUnlikeCounter.KindOfLike = "Event_ModifyIndexItem.Default";

                break;
            }



            pictureAddresses = joinCurrPicsAndPictureAddresses(pictureAddresses, currPcs);

            string startSort = getStartSort(indexItem, indexListVM);

            indexItem.Input1SortString = startSort + indexItem.Input1SortString;
            indexItem.Input2SortString = startSort + indexItem.Input2SortString;
            indexItem.Input3SortString = startSort + indexItem.Input3SortString;

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

            indexItem.MenuManager.PictureAddresses = pictureAddresses;


            indexItem.MenuManager.LikeUnlikesCounter = likeUnlikeCounter;
            indexItem.MenuManager.BreadCrumbManager  = indexListVM.MenuManager.BreadCrumbManager;

            if (!UserId.IsNullOrWhiteSpace())
            {
                Person person = UserBiz.GetPersonFor(UserId);
                person.IsNullThrowException("person");
                indexItem.MenuManager.UserPersonId = person.Id;
            }
        }