473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

winforms design suggestions / help

Hello, I'm working on a winforms app that will be used in stores in
different states and each state can have different data capture
requirements. I want to create a base form for for all the common
data and wish to use visual inheritance to subclass the different
forms that need to capture specific data for each state - but I don't
want to have 50 different subclasses. And I don't want to have a huge
IF statement saying IF NY activate this field, IF FL activate that
field, etc.

Any suggestions on the best way to go about doing this would be
appreciated.

TIA
G
Sep 26 '08 #1
6 1183
You need to do some analysis on the needs and find the common points. You
will likely find you can work either with a few subclasses, as states group,
or with groups of classes attached to the main class.

If your business does not give time for analysis, you can start with 50
classes and refactor down. If you business will not give time for
refactoring, you are in trouble.

As for the UI, you can create a more dynamic UI that reads the classes, so
you do not need 50 UIs.

BTW, this is always a pain.

The other method is to set up custom fields that can store any old crap you
want. This is common with configurable systems. I would rather do the
analysis and add a few custom fields for the business than adopt this
methodology.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"GiJeet" <gi****@yahoo.comwrote in message
news:15**********************************@d70g2000 hsc.googlegroups.com...
Hello, I'm working on a winforms app that will be used in stores in
different states and each state can have different data capture
requirements. I want to create a base form for for all the common
data and wish to use visual inheritance to subclass the different
forms that need to capture specific data for each state - but I don't
want to have 50 different subclasses. And I don't want to have a huge
IF statement saying IF NY activate this field, IF FL activate that
field, etc.

Any suggestions on the best way to go about doing this would be
appreciated.

TIA
G
Sep 26 '08 #2
>On Sep 26, 5:50*pm, "Cowboy \(Gregory A. Beamer\)" <NoSpamMgbwo...@comcast.netNoSpamMwrote:
>As for the UI, you can create a more dynamic UI that reads the classes, so
you do not need 50 UIs.
Cowboy, when you say "dynamic UI" do you mean build the form on the
fly at runtime?
Sep 26 '08 #3
OD
>On Sep 26, 5:50*pm, "Cowboy \(Gregory A. Beamer\)"
><NoSpamMgbwo...@comcast.netNoSpamMwrote:
>As for the UI, you can create a more dynamic UI that reads the classes, so
you do not need 50 UIs.

Cowboy, when you say "dynamic UI" do you mean build the form on the
fly at runtime?
I think that's what he was meaning. And I think it's a good approach
for the kind of problem you're speaking.
You can base your code on small user controls, each one doing a
specific data capture. The form is built at runtime using those
controls. The form layout can be stored in an xml file, each user
having its own one.

--
OD___
www.e-naxos.com
Sep 27 '08 #4
>On Sep 27, 1:57*pm, OD <webmaster @ e-naxos dot comwrote:
I think that's what he was meaning. And I think it's a good approach
for the kind of problem you're speaking.
You can base your code on small user controls, each one doing a
specific data capture. The form is built at runtime using those
controls. The form layout can be stored in an xml file, each user
having its own one.
Seems like a good idea but maybe a little too advanced for me. Is
there any code or examples anywhere that I can read and follow?

TIA
G
Sep 28 '08 #5
OD
Seems like a good idea but maybe a little too advanced for me. Is
there any code or examples anywhere that I can read and follow?
I do not know if there's a full tutor on this subject on the web, you
can try google of course.
But this is not very difficult. In VS it is very simple to build a user
control, so just try to build one to understand the process (and you'll
find a lot of tutors about building user controls on the web).
Once you know how to write a UC, you can write tons of them..
Then, it is not very difficult to read an XML file containing a form
layout, each entry will have the class name of the control and the X,Y
position. A simple loop that creates each UC on the fly will make the
job.
Of course, all depends on your skill. As we can't write the code for
you, the best is trying to write it by yourself and come here again and
again if needed with some precise questions and will try to help each
time...

--
OD___
www.e-naxos.com
Sep 28 '08 #6
>On Sep 28, 10:47*am, OD <webmaster @ e-naxos dot comwrote:
Seems like a good idea but maybe a little too advanced for me. *Is
there any code or examples anywhere that I can read and follow?

I do not know if there's a full tutor on this subject on the web, you
can try google of course.
But this is not very difficult. In VS it is very simple to build a user
control, so just try to build one to understand the process (and you'll
find a lot of tutors about building user controls on the web).
Once you know how to write a UC, you can write tons of them..
Then, it is not very difficult to read an XML file containing a form
layout, each entry will have the class name of the control and the X,Y
position. A simple loop that creates each UC on the fly will make the
job.
Of course, all depends on your skill. As we can't write the code for
you, the best is trying to write it by yourself and come here again and
again if needed with some precise questions and will try to help each
time...
OD, I don't think I'd have trouble with the code itself, just trying
to get the whole concept in my head. So, you use a User Control that
contains code that reads an xml file that describes the form layout?
I guess I'm not following how that works. Is there a name to this
concept that I can google? Or better yet, if you could send me a few
links to follow that would be great. Thanks!!
G

Oct 1 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mahesh Kumar.R | last post by:
I'm into designing an application in winforms but in near future my client may request the same thing in webforms. so (1) what are all the design guidelines and ways are there to migrate easily in...
5
by: brian.wilson4 | last post by:
Our group is currently comparing winforms vs webforms.....app is Corp LAN based - we have control of desktops.....Below is pros and cons list we have come up with - if anything strikes you as...
5
by: Bit byte | last post by:
Can I use C# (Winforms) to design a website?. I am from C/C++ background but know nothing about Internet programming. My understanding of WebForms are that they are similar to WinForms in that...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.