Hi guys,
I am a supporter turned sysadmin who is now turning developer. I am currently starting work on my first app, and it wanted to make this post to ask for your advice and guidance.
Now, I could figure most of this out for myself, or ask some colleagues, but posting this gives a number of boons. First, writing things down is a great way to organize one's thoughts. Second, your guy's opinions might differ from my collegues', thus lessening group thinking. Third, other aspiring programmers might find this interesting as well.
So, here is my task:
We have a document handling system with a lot of features. One of them is creating document types, thus enabling customers to organize templates easier. So, for instance a .docx document can be of ducoment type Letter to Government, type Schedule, type Letter to Customer, and so on. A .xlsx sheet can have type Budget for IT, type Budget for HR, etc. You get the point.
Another feature is enabling the customers to upload documents by drag and drop. When they do this, the document type is assigned a default type. This default type is controlled by a boolean in the database. Thus, the customers can set that all .docx documents are by default uploaded as Letter, all .xlsx documents as Generic Excel 2010 - whatever.
Now, the administration module has in the past allowed the default document type boolean to be set to True for any number of documenttypes with the same extension. On top of that, the admin module did not really tell what setting a document type to default actually did. As as a result, our customers has set the default document types all over the place. This menas that drag n' dropping a .docx document might for instance by default upload the document as type List of Christmas Presents for Customers. Not good.
I can change it ie the database with some simple SQL, ie:
but I would rather make an application for it.
As I see it, I need four parts.
1. The UI. WinForms or WPF?
2. Something to handle the database connection. I can get it from a bunch of config files which is referred by an environment variable. I think I can figure this out. It makes sense to make this part into a separate class, right?
3. Selecting and presenting the data. The select is straight forward, but presenting it is harder. Is there a built in list view in C# which presents data in a tree form? Like this:
Extension
--Documenttype
--Documenttype
--Documenttype
Extension
--Documenttype
--Documenttype
4. A way to make the user select which types to keep as default and write it to the database. I imagines a radio button type which enables the user to select only one documenttype from each extension. It would then be relatively simple, I hope, to update the database.
So, opinions and advice? What do you guys think?
I am a supporter turned sysadmin who is now turning developer. I am currently starting work on my first app, and it wanted to make this post to ask for your advice and guidance.
Now, I could figure most of this out for myself, or ask some colleagues, but posting this gives a number of boons. First, writing things down is a great way to organize one's thoughts. Second, your guy's opinions might differ from my collegues', thus lessening group thinking. Third, other aspiring programmers might find this interesting as well.
So, here is my task:
We have a document handling system with a lot of features. One of them is creating document types, thus enabling customers to organize templates easier. So, for instance a .docx document can be of ducoment type Letter to Government, type Schedule, type Letter to Customer, and so on. A .xlsx sheet can have type Budget for IT, type Budget for HR, etc. You get the point.
Another feature is enabling the customers to upload documents by drag and drop. When they do this, the document type is assigned a default type. This default type is controlled by a boolean in the database. Thus, the customers can set that all .docx documents are by default uploaded as Letter, all .xlsx documents as Generic Excel 2010 - whatever.
Now, the administration module has in the past allowed the default document type boolean to be set to True for any number of documenttypes with the same extension. On top of that, the admin module did not really tell what setting a document type to default actually did. As as a result, our customers has set the default document types all over the place. This menas that drag n' dropping a .docx document might for instance by default upload the document as type List of Christmas Presents for Customers. Not good.
I can change it ie the database with some simple SQL, ie:
Code:
select * from dbo.documentTypes where isDefault = true order by docExtension
update dbo.documentTypes
set is Default = false where docExtension = docxForExample and documentTypeID <> whaterverTheCorrectDIsTheCorrectOne
but I would rather make an application for it.
As I see it, I need four parts.
1. The UI. WinForms or WPF?
2. Something to handle the database connection. I can get it from a bunch of config files which is referred by an environment variable. I think I can figure this out. It makes sense to make this part into a separate class, right?
3. Selecting and presenting the data. The select is straight forward, but presenting it is harder. Is there a built in list view in C# which presents data in a tree form? Like this:
Extension
--Documenttype
--Documenttype
--Documenttype
Extension
--Documenttype
--Documenttype
4. A way to make the user select which types to keep as default and write it to the database. I imagines a radio button type which enables the user to select only one documenttype from each extension. It would then be relatively simple, I hope, to update the database.
So, opinions and advice? What do you guys think?