Esempio n. 1
0
        public ActionResult Query(int moduleid, string modulename, int?id)
        {
            var doverApi = new ModuleApi(ModRepository);

            var module = ModRepository.GetModuleById(moduleid,
                                                     m => m.Fields.Include <Field, FieldDataType>(f => f.FieldDataType),
                                                     m => m.Rows.Include <Row, Cell>(r => r.Cells));

            var data = doverApi.GetModuleData(module, id, Request.QueryString);

            ModRepository.IncrementModuleRequestCount(module.Id);

            return(View(data));
        }
Esempio n. 2
0
        public ActionResult modules(string moduleid)
        {
            var dataList = new DynamicModuleApiResultList();

            if (!String.IsNullOrWhiteSpace(moduleid) &&
                Request.QueryString.Count == 0)
            {
                var doverApi = new ModuleApi(ModRepository);

                string[] ids = moduleid.Split(",".ToCharArray());

                foreach (var id in ids)
                {
                    int nid;
                    if (!Int32.TryParse(id.Trim(), out nid))
                    {
                        continue;
                    }

                    var module = ModRepository.GetModuleById(nid,
                                                             m => m.Fields.Include <Field, FieldDataType>(f => f.FieldDataType),
                                                             m => m.Rows.Include <Row, Cell>(r => r.Cells));

                    if (module == null)
                    {
                        continue;
                    }

                    dataList.Add(doverApi.GetModuleData(module, null, Request.QueryString));

                    ModRepository.IncrementModuleRequestCount(module.Id);
                }
            }

            return(View(dataList));
        }