Exemple #1
0
        public ControllerCreateEditParameter(ICommonWithId entity, HttpPostedFileBase[] httpMiscUploadedFiles, HttpPostedFileBase[] httpSelfieUpload, HttpPostedFileBase[] httpIdCardFront, HttpPostedFileBase[] httpIdCardBack, HttpPostedFileBase[] httpPassportFront, HttpPostedFileBase[] httpPassportVisa, HttpPostedFileBase[] httpLiscenseFront, HttpPostedFileBase[] httpLiscenseBack) : this()
        {
            Entity = entity;
            MiscUploadedFiles.HttpBase = httpMiscUploadedFiles;
            SelfieUpload.HttpBase      = httpSelfieUpload;
            IdCardFront.HttpBase       = httpIdCardFront;
            IdCardBack.HttpBase        = httpIdCardBack;
            PassportFront.HttpBase     = httpPassportFront;
            PassportVisa.HttpBase      = httpPassportVisa;
            LiscenseFront.HttpBase     = httpLiscenseFront;
            LiscenseBack.HttpBase      = httpLiscenseBack;

            if (IsIHasUploads)
            {
                MiscUploadedFiles.FileLocation = Entity_IHasUploads.MiscFilesLocation;
            }

            if (IsIUserHasUploads)
            {
                SelfieUpload.FileLocation = Entity_IUserHasUploads.SelfieLocation;

                IdCardFront.FileLocation = Entity_IUserHasUploads.IdCardFrontLocation;
                IdCardBack.FileLocation  = Entity_IUserHasUploads.IdCardBackLocation;

                PassportFront.FileLocation = Entity_IUserHasUploads.PassportFrontLocation;
                PassportVisa.FileLocation  = Entity_IUserHasUploads.PassportVisaLocation;

                LiscenseFront.FileLocation = Entity_IUserHasUploads.LiscenseFrontLocation;
                LiscenseBack.FileLocation  = Entity_IUserHasUploads.LiscenseBackLocation;
            }
        }
Exemple #2
0
        public override ICommonWithId Factory()
        {
            ICommonWithId icommonwithid = base.Factory();
            FileDoc       fileDoc       = icommonwithid as FileDoc;

            fileDoc.IsNullThrowException();
            fileDoc.FileNumber = GetNextFileNumber();


            return(icommonwithid);
        }
Exemple #3
0
        public System.Web.Mvc.SelectList SelectList_ForParent(ICommonWithId entity)
        {
            throw new NotImplementedException();
            //var allItemsExceptThisOne = FindAll();

            //if(!entity.IsNull())
            //    if(!entity.Name.IsNullOrWhiteSpace())
            //        allItemsExceptThisOne = allItemsExceptThisOne.Where(x => x.Name.ToLower() != entity.Name.ToLower());

            //return Dal.SelectList_Engine(allItemsExceptThisOne);
        }
Exemple #4
0
        public override ICommonWithId Factory()
        {
            ICommonWithId icommon = base.Factory();

            AddressMain address = icommon as AddressMain;

            address.AddressType.IsBillAddress   = true;
            address.AddressType.IsInformAddress = true;
            address.AddressType.IsShipAddress   = true;

            return(icommon);
        }
Exemple #5
0
        public override ICommonWithId Factory()
        {
            ICommonWithId iCommonWithId = base.Factory();
            BuySellDoc    buySellDoc    = BuySellDoc.UnBox(iCommonWithId)
            ;

            buySellDoc.BuySellItems = new List <BuySellItem>();

            //int noOfDays = GetMoneyBackGuaranteeNumberOfDays();
            //buySellDoc.MoneyBackGuarantee.MarkTrue(noOfDays, UserName, UserId);

            return(iCommonWithId);
        }
Exemple #6
0
        public SelectList SelectList_ForParent(ICommonWithId entity)
        {
            var allItemsExceptThisOne = FindAll();

            if (!entity.IsNull())
            {
                if (!entity.Name.IsNullOrWhiteSpace())
                {
                    allItemsExceptThisOne = allItemsExceptThisOne.Where(x => x.Name.ToLower() != entity.Name.ToLower());
                }
            }

            var s = SelectList_Engine(allItemsExceptThisOne);

            return(s);
        }
        public override void EVENT_DeleteRelatedRecordsActually(ICommonWithId entity)
        {
            base.EVENT_DeleteRelatedRecordsActually(entity);

            Product p = entity as Product;

            p.IsNullThrowException("Programming error. Entity is not Product.");

            //Delete the Product Identifiers Uploads
            deleteProductIdentifiersActually(p);
            deleteChildProductsUploadsActually(p);
            //deleteProductUploadsActually(p);
            //delete Products own Upload Records
            deleteUploadsAndPhysicalFiles(p.MiscFiles);
            deleteLikesUnlikes(p);


            //Delete the Product Product Children Uploads
        }
Exemple #8
0
        private void addNewAddress(ICommonWithId entity, Person person, AddressBiz addressBiz, AddressMain addressToSave)
        {
            ProductChild pc = entity as ProductChild;

            pc.IsNullThrowException();

            pc.ShipFromAddressId = addressToSave.Id;

            if (addressToSave.ProductChilds.IsNull())
            {
                addressToSave.ProductChilds = new List <ProductChild>();
            }

            addressToSave.ProductChilds.Add(pc);

            person.Addresses.Add(addressToSave);
            addressToSave.PersonId = person.Id;
            addressBiz.Create(addressToSave);
        }
        public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
        {
            base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
            MenuPath1 mp1 = icommonWithId as MenuPath1;

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

            //mpm.IsNullThrowException("mpm");

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


            indexItem.MenuManager.PictureAddresses = GetCurrItemsPictureList(mp1);
        }
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
     indexListVM.Show.EditDeleteAndCreate = true;
 }
Exemple #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();
            }
        }
Exemple #12
0
        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;
            }
        }
Exemple #13
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);
        }
        /// <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;
            }
        }
Exemple #15
0
 public SelectList SelectList_ForParent(ICommonWithId entity)
 {
     return(_productBiz.SelectList_ForParent(entity));
 }
Exemple #16
0
        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();
        }
Exemple #17
0
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithId)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithId);
 }
Exemple #18
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);
        }
Exemple #19
0
        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);
        }
Exemple #20
0
        //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);
        }
Exemple #21
0
 public override void Event_ModifyIndexItem(IndexListVM indexListVM, IndexItemVM indexItem, ICommonWithId icommonWithid)
 {
     base.Event_ModifyIndexItem(indexListVM, indexItem, icommonWithid);
     AddEntryToIndex = !icommonWithid.Name.IsNullOrWhiteSpace();
 }
Exemple #22
0
        /// <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;
        }
Exemple #23
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;
        }