Page 1 of 1

Yo, Zorro

PostPosted: March 14th, 2014, 1:11 pm
by Bullet Magnet
About that design we discussed last night...

I set up my tables as you suggested (see the attached model). However, I'm confused on how you would associate a credential with a "row" of data, i.e. an account. Since each credential is its own entity and not an attribute of an account entity, I don't see how you would relate them with this setup.

My assumption is that I still need an account entity. One account can have many credentials. This would allow each instance of an account to vary based on the category (and thus the columns). The GUI would be dynamic, i.e. the input fields are adjusted based on what columns the user adds/deletes. Allowing the user to submit entries directly in the DataGrid would probably be the best way to enable this.

What say you of my assumption?

Re: Yo, Zorro

PostPosted: March 14th, 2014, 10:33 pm
by Zorro
Opps. Yea, you'll need an account record. I can't believe I missed that! It helps when the code knows what "row" each value is supposed to be on. Sorry if I confused you.

:oops:

Anyways, here's a complete schema of that should work and get you started. As a side note, be careful with using certain names, as some RDMS engines have "column" as a reserved keyword. Here's a list I use to help me avoid any reserved keywords; it's best practice to avoid reserved keywords even if they're not reserved in the particular RDMS engine you're using.

credential_categories

id (int) | record_name (varchar) | display_order (int) | created (timestamp) | modified (timestamp)

credential_columns

id (int) | category_id | record_name (varchar) | display_order (int) | created (timestamp) | modified (timestamp)

credential_accounts

id (int) | category_id (int) | created (timestamp) | modified (timestamp)

Note: You won't need a "display_order" value for the account rows since you'll likely have ASC and DESC alphabetical sorting for each column, and obviously that would determine the order in which each account row is displayed.

credential_values

id (int) | account_id (int) | column_id (int) | record_value (varchar) | created (timestamp) | modified (timestamp)

Re: Yo, Zorro

PostPosted: March 15th, 2014, 12:38 am
by Bullet Magnet
Exactly what I was thinking, thanks. No problem on leaving it out. I was happy that I came up with the solution and just needed some verification.

Re: Yo, Zorro

PostPosted: March 26th, 2014, 12:56 pm
by Bullet Magnet
Grrrr.

I am going back to hardcoding the fields. I give up. You win, C#.

The back-end implementation of this was easy. The front-end was a monster.

Re: Yo, Zorro

PostPosted: March 26th, 2014, 1:01 pm
by Bullet Magnet
Zorro, do you use any web controls similar to the DataGridView used in PassShed?

Perhaps sharing thoughts on how you would implement the front-end of this would help me.

Re: Yo, Zorro

PostPosted: March 26th, 2014, 3:46 pm
by Bullet Magnet
Well, we're getting somewhere.