예제 #1
0
        public static BuySellDoc UnboxBuySell(ControllerIndexParams parm)
        {
            BuySellDoc buySellDoc = parm.Entity as BuySellDoc;

            buySellDoc.IsNullThrowException("Unable to unbox buySellDoc");
            return(buySellDoc);
        }
예제 #2
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "Non Returnable Fees";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #3
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            //indexListVM.Heading_Column = "Discount Precedence Rules ( Type-Rule-Rank)";
            indexListVM.Show.MoveUpMoveDown(true);
        }
예제 #4
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "Cash Payment Methods";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #5
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "Salesman Category";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #6
0
        //This supplies a dummy MenuPathMain for the Back to List in the Create.
        protected IMenuManager makeMenuManager(ControllerIndexParams parm)
        {
            MenuManager mm = new MenuManager(null, null, null, parm.MenuEnum, parm.BreadCrumbManager, parm.LikeUnlikeCounter, UserId, parm.ReturnUrl, UserName);

            mm.BreadCrumbManager = parm.BreadCrumbManager;
            return(mm as IMenuManager);
        }
예제 #7
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parameters)
        {
            IList <Product> lst = await FindAllAsync();

            lst = lst.Where(x => x.IsUnApproved == IsShowUnApproved).ToList() as IList <Product>;
            return(lst.Cast <ICommonWithId>().ToList());
        }
예제 #8
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "All Menu Path 1";
            indexListVM.IsImageTiled             = true;
            indexListVM.Show.EditDeleteAndCreate = false;
        }
예제 #9
0
파일: Index.cs 프로젝트: dovanduy/Library
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            //indexListVM.Heading.Column = "UOM Length";
            //indexListVM.Records = "UOM Lengths";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #10
0
파일: Index.cs 프로젝트: dovanduy/Library
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

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

            //indexListVM.Records = "Languages";
        }
예제 #11
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column = "[Abbreviation] - Country Name";
//            indexListVM.Record = "Country";
            indexListVM.Heading.RecordNamePlural = "Countries";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #12
0
파일: Index.cs 프로젝트: dovanduy/Library
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "[Abbreviation] - State Name";
            indexListVM.Show.EditDeleteAndCreate = true;
            //indexListVM.Show.Record = "State";
            //indexListVM.Records = "States";
        }
예제 #13
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "All Emails for User";
            indexListVM.Show.EditDeleteAndCreate = true;
            indexListVM.Show.VerificationIcon    = true;
            indexListVM.Show.MakeDefaultIcon     = true;
        }
예제 #14
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "All Menu Path 3";
            indexListVM.IsImageTiled             = true;
            indexListVM.Show.EditDeleteAndCreate = true;
            //indexListVM.MenuManager.MenuState.MenuDisplayName = "Menu 3";
        }
예제 #15
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column = "All Menu Mains";
            //indexListVM.MainHeading = "Product Category 3";
            //indexListVM.IsImageTiled = true;
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #16
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column = "All Uploads";
            //indexListVM.MainHeading = "Various Uploads";

            indexListVM.IsImageTiled             = true;
            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #17
0
 public override void InitializeMenuManagerForEntity(ControllerIndexParams parm, InterfacesLibrary.SharedNS.ICommonWithId entity)
 {
     base.InitializeMenuManagerForEntity(parm, entity);
     if (!UserId.IsNullOrWhiteSpace())
     {
         Person person = UserBiz.GetPersonFor(UserId);
         person.IsNullThrowException("person");
         entity.MenuManager.UserPersonId = person.Id;
     }
 }
예제 #18
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.NameInput1     = "Name";
            indexListVM.NameInput2     = "Controller";
            indexListVM.Heading.Column = "Visitor Logging";

            indexListVM.Show.EditDeleteAndCreate = true;
        }
예제 #19
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            List <ICommonWithId> lst = new List <ICommonWithId>();

            switch (parms.MenuEnum)
            {
            case MenuENUM.IndexMenuPath1:
                lst = await IndexMenuPath1_DataListAsync();

                break;

            case MenuENUM.IndexMenuPath2:

                lst = await indexMenuPath2_DataListAsync(parms);

                break;

            case MenuENUM.IndexMenuPath3:
                lst = await indexMenuPath3_DataListAsync(parms);

                break;

            case MenuENUM.IndexMenuProduct:
                lst = await indexProduct_DataListAsync(parms);

                break;

            case MenuENUM.IndexMenuProductChild:
                lst = await indexProductChild_DataListAsync(parms);

                break;

            //case MenuENUM.IndexMenuProductChildLandingPage:
            //    lst = await indexProductChildLandingPage_DataListAsync(parms);
            //    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:
                break;
            }



            return(lst);
        }
예제 #20
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            var lstEntities = await FindAllAsync();

            if (lstEntities.IsNullOrEmpty())
            {
                return(null);
            }


            if (lstEntities.IsNullOrEmpty())
            {
                return(null);
            }

            string personId = GetPersonIdForCurrentUser();


            var lstTEntity = lstEntities
                             .Cast <TEntity>().ToList();

            //var lstTEntitySelected = lstTEntity
            //    .Where(x => x.People.Any(yield => yield.Id == personId)).ToList();

            if (lstTEntity.IsNullOrEmpty())
            {
                return(null);
            }

            //get all addresses with this person's Id

            List <TEntity> tentityList = lstEntities.Where(x => x.PersonId == personId).ToList();


            //foreach (var item in lstTEntity)
            //{

            //    if (item.People.IsNullOrEmpty())
            //        continue;
            //    foreach (var pp in item.People)
            //    {
            //        if(pp.Id == personId)
            //            tentityList.Add(item);
            //    }
            //}


            var lstIcommonWithId = tentityList
                                   .Cast <ICommonWithId>().ToList();

            return(lstIcommonWithId);
        }
예제 #21
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            List <FileDoc> lst = await FindAllForUserAsync(UserId);

            if (lst.IsNullOrEmpty())
            {
                return(null);
            }

            var lstIcommonWithId = lst.Cast <ICommonWithId>().ToList();

            return(lstIcommonWithId);
        }
예제 #22
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;
        }
예제 #23
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);
            indexListVM.Show.EditDeleteAndCreate = true;
            indexListVM.IsImageTiled             = true;
            indexListVM.MenuManager.ReturnUrl    = parameters.ReturnUrl;

            indexListVM.Heading.Main = "Seller Product";
            if (IsShowHidden)
            {
                indexListVM.Heading.Main = "Seller Product (Hidden)";
            }
        }
예제 #24
0
        private async Task <List <ICommonWithId> > indexMenuPath3_DataListAsync(ControllerIndexParams parms)
        {
            parms.MenuPathMainId.IsNullOrWhiteSpaceThrowException("Main Menu Path Id not received.");

            MenuPathMain mpm = await FindAsync(parms.MenuPathMainId);

            mpm.IsNullThrowException("MenuPathMain not found.");

            List <MenuPathMain> uniqueListOfMainPaths = UniqueListOfMainPath_IDs(mpm.MenuPath1Id, mpm.MenuPath2Id);

            //===========================================
            List <MenuPathMain> mpms_Distinct_With_Live_Products_And_Shops = get_All_Live_Products_And_Shops();
            //===========================================

            //update the count of Menu2Path
            MenuPath2 mp2 = MenuPathMainBiz.MenuPath2Biz.FindAll().FirstOrDefault(x => x.Id == mpm.MenuPath2Id);

            if (!mp2.IsNull())
            {
                if (!UserId.IsNullOrWhiteSpace())
                {
                    //these can be wrng if they also describe other paths
                    //this is how many times this particular picture has been clicked
                    mp2.NoOfVisits.AddOne(UserId, UserName);
                    await MenuPathMainBiz.MenuPath2Biz.UpdateAndSaveAsync(mp2);
                }
            }


            if (uniqueListOfMainPaths.IsNullOrEmpty())
            {
                return(null);
            }


            foreach (MenuPathMain mpm2 in uniqueListOfMainPaths)
            {
                //check to see if these items have any sale items
                if (mpms_Distinct_With_Live_Products_And_Shops.Contains(mpm2))
                {
                    mpm2.HasLiveProductChildren = true;
                    mpm2.NoOfItems = mpm2.ProductChildren_Fixed_Not_Hidden.Count;
                    mpm2.NoOfShops = mpm2.Product_Shops_Not_Expired.Count;
                }
            }
            List <ICommonWithId> mpmlst = uniqueListOfMainPaths.Cast <ICommonWithId>().ToList();


            return(mpmlst);
        }
예제 #25
0
        /// <summary>
        /// When the Product is created from the productMenu, then its; menuPathMainId is sent along with it
        /// This will be its first MenuPathMain. User can add more as required.
        /// </summary>
        /// <param name="parm"></param>
        /// <param name="product"></param>
        private void addMenuPathMainSentFromView(ControllerIndexParams parm, Product product)
        {
            if (!parm.MenuPathMainId.IsNullOrWhiteSpace())
            {
                if (product.MenuPathMains.IsNull())
                {
                    product.MenuPathMains = new List <MenuPathMain>();
                }

                MenuPathMain mpm = MenuPathMainBiz.Find(parm.MenuPathMainId);
                mpm.IsNullThrowException("Menu Path main not found");
                product.MenuPathMains.Add(mpm);
            }
        }
예제 #26
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            //first get a list of all the people
            List <Person> peopleList = await FindAllAsync();

            List <Person> peopleFoundLst = ListOfPeopleForUser(UserId, peopleList);

            if (peopleFoundLst.IsNullOrEmpty())
            {
                return(null);
            }
            //cast and return the list
            var lstIcommonwithId = peopleFoundLst.Cast <ICommonWithId>().ToList();

            return(lstIcommonwithId);
        }
예제 #27
0
        //this returns a list of checked boxes marked true
        //public List<CheckBoxItem> LoadMenuPathCheckedBoxes(IProduct product, MenuPath1ENUM menuPath1Enum = MenuPath1ENUM.Unknown)
        //Note, the MenuPath1 of the Product should have the correct Menupath or a MenuPath1 has to be passed.
        public void LoadMenuPathCheckedBoxes(ControllerIndexParams parm)
        {
            Product product = Product.Unbox(parm.Entity);


            addMenuPathMainSentFromView(parm, product);


            List <CheckBoxItem> checkedboxes = CreateCheckBoxes();

            markProductSelectedCheckBoxesTrue(product, checkedboxes);

            //new code to create CheckBoxList
            //this creates the check box list which are in the view.
            //helps to make the chk boxes collapsable
            product.Mp1List          = createCheckBoxListFrom(checkedboxes);
            product.CheckedBoxesList = checkedboxes;
        }
예제 #28
0
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            // errIfNotLoggedIn();

            var lst = (await base.GetListForIndexAsync(parms));

            if (lst.IsNullOrEmpty())
            {
                return(null);
            }


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

            return(lstIcommonwithId);
        }
예제 #29
0
파일: Index.cs 프로젝트: dovanduy/Library
        public override async Task <IList <ICommonWithId> > GetListForIndexAsync(ControllerIndexParams parms)
        {
            //get user's customer and owner
            Customer customer = CustomerBiz.GetPlayerFor(UserId);
            Owner    owner    = OwnerBiz.GetPlayerFor(UserId);


            //now, get all the payment trx for this person
            List <BuySellDoc> allTrx = await FindAllAsync();

            List <BuySellDoc> filteredTrx;

            //now reduce this list so the user is customer or seller
            if (customer.IsNull())
            {
                if (owner.IsNull())
                {
                    //filteredTrx = allTrx.Where(x => x.CustomerId == customerId).AsQueryable();
                    return(null);
                }
                else
                {
                    filteredTrx = allTrx.Where(x => x.OwnerId == owner.Id).ToList();
                }
            }
            else
            {
                if (owner.IsNull())
                {
                    filteredTrx = allTrx.Where(x => x.CustomerId == customer.Id).ToList();
                }
                else
                {
                    filteredTrx = allTrx.Where(x => x.CustomerId == customer.Id || x.OwnerId == owner.Id).ToList();
                }
            }

            //cast and return the list
            var lstIcommonwithId = allTrx.Cast <ICommonWithId>().ToList();

            return(lstIcommonwithId);
        }
예제 #30
0
        /// <summary>
        /// This will return Product Children.
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        private async Task <List <ICommonWithId> > indexProductChild_DataListAsync(ControllerIndexParams parms)
        {
            //Get the product

            parms.ProductId.IsNullOrWhiteSpaceThrowException();
            Product product = await ProductBiz.FindAsync(parms.ProductId);

            //parent product cannot be null. It is some kind of programming error if it is.
            product.IsNullThrowException(string.Format("Product not found. Id ='{0}'", parms.ProductId));


            //update the number of visits
            if (!UserId.IsNullOrWhiteSpace())
            {
                product.NoOfVisits.AddOne(UserId, UserName);
                await ProductBiz.UpdateAndSaveAsync(product);
            }
            //get all its child products and display them

            List <ProductChild> children;

            //see if the product is a shop
            if (product.OwnerId.IsNullOrWhiteSpace())
            {
                //this is not a shop.
                children = productChildren(product);
            }
            else
            {
                //this is a shop
                children = shopChildren(product);
            }

            if (children.IsNullOrEmpty())
            {
                return(null);
            }

            List <ICommonWithId> childrenAsIcommonLst = children.Cast <ICommonWithId>().ToList();

            return(childrenAsIcommonLst);
        }