Need a very basic responsive website to handle listing a table of records and then updating the record detail
2 sample pages will provide to give you some idea of what I looking for.
using c#.net and mssql
[Welcome page]:
Welcome -
on [Continue] - collect the [NT Userid] or optional username/password and call [object listing page]
create [object listing page]:
accept [NT Userid]
get list of rows from MS SQL database query 'Select name, description* from tablename' (use any tablename, any column names)
whole page is basically a FORM.
build table - no fancy stuff needed here - returning whole html form with table embedded
first colum contains button (with some actionId and recordID to enable original record to be found) to get detailed data and returns to [Object Detail page]
create [Object Detail page] from [object listing page] button press:
accept [NT Userid]
accept values from [object listing page] button press
get template of html based on actionID returned('select html' from htmltemplate where templateid = xx')
whole page is basically a FORM.
get detailed record data based on recordID returned - 'Select * from tablename where value1 = columnname' (any names will work here)
pass thru all fields in detailed record replacing '%columnname%' in template with contents of that field in the detailed record
(you can get a list of the columns and column types from something like this:
SELECT column_ordinal, name, system_type_name,max_Length,scale FROM sys.dm_exec_describe_first_result_set('select * from Persons', NULL, 0) )
add [Save] button
return HTML
returned [Object Detail page] from [Save] button press on [Object Detail page]:
parse thru all values returned,
and for each value returned, execute sql 'update tablename set retrunedcolumnname = retrunedcolumnvalue where id = xx'
The columnname / value pairs are found by trolling thru the returned fieldname/value pairs
for example -
'Admit_Date' is the column name and value of control is the value
return to create [object listing page]
There are 3 tables involved, a ListingTable,a Templatetable, and a Detailtable
Listing Table
- table name will be embedded in the [Welcome page] and then carried into the [object listing page] & [Object Detail page].
- table will be used to populate the [object listing page], based on the credentials of the person logging in - I will add that to the SQL later.
- [object listing page] will be populated from a list of the records from 'Select name, description* from ListingTable where Userid = xx'
- get detailed record data based on recordID returned - 'Select * from tablename where value1 = columnname' (any names will work here)
Template Table
The Template table is called HTMLTemplates, records will have an ID to identify the template.
- Colums will be TemplateID bigint, DataTableToUse varchar(50), HtmlTemplate varchar(max)
- template to use will be identified by the button on [object listing page], which will also identify the detail record to retrieve.
A template will reference only one table, but there may be multiple templates for that table.
Detail Table
The Detail table name will be embedded in the template Record, and can be retrieved from there.
Populating the Template from the DetailTable
get template record data based on templateID returned
- 'Select HLMLTemplate,DataTableToUse from HTMLTemplates where TemplateID = (TemplateId value returned from [object listing page] button press
get detailed record data based on recordID returned
- 'Select * from tablename where DetailRecordId = ListingTable value returned from [object listing page] button press
pass thru all fields in detailed record replacing '%columnname%' in template with contents of that field in the detailed record.
note that not all columns will exist in the template - ignore those.
(you can get a list of the columns and column types from something like this:
SELECT column_ordinal, name, system_type_name,max_Length,scale FROM sys.dm_exec_describe_first_result_set('select * from Persons', NULL, 0) )
Supply validation procedures based on the datatype that the value represents. Let me know how to hook into that via the template so that I can generate those correctly
Updating the database
get the returned recordid and templateid
get the DataTableToUse name from the template table
-'Select DataTableToUse from HTMLTemplates where TemplateID = (TemplateId value returned )
parse thru all values returned,
and for each value returned, execute sql 'update tablename set retrunedcolumnname = retrunedcolumnvalue where id = xx'
The columnname / value pairs are found by trolling thru the returned fieldname/value pairs
for example -
'Admit_Date' is the column name and value of control is the value
About the recuiterMember since Nov 11, 2022 Prince Singh
from Uttar Pradesh, India