I’m trying to determine the best way to give my users different CRUD pages for a single table. Using the Entity Data Model seems wisest, but I’m unsure how to make the best use of it. That usually means it’s time to hit the forums.
The database table is called ta_measurement:
CREATE TABLE [dbo].[ta_measurement](
[MeasurementId] [bigint] IDENTITY(1,1) NOT NULL,
[ProjectId] [bigint] NOT NULL,
[StrategyId] [bigint] NOT NULL,
[MeasurementType] [int] NOT NULL,
[Status] [int] NOT NULL,
[Settings] [int] NOT NULL,
[MeasurementDate] [datetime] NOT NULL,
[MeasurementTitle] [nvarchar](64) NULL,
[MeasurementScore] [float] NOT NULL,
[MeasurementOutcome] [nvarchar](64) NULL,
[Version] [int] NOT NULL,
[Notes] [ntext] NULL,
I have about 30 different ways users expect this table to appear/behave. For example, in the case labeled PH1a, the user only needs to check a box (did they meet the requirement or not?) and some notes:
With that information, I want to compute the measurement fields:
Measurement_type = 1;
Measurement_score = 0 (or 1, if the box is checked)
Measurement_outcome = “Provider does meet with families?” [or not, depending on the checkbox]
etc.
I’d like advice on the most efficient way to accomplish this? Can/should I do this in the data layer somehow? It seems to my untrained eye like it belongs on the presentation layer.
Other ideas include: Is this best accomplished within the Entity Data Model Designer? Should I map using stored procedures?
I don't understand what you really want……From your description it seems that you wanna use one way to show differnt kinds of Tables……So How?Can you tell us what aim you wanna achieve and maybe we can change to another way……
I'm sorry I wasn't clearer about that. What I need is the opposite. I have one table that I need to show many different ways.
In addition to the PH1a example I included are PH2a (different value in type field), PH2a (different value for settings field), etc. They all get stored in the ta_measurement table, but only need 1 or two data from the user.
I think I just wan to 'map' a couple dozen different entities to the same table, but can't figure out how to make this fit the inheritance examples (Table Per Type and Table Per Hierarchy).
I've figured out how to prototype what I'd like to do. I'll illustrate below with the 'base' class (maps directly to ta_measurement) and a an 'object' of the derived (PH1a) class.
<input id="ContentPlaceHolder1_FormView1_ctl04_ctl02___MeasurementTitle_TextBox1" class="DDTextBox" title="Enter a unique title for this measurement" name="ctl00$ContentPlaceHolder1$FormView1$ctl04$ctl02$__MeasurementTitle$TextBox1" maxlength="64" size="64"
type="text" />
*
*
*
</div> <div> </div> <div>Which is more than they want or need. I'd rather let them browse to, e.g.,
http://localhost:61218/PH1a/Insert.aspx, for a much simpler form:</div>
</div> <div> </div> <div>Which would populate the rest of the ta_measurement record based on business rules specific to PH1a. I could then create similar 'classes' for the other 20+ cases, i.e., PH1b, PH2b, TL1a and their 'brethren.'</div> <div> </div> <div>I'm
look for the most efficient way to accomplish this using Dynamic Data Entities. Does this make more sense than my original text?</div> <div> </div> <div>TIA</div>
None
0 Points
13 Posts
Dozens of web forms for the same table
Jun 22, 2012 11:59 AM|pwmfs33|LINK
I’m trying to determine the best way to give my users different CRUD pages for a single table. Using the Entity Data Model seems wisest, but I’m unsure how to make the best use of it. That usually means it’s time to hit the forums.
The database table is called ta_measurement:
I have about 30 different ways users expect this table to appear/behave. For example, in the case labeled PH1a, the user only needs to check a box (did they meet the requirement or not?) and some notes:
<input id="ContentPlaceHolder1_FormView1_ctl04_ctl01___health_contact_information_CheckBox1" value="on" checked="checked" type="checkbox" name="ctl00$ContentPlaceHolder1$FormView1$ctl04$ctl01$__health_contact_information$CheckBox1" />
With that information, I want to compute the measurement fields:
Measurement_type = 1;
Measurement_score = 0 (or 1, if the box is checked)
Measurement_outcome = “Provider does meet with families?” [or not, depending on the checkbox]
etc.
I’d like advice on the most efficient way to accomplish this? Can/should I do this in the data layer somehow? It seems to my untrained eye like it belongs on the presentation layer.
Other ideas include: Is this best accomplished within the Entity Data Model Designer? Should I map using stored procedures?
Thanks in advance for any suggestions.
entitydatamodel
All-Star
94130 Points
18109 Posts
Re: Dozens of web forms for the same table
Jun 23, 2012 10:29 PM|Decker Dong - MSFT|LINK
Hello :)
I don't understand what you really want……From your description it seems that you wanna use one way to show differnt kinds of Tables……So How?Can you tell us what aim you wanna achieve and maybe we can change to another way……
Reguards!
All-Star
17916 Points
5681 Posts
MVP
Re: Dozens of web forms for the same table
Jun 24, 2012 05:09 AM|sjnaughton|LINK
Hi pwmfs33, are you asking whether you should use Dynamic Data?
entitydatamodel
Always seeking an elegant solution.
None
0 Points
13 Posts
Re: Dozens of web forms for the same table
Jun 24, 2012 07:17 PM|pwmfs33|LINK
I'm sorry I wasn't clearer about that. I'm definitely using Dynamic Data, but unsure how best to use Dynamic Data.
entitydatamodel
None
0 Points
13 Posts
Re: Dozens of web forms for the same table
Jun 24, 2012 08:01 PM|pwmfs33|LINK
I'm sorry I wasn't clearer about that. What I need is the opposite. I have one table that I need to show many different ways.
In addition to the PH1a example I included are PH2a (different value in type field), PH2a (different value for settings field), etc. They all get stored in the ta_measurement table, but only need 1 or two data from the user.
I think I just wan to 'map' a couple dozen different entities to the same table, but can't figure out how to make this fit the inheritance examples (Table Per Type and Table Per Hierarchy).
All-Star
94130 Points
18109 Posts
Re: Dozens of web forms for the same table
Jun 24, 2012 09:00 PM|Decker Dong - MSFT|LINK
pwmfs33:)
Hello——
As far as I see,do you mean that you wanna show different kinds of UI with different kinds of tables using DD or do something else?
Reguards!
None
0 Points
13 Posts
Re: Dozens of web forms for the same table
Jun 24, 2012 09:21 PM|pwmfs33|LINK
I want to show different kinds of UI with the same table using DD.
Member
51 Points
53 Posts
Re: Dozens of web forms for the same table
Jun 25, 2012 04:26 AM|biga|LINK
Hi pwmfs33,
This may help with your requirement: http://dynamicdatalayout.codeplex.com/
All-Star
17916 Points
5681 Posts
MVP
Re: Dozens of web forms for the same table
Jun 25, 2012 09:29 AM|sjnaughton|LINK
Hi pwmfs33, you may find what you want on my blog here http://csharpbits.notaclue.net spcifically see Securing Dynamic Data 4 (Replay) this uses user detaisl to determin what each user can access i.e. read only read/write etc.
Always seeking an elegant solution.
None
0 Points
13 Posts
Re: Dozens of web forms for the same table
Jun 25, 2012 12:23 PM|pwmfs33|LINK
I've figured out how to prototype what I'd like to do. I'll illustrate below with the 'base' class (maps directly to ta_measurement) and a an 'object' of the derived (PH1a) class.
When the user browses to http://localhost:61218/ta_measurement/Insert.aspx, they'll get the full form:
Add new entry to table Measurement
<div style="display: none;" id="ContentPlaceHolder1_ValidationSummary1" class="DDValidator"></div> <div>Add new PH1a entry to table Measurement
<div id="ContentPlaceHolder1_UpdatePanel1"> <div style="display: none;" id="ContentPlaceHolder1_ValidationSummary1" class="DDValidator"></div>entitydatamodel