Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        ////This supplies a dummy MenuPathMain for the Back to List in the Create.
        //private MenuManager makeMenuManager(ControllerIndexParams parameters)
        //{


        //    MenuManager mm = new MenuManager(parameters.Id, null, null, null, parameters.Menu.MenuLevelEnum, parameters.Menu.ReturnUrl, true, "", parameters.SelectedId, parameters.SearchFor, parameters.SortBy,parameters.ActionNameEnum);

        //    if (!parameters.Menu.MenuPathMainId.IsNullOrWhiteSpace())
        //    {
        //        mm.MenuPathMain = _menuPathMainBiz.Find(parameters.Menu.MenuPathMainId);
        //        mm.MenuPathMain.IsNullThrowException();
        //    }

        //    if (!parameters.Menu.ProductId.IsNullOrWhiteSpace())
        //    {
        //        mm.Product = Find(parameters.Menu.ProductId);
        //        mm.Product.IsNullThrowException();
        //    }


        //    if (!parameters.Menu.ProductChildId.IsNullOrWhiteSpace())
        //    {
        //        mm.ProductChild = _productChildBiz.Find(parameters.Menu.ProductChildId);
        //        mm.ProductChild.IsNullThrowException();
        //    }



        //    return mm;


        //}



        private static string makeName(IndexListVM indexListVM)
        {
            string completeName = "";
            string nameProdCat1 = "";

            if (indexListVM.MenuManager.MenuPathMain.IsNull())
            {
                return(completeName = "Menu Items");
            }

            if (!indexListVM.MenuManager.MenuPathMain.MenuPath1.IsNull())
            {
                nameProdCat1 = indexListVM.MenuManager.MenuPathMain.MenuPath1.Name;
            }

            string nameProdCat2 = "";

            if (!indexListVM.MenuManager.MenuPathMain.MenuPath2.IsNull())
            {
                nameProdCat2 = indexListVM.MenuManager.MenuPathMain.MenuPath2.Name;
            }

            string nameProdCat3 = "";

            if (!indexListVM.MenuManager.MenuPathMain.MenuPath3.IsNull())
            {
                nameProdCat3 = indexListVM.MenuManager.MenuPathMain.MenuPath3.Name;
            }


            completeName = "Menu Items";


            return(completeName);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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;
            }
        }
Ejemplo n.º 6
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);

            indexListVM.Heading.Column           = "Salesman Category";
            indexListVM.Show.EditDeleteAndCreate = true;
        }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
0
        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";
        }
Ejemplo n.º 11
0
        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";
        }
Ejemplo n.º 12
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;
        }
Ejemplo n.º 13
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";
        }
Ejemplo n.º 14
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;
        }
Ejemplo n.º 15
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;
        }
Ejemplo n.º 16
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;
        }
Ejemplo n.º 17
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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 19
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;
        }
Ejemplo n.º 20
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);
        }
Ejemplo n.º 21
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;
        }
Ejemplo n.º 22
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)";
            }
        }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
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;
            }
        }
Ejemplo n.º 26
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);
        }
Ejemplo n.º 27
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();
            }
        }
Ejemplo n.º 28
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();
        }
Ejemplo n.º 29
0
        public override void Event_ModifyIndexList(IndexListVM indexListVM, ControllerIndexParams parameters)
        {
            base.Event_ModifyIndexList(indexListVM, parameters);
            indexListVM.Show.EditDeleteAndCreate = true;

            //if (parameters.Entity.IsNull())
            //    return;

            //PlayerAbstract playerAbstract = parameters.Entity as PlayerAbstract;
            //playerAbstract.IsNullThrowException("Unable to unbox player Abstract");

            //this is where the user's money amounts are added.
            //if (!UserId.IsNullOrWhiteSpace())
            //{
            //    //user is logged in...
            //    //Get the User's Money balances
            //    playerAbstract.PersonId.IsNullOrWhiteSpaceThrowException("playerAbstract.PersonId");
            //    indexListVM.MenuManager.UserMoneyAccount = CashTrxBiz.UserMoneyAccountForPerson(playerAbstract.PersonId);
            //}
        }
Ejemplo n.º 30
0
        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());
        }