Пример #1
0
        public IActionResult SingleLoadRecords(string lookupControlId, string entityName, string primaryKeyName, string queryCol, string title, string search = "")
        {
            SingleLookupControlModel lookupModel = new SingleLookupControlModel();
            TableRecord record = Lookup.LoadTableRecords(_context, entityName, primaryKeyName, queryCol, search);

            lookupModel.Title           = title;
            lookupModel.LookupControlId = lookupControlId;
            lookupModel.PrimaryKeyName  = primaryKeyName;
            lookupModel.QueryCol        = queryCol;
            lookupModel.EntityName      = entityName;
            lookupModel.Records         = record;
            return(PartialView("_LookupRecord", lookupModel));
        }
Пример #2
0
        public IActionResult LookupRecord(string lookupControlId, string title, string entityName, string primaryKeyName, string columnSet, string recordId)
        {
            string[] columns   = columnSet.Split('#');
            string[] tableCols = columns.Select(s => s.Replace(":", " ")).ToArray();

            string queryCol = string.Join(',', tableCols);

            var record = Lookup.LoadTableRecords(_context, entityName, primaryKeyName, queryCol, string.Empty, recordId);

            SingleLookupControlModel model = new SingleLookupControlModel
            {
                LookupControlId = lookupControlId,
                Title           = title,
                Records         = record,
                QueryCol        = queryCol,
                EntityName      = entityName,
                PrimaryKeyName  = primaryKeyName
            };

            return(PartialView("_LookupRecord", model));
        }