Exemple #1
0
 public GetCommunityGridCommand(List <Book> books, int pageNumber, int pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter)
 {
     base.StoredProcedureName = AdminStoredProcedures.SpGetCommunityGridWithPaging;
     this._books      = books;
     this._pageNumber = pageNumber;
     this._pageSize   = pageSize;
     this._sortBy     = sortBy;
     this._orderBy    = orderBy;
     this._filter     = filter;
 }
Exemple #2
0
 internal static FilterForCommunityGridVm MapToFilterForCommunityGridVm(this CommunityGridFilter filter)
 {
     return(new FilterForCommunityGridVm()
     {
         AAC = filter.AAC,
         AAH = filter.AAH,
         Community = filter.Community,
         Packages = ConverterHelpers.DictionaryToCheckBoxList(ItemTypeBc.Instance.GetAdditionalInfo(AdditionalInfoClass.Package), filter.Packages.ConvertAll <long>((KeyValuePair <int, string> x) => (long)x.Key)),
         Publish = filter.Publish,
         PublishEnd = filter.PublishEnd,
         PublishStart = filter.PublishStart,
         SHC = filter.SHC,
         Showcase = filter.Showcase,
         ShowcaseStart = filter.ShowcaseStart,
         ShowcaseEnd = filter.ShowcaseEnd,
         SHCCategories = ConverterHelpers.DictionaryToCheckBoxList(ItemTypeBc.Instance.GetSHCCategoriesForCommunity(), filter.Categories.ConvertAll <long>((KeyValuePair <int, string> x) => (long)x.Key))
     });
 }
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            CommunityGridFilter filter = new CommunityGridFilter()
            {
                Community     = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "community"),
                AAC           = UtilsForBinding.GetBooleanValue(bindingContext.get_ValueProvider(), "aac"),
                AAH           = UtilsForBinding.GetBooleanValue(bindingContext.get_ValueProvider(), "aah"),
                SHC           = UtilsForBinding.GetBooleanValue(bindingContext.get_ValueProvider(), "shc"),
                Showcase      = UtilsForBinding.GetBooleanValue(bindingContext.get_ValueProvider(), "showcase"),
                Publish       = UtilsForBinding.GetBooleanValue(bindingContext.get_ValueProvider(), "publish"),
                ShowcaseStart = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "showcaseStart"),
                ShowcaseEnd   = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "showcaseEnd"),
                PublishStart  = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "publishStart"),
                PublishEnd    = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "publishEnd")
            };
            string      packages        = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "packages");
            List <long> checkedPackages = (packages != null ? (new List <string>(packages.Split(new char[] { ',' }))).ConvertAll <long>(new Converter <string, long>(long.Parse)) : new List <long>());

            filter.Packages = new List <KeyValuePair <int, string> >();
            foreach (KeyValuePair <int, string> package in ItemTypeBc.Instance.GetAdditionalInfo(AdditionalInfoClass.Package))
            {
                if (!checkedPackages.Contains((long)package.Key))
                {
                    continue;
                }
                filter.Packages.Add(package);
            }
            string      categories        = UtilsForBinding.GetStringValue(bindingContext.get_ValueProvider(), "shcCategories");
            List <long> checkedCategories = (categories != null ? (new List <string>(categories.Split(new char[] { ',' }))).ConvertAll <long>(new Converter <string, long>(long.Parse)) : new List <long>());

            filter.Categories = new List <KeyValuePair <int, string> >();
            foreach (KeyValuePair <int, string> category in ItemTypeBc.Instance.GetSHCCategoriesForCommunity())
            {
                if (!checkedCategories.Contains((long)category.Key))
                {
                    continue;
                }
                filter.Categories.Add(category);
            }
            return(filter);
        }
        public static CommunityForGridVm GetLastCommunityForGrid(int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter)
        {
            int         totalCount;
            int?        nullable;
            CommunityBc instance  = CommunityBc.Instance;
            int?        nullable1 = pageNumber;
            int?        nullable2 = pageSize;

            if (nullable1.HasValue & nullable2.HasValue)
            {
                nullable = new int?(nullable1.GetValueOrDefault() * nullable2.GetValueOrDefault());
            }
            else
            {
                nullable = null;
            }
            return(instance.GetAll(nullable, new int?(1), sortBy, orderBy, filter, out totalCount).FirstOrDefault <Community>().MapToCommunityForGridVm());
        }
        public static CommunityGridVm GetCommunityGridVm(int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter)
        {
            int             totalCount;
            CommunityGridVm communityGrid = new CommunityGridVm()
            {
                IsAdmin = true
            };
            List <Community> communities = CommunityBc.Instance.GetAll(pageNumber, pageSize, sortBy, orderBy, filter, out totalCount);

            communityGrid.List = communities.MapToCommunityForGridVmList();
            if (pageNumber.HasValue)
            {
                communityGrid.PageNumber = pageNumber.Value;
            }
            if (pageSize.HasValue)
            {
                communityGrid.PageSize = pageSize.Value;
            }
            communityGrid.TotalCount  = totalCount;
            communityGrid.SortBy      = sortBy;
            communityGrid.OrderBy     = orderBy;
            communityGrid.GridUrl     = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "Grid" });
            communityGrid.JsonGridUrl = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "JsonGrid" });
            communityGrid.ChangeListingTypeStateUrl = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "ChangeListingTypeState" });
            communityGrid.ChangePackageTypeUrl      = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "ChangePackageType" });
            communityGrid.ChangeSeniorHousingAndCareCategoriesUrl = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "ChangeSeniorHousingAndCareCategories" });
            communityGrid.ChangeShowcaseDatesUrl = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "ChangeShowcaseDates" });
            communityGrid.ChangePublishDatesUrl  = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "ChangePublishDates" });
            communityGrid.DeleteCommunityUrl     = MSLivingChoices.Mvc.Uipc.Legacy.MslcUrlBuilder.GetRouteUrl("iList", new { Controller = "Community", Action = "Delete" });
            communityGrid.Filter = filter.MapToFilterForCommunityGridVm();
            return(communityGrid);
        }
Exemple #6
0
 public List <Community> GetAll(List <Book> books, int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter, out int totalCount)
 {
     //
     // Current member / type: System.Collections.Generic.List`1<MSLivingChoices.Entities.Admin.Community> MSLivingChoices.SqlDacs.Admin.Components.SqlCommunityDac::GetAll(System.Collections.Generic.List`1<MSLivingChoices.Entities.Admin.Book>,System.Nullable`1<System.Int32>,System.Nullable`1<System.Int32>,System.Nullable`1<MSLivingChoices.Entities.Admin.Enums.CommunityGridSortByOption>,System.Nullable`1<MSLivingChoices.Entities.Admin.Enums.OrderBy>,MSLivingChoices.Entities.Admin.CommunityGridFilter,System.Int32&)
     // File path: C:\Users\sra_r\Desktop\SeniorLiving1\Main\bin\MSLivingChoices.SqlDacs.Admin.dll
     //
     // Product version: 2019.1.118.0
     // Exception in: System.Collections.Generic.List<MSLivingChoices.Entities.Admin.Community> GetAll(System.Collections.Generic.List<MSLivingChoices.Entities.Admin.Book>,System.Nullable<System.Int32>,System.Nullable<System.Int32>,System.Nullable<MSLivingChoices.Entities.Admin.Enums.CommunityGridSortByOption>,System.Nullable<MSLivingChoices.Entities.Admin.Enums.OrderBy>,MSLivingChoices.Entities.Admin.CommunityGridFilter,System.Int32&)
     //
     // Specified argument was out of the range of valid values.
     // Parameter name: Expression is not evaluated to any type.
     //    at Š.Ÿ€.€(Expression –, VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 102
     //    at Š.Ÿ€.€(Expression –, VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 94
     //    at Š.Ÿ€.€(Expression –, VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 94
     //    at Š.Ÿ€.‡(BinaryExpression Ÿ, VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 182
     //    at Š.Ÿ€.€(Expression –, VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 75
     //    at Š.Ÿ€.€(Instruction ›, Expression , VariableReference ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\UsedAsTypeHelper.cs:line 45
     //    at Š.Œ€.ˆ€(VariableReference ‹, TypeReference& ‹) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\GreedyTypeInferer.cs:line 60
     //    at Š.Œ€.€() in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\GreedyTypeInferer.cs:line 35
     //    at Telerik.JustDecompiler.Decompiler.TypeInference.TypeInferer.€() in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\TypeInference\TypeInferer.cs:line 300
     //    at Telerik.JustDecompiler.Decompiler.ExpressionDecompilerStep.œ(DecompilationContext Ž, •Ÿ €–) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\ExpressionDecompilerStep.cs:line 86
     //    at ‚–.™“.(MethodBody €–, •Ÿ Ÿ, ILanguage ) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 88
     //    at ‚–.™“.‹(MethodBody €–, ILanguage ) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 70
     //    at Telerik.JustDecompiler.Decompiler.Extensions.›“(™“ œ“, ILanguage , MethodBody €–, DecompilationContext& ™) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 95
     //    at Telerik.JustDecompiler.Decompiler.Extensions.š“(MethodBody €–, ILanguage , DecompilationContext& ™,  œ–) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 58
     //    at ——.ƒ˜.—(ILanguage , MethodDefinition €,  œ–) in C:\DeveloperTooling_JD_Agent1\_work\15\s\OpenSource\Cecil.Decompiler\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 117
     //
     // mailto: [email protected]
 }
        public List <Community> GetAll(int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter, out int totalCount)
        {
            List <Book> books = new List <Book>();

            if (!AccountBc.Instance.IsUserInRole(UmsRoles.Admin))
            {
                books = AccountBc.Instance.GetBooks().ConvertAll <Book>((Publication p) => new Book()
                {
                    Id = new long?((long)p.Id)
                });
            }
            else
            {
                books.Add(new Book()
                {
                    Id = new long?((long)-1)
                });
            }
            return(this._communityDac.GetAll(books, pageNumber, pageSize, sortBy, orderBy, filter, out totalCount));
        }
        public static CommunityForGridVm GetLastCommunityForGrid(int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter)
        {
            int totalCount;

            return(CommunityBc.Instance.GetAll(pageNumber * pageSize, 1, sortBy, orderBy, filter, out totalCount).FirstOrDefault().MapToCommunityForGridVm());
        }
Exemple #9
0
        public List <Community> GetAll(List <Book> books, int?pageNumber, int?pageSize, CommunityGridSortByOption?sortBy, OrderBy?orderBy, CommunityGridFilter filter, out int totalCount)
        {
            pageNumber = pageNumber ?? ConfigurationManager.Instance.DefaultGridPageNumber;
            pageSize   = pageSize ?? ConfigurationManager.Instance.DefaultGridPageSize;
            GetCommunityGridCommand command = new GetCommunityGridCommand(books, pageNumber.Value, pageSize.Value, sortBy, orderBy, filter);

            command.Execute();
            totalCount = command.GetTotalCount();
            return(command.CommandResult);
        }