I've been getting help cleaning up jQuery code related to the project I've inherited (LeakIM, Julian, Chris, you guys know who you are :))
Now, I'm moving to the C# and SQL code part of it. There's so much code. I really can't believe how much code this guy wrote (my manager said the developer might have copied all this from another project from another job).
Anyway, I'll go step by step and I hope I can get some guidenace on how to proceed OR maybe I should keep the code as is....
1. We have a page that creates dynamic report; user enters a report name
, selects columns,
, selects groupby or orderby
and selects when to send the report...schedules the report.
This is some screenshots of how the page looks like
2. Code gets all the info and keeps them in a Model. The "columns", "where" clause...the SQL statement is built in the C# code.
3. This is how the information is saved in the database. This is where I don't know if this is a good design or not.
The columns, report parameters, the SQL statement and the report object itself are saved in the database. Indivdual options , for example, individual columns are not saved in separate rows per user per report.
I need to wrap my head around this. I've never done a dynamic reports project.
1. Is it ok to save the data like that and then read it back?
2. Should I change the design to have a separate table for each tab
(for report name, report columns, report parameters, etc)?
3. I think if I have a table for "report columns", the table will have multiple rows per report per user. Then, I have to read back the column names and concat them? so maybe having the column name saved in one field is ok?
4. This goes back to #2 and #3. If I have separate tables and fields for each tab...then I need to have a stored proc to read all the tables/fields and create the where clause and columns and etc to bring back results.
Any ideas would be great. I know this is a long question.