Esempio n. 1
0
        public void OnGet()
        {
            SetBasePage();
            var query       = Request.Query;
            var objectIdStr = query["id"].ToString();
            var type        = query["type"];

            var p = new CollectionViewModelParameters();

            TreeList = viewService.GetTreeList(objectIdStr, type, p);
        }
Esempio n. 2
0
        public void OnGet()
        {
            SetBasePage();
            var query       = Request.Query;
            var objectIdStr = query["id"].ToString();
            var type        = query["type"];
            var autorefresh = query["autorefresh"];

            if (string.IsNullOrEmpty(autorefresh) == false)
            {
                IsAutoRefresh = true;
                Response.Headers.Add("Refresh", autorefresh);
            }
            RefreshUrl     = $"{ApplicationUrl}{Request.Path}?type={type}&id={objectIdStr}";
            AutoRefreshUrl = RefreshUrl + "&autorefresh=3";

            var p = new CollectionViewModelParameters();

            TreeList = viewService.GetTreeList(objectIdStr, type, p);
        }
Esempio n. 3
0
        public void OnGet()
        {
            SetBasePage();
            var query       = Request.Query;
            var type        = query["type"];
            var parentIdStr = query["parentId"];
            var parentType  = query["parentType"];

            var autorefresh = query["autorefresh"];

            if (string.IsNullOrEmpty(autorefresh) == false)
            {
                IsAutoRefresh = true;
                Response.Headers.Add("Refresh", autorefresh);
            }
            RefreshUrl     = $"{ApplicationUrl}{Request.Path}?type={type}&parentId={parentIdStr}&parentType={parentType}";
            AutoRefreshUrl = RefreshUrl + "&autorefresh=3";

            var param = new CollectionViewModelParameters();

            GridViewModel = viewService.GetGridViewModelForType(type, parentIdStr, parentType, param);
            GridViewModel.MainObjectTypeFullname = type;
        }
Esempio n. 4
0
        /// <summary>
        /// Zwraca kolekcję obiektów danego obiekt (id)
        /// </summary>
        /// <param name="collectionTypeName"></param>
        /// <param name="objectId"></param>
        /// <param name="objectType"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public override IQueryable <object> GetCollection(string collectionTypeName, string objectId, string objectType, CollectionViewModelParameters parameters)
        {
            int?id = null;

            if (!string.IsNullOrEmpty(objectId) && objectId != "null")
            {
                id = int.Parse(objectId);
            }

            string objectTypeStr = null;

            if (!string.IsNullOrEmpty(objectType) && objectType != "null")
            {
                objectTypeStr = objectType;
            }

            switch (collectionTypeName)
            {
            case "Cvl.DynamicForms.Test.TestPerson":
                return(people.Cast <object>().AsQueryable());

            case "Cvl.DynamicForms.Test.Address":
                return(addresses.Cast <object>().AsQueryable());

            case "Cvl.DynamicForms.Test.Invoice":
                return(invoices.Cast <object>().AsQueryable());

            case "Cvl.ApplicationServer.Logs.Model.LogElement":
                return(LogElements.Cast <object>().AsQueryable());

            case "Cvl.DynamicForms.Test.Logger":
                if (id == null)
                {
                    return(loggers.Cast <object>().AsQueryable());
                }
                else
                {
                    return(loggers.Where(x => x.ParentId == id).Cast <object>().AsQueryable());
                }
            }
            return(new List <object>().AsQueryable());
        }
Esempio n. 5
0
        /// <summary>
        /// Zwraca dzieci obiektu - dla obiektu hierarchicznego
        /// </summary>
        /// <param name="objectId"></param>
        /// <param name="type"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public override IQueryable <object> GetChildrenCollection(string objectId, string typeFullname, CollectionViewModelParameters parameters)
        {
            if (typeFullname == "Cvl.ApplicationServer.Logs.Model.LogElement")
            {
                if (string.IsNullOrEmpty(objectId))
                {
                    return(fileLogStorage.GetHeaders().Cast <object>().AsQueryable());
                }

                var log = fileLogStorage.GetLogElement(objectId);
                return(log?.Elements.Cast <object>().AsQueryable());
            }

            int?id = null;

            if (!string.IsNullOrEmpty(objectId) && objectId != "null")
            {
                id = int.Parse(objectId);
            }

            switch (typeFullname)
            {
            case "Cvl.DynamicForms.Test.Logger":
                return(loggers.Where(x => x.ParentId == id).Cast <object>().AsQueryable());
            }

            return(null);
        }