Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I am a newbie to C# and OOP.. I need some advice regarding my requirement..

1st Part:

There are persons who use mobiles, of many subscribers and also have many numbers in each subscribers.

If we consider the XML tags it would be

HTML
<persons>
    <personname1>XXX</personname1>
    <subscriber1>
        <subscribername>ABC</subscribername>
        <numbers>
            <one>123456</one>
            <two>123456</two>
            ....
            <twenty>20</twenty>
        </numbers>
    </subscriber1>
    <subscriber2>
        <subscribername>ABC</subscribername>
        <numbers>
            <one>123456</one>
            <two>123456</two>
            ....
            <twenty>20</twenty>
        </numbers>
    </subscriber2>
</persons>



Like this, there may be many Persons. Like the Numbers and Subscribers may change from one person to another.

and write the details to the XML.
2nd Part:

There is second part which reads back the XML and create programatically an UI to have labels as pertaining details of each person. There is also some details(a hex number) for each subscriber which i receive from UART through an interface, when we select each person and process him on the target device. .

By creating a sample XML file with the above mentioned details. I created programmatically the UI screen(Since the subscriber and Number varies from each person).I was also able to populate each person by selecting through LINQ. I used Tabcontrol under which the tab pages as the UI part of person. I had to use TabControl as my UART target responds to 4 different inputs, so each TabPage in TabControl may be used.

I somehow consider my implementation as rather getting complex. So, I need some fresh ideas.
If you are unclear of the requirements, please revert back. I would explain by responding to your questions..

The typical screenshot of UI is given below..
1. Input part
http://dl.dropbox.com/u/8573083/EnterPersondetails.jpg[^]

2. 2nd Part After Reading from XML
http://dl.dropbox.com/u/8573083/Part2.jpg[^]


Thanks.
Posted
Updated 7-Sep-11 6:04am
v3
Comments
GParkings 7-Sep-11 11:25am    
I formatted your XML for you to make it a bit easier to read. Whilst i was doing so i noticed a few issues with it with regards to being 'well-formed'. This is most likely a side effect of the CP editor but if this XML is derived from real data and you get parse errors on that take a look at your subscriber2 close tags and the spelling of 'two' :)

1 solution

Given the hierarchical structure of your data, have you considered a treeview control. This would retain the hierarchy and, if your application has other purposes than simply showing this data, save on screen realestate.

It might be useful to show screenshots of your UI
 
Share this answer
 
Comments
Mullaly11 7-Sep-11 12:05pm    
Thanks for the Response.. I have added the screenshot of the UI(for Input and Output) for reference..
GParkings 7-Sep-11 12:23pm    
sadly the my office blocks access to dropbox so i cant see the screenies. I'll take a look when i get home
GParkings 7-Sep-11 14:45pm    
wow, that first screenshot literally sent shivers down my spine!

sorry, that's not very constructive. how about this:

- does your user really need to edit 16 subscriber's data simultaneously? if not, consider revising the data entry screen to a single subscribers details along with a list/tree of records and some add/remove buttons. when a subscriber is selected in the list populate the controls with their data. This way you get a lot better use of your screen real-estate

- from what i gather of your requirements, each of those tiny textboxes is supposed to hold a mobile phone number. simply put, the data doesn't fit in your UI. In the UK at least, such numbers are 9 digits long, your textboxes will hold about 3

personally i would go for a treeview with the following structure in a left-aligned splitter panel defaulting to about 15-20% screen width with the remaining space used for controls that are contextual to treeview selection

person
-subscriber
--number
--number
-subscriber
--number
--number
person
-subscriber
--number
--number
-subscriber
--number
--number

in such a system each node type would set up different controls in the main part of the screen:

person - name, hex value and source entry
subscriber - number entry (a list of numbers with add/remove buttons and a single number entry textbox populated dependent on number selected in the list)
number - not selectable, this is purely for user reference and could be omitted due to the list shown when the subscriber is selected. It all depends on how often your user will need to simply view the data rather than edit it

I think you'd find such a UI easier to maintain and more intuitive to use :)
Mullaly11 7-Sep-11 21:35pm    
Thanks for the suggestions.. I actually felt something wrong with my approach as it was getting too complex..I actually had the Textbox[] for creating 16 instances. As suggested by you, i should use treeview structure. This will reduce the unncessary entries in the GUI, which will reduce my validation codes also.. Thanks Again..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900