Architecture :: How To Represent Scenario In A Relational Database
May 26, 2010
i'm new with design patterns and i'm not sure if in this situation i can use a composite pattern.
The scenario is a web application for an address book : the address book cointains AddressBoookItem, generalization for Contact and ContactGroup. The last one is the composite object containing a collection of AddressBoookItem.
With these scenario i'm sure that this is a composite pattern, but what is confusing me is that a contact may belong to many contactgroup. Does this request change the situation? Till now i thought that between the Leaf object and the Composite (in the composite pattern) there was a 1-to-m relationship (a composite may contains many leaf but a leaf is contained in only one composite object). Can i still use the composite pattern ? And, the last question,
How could i represent my scenario in a relational database? One table for the entire hierarchy or two table (Contact and ContactGroup) with a m:n relationship between them ?
I have successfully used resources to translate my UI and I am now moving on to allowing the ability for the admin to translate database content.I'm looking for video tutorials / docs on database structure for localised info and how to retrieve localised data using stored procedures based on the selected culture.
I have detailsview with a SQLDataSource to 1 table (City) and am referencing another table (Unit) for one if it's fields.
[code]....
I changed the Unit Code (City Table) field into a template field and am using a dropdownlist item to reference the Unit Name from the (Unit Table) with the CityTable.Unit Code = UnitTable.Unit Code. However when I go into the update and change the dropdownlist item to another Unit Name it is keeping the original Unit Code value or it might even be selecting the first value from the dropdownlist item.
I am building a web based insurance application with VS 2008. Using the web wizard to enter newly created policy data and related information.My question is how to handles relational data in the wizard and saving that back to the database.A general idea of the setupEach policy can have multiple policy periodsEach policy period can have multiple sections and multiple policy feesSO The new wizard allows for a single policy entry, then we move to enter the policy periods. Which can be one or many per new policy, then we move to the sections and fees which can be ne or many per policy period.Each part is a step on the wizard. Policy, Period, Sections, Fees.The multiple entries are handled with an aspxgridview.NO problem in entering the data and completing the wizard, except when it comes to actually saving the data.Saving the policy and policy period information is easy because I can get the policyID value and assign that to each policy period.Problem comes in when I save the period child info. Because I can have multiple periods, I can't determine which child data (Sections and Fees) belong to which period so as to get the period ID.What process would you suggest, and how can I achieve this.I have thought of only allowing period entry per new policy. This will certainly solve the problem in a way, but does not conform to business rules.
I am having serious performances issues with gridview + tabs. Its very slow.. I was thinking to create a XML based logical layer between my database and UI.
1) Will it be useful if i use webservice to get data from database to poppulate gridview?
I'm a novice developer writing an ASP.NET application with VB. I'm having a little trouble getting my head around the partial class concept. If you use the partial classes as a code-behind for the presentation, how would these be represented in UML, in particular with a class diagram?
I'm using a text box in a template field to perform an insert with an object data source. What exactly does the "ProductID" refer to in this example? Is it the column in the db or the business object?
I have this SQL Select statement to select the basket id where the user id equals a specific ID.I want to store the result of the query in a variable, so I thought I could have done:
BasketPage.SelectCommand="SELECT BasketID FROM tblBasket WHERE (UserID = '9f96bd94-91b9-4328-8214-4eac179c3a26')" var BasketID = BasketPage.ExecuteScalar().ToString();
But apparently I need to create a new instance of an SQL Command for it to work, how can I do this for the BasketPage Select Command?
how to create C# classes to represent one to many relationships in C#. I have a Customer and an Address table in my database. I also have a Customer class in my C# solution but how do I introduce the multiple address element? Do I have a separate Address class? Do I create a subclass in the Customer class or create a method in Customer called GetAddresses of type List which contains all of the relevant logic? In my code I need to be able to return a customer with all associated addresses and I just cannot picture the best way to achieve this using OOP.
I was looking to build an application with the scenario:
1. The application is a Shared PowerPoint Presentation
2. There would be 2 users for the application, Admin and Client
3. Admin can upload presentations
4. Only Admin can control the flow of presentation and cLient can just see the changes
5. As-In Admin can select next slide or previous slide and correspondingly Client configuration changes
I was thinking of updating current values in Database and using AJAX for updates on Client end. But I want a notification kinda thing that would notify the Client as soon as the Admin changes slides.
I have asp.net page which having the drop down control with Product list. in database my Product Table has fields as ProductId, Product Name and Price. where as I have filled this drop down control by this method:
Which is working perfect. But i want to get selected product Price value on client side. for that I don't want round trip at server to get that. is any property of dropdown control other than DataTextFeild Or DataValueField to hold the Price Field of product ? so that i would avoid to go back at server. Or suggest any remedy for the same.
i have 2 dropdownlist and gridview. Im trying to make a link after displaying the relational data in the gridview like below But how can i get the value and combine with the link
I need to design a system that will control access to certain information. The requirement from the user is to use access levels e.g.
Level 1 - Support Level 2 - Manager Level 3 - Senior Manager Level 4 - Department Head etc.
If a certain piece of information is marked as Level 1, then all roles should be able to view that piece of information. If it is marked as level 3, then only the Senior Manager and Department Head can view it, but the Manager and Support roles can't view it.
Questions
When I assign the access level to a piece of information, will I have to assign multiple roles to it in order for me to achieve this functionality? Is there a better way of doing this?
Currently I have a class that represents a document. This document needs to be displayed as HTML. I would like to have a method to call such as GetHTML() that would then call GetHTML() on any properties/sections of the document that needed to be rendered. I was initially thinking about using linq and XElement but am wondering if that may cause issues with certain tags in HTML. Would I better off using an HtmlTextWriter?
i am working on a social networking project using MVC2 visual studio, currently i am working on these two tables , post & comment. Each post can have many comments.i have created a post controller along with the related view , and it work well , now i want to add under the post a comment view, where a post can have many comments , i can add the comments on different view , but i need to have a post and under it to add many comments, so how i can do so?
another problem is that in the post table there is a field representing a rating, now i can add in the rating field 1, 2,3,4,5,etc, but i need this field to be viewed as a list having values from 1-5?
I am using ajax.beginform. i am inserting and updating records using ajax and showing the inserted or updated value in the div above the div containing form. I need to apply validtion on these values.what is the recomended validation framework for this scenario. i have problems pushing validation messages to the form as i can only update one div that is indicated in updatetargetid parameter of ajax.beginform and this value in my case is set to div displaying the updated/inserted data
In my application i want add record in database with the date. My need is that particular record should be deleted on a given date.Example: i have added one record on 1 Apr 2010 and it will be deleted on 25 Apr 2010.Any idea how to achieve this? I need a logic to delete that particular record automatically from the database on a given date. I am using MS SQL 2005.
Suppose we are building a web-based application to retrieve and enter information into a database. The user-interface invokes web services. Which architecture would use for the application.