473,396 Members | 1,992 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,396 software developers and data experts.

How to I manipulate a form to satisfy to customer.

Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at a
different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.
//Tony


Feb 20 '06 #1
9 1266
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:mC*******************@newsb.telia.net...
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at
a different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.


Use an If statement.

Michael
Feb 20 '06 #2
You could store profiles as serialised objects in your data store.
The profile object could contain descriptive information for each
control such as xy location, if its visible or not, color, size, etc.

Feb 20 '06 #3
You could store profiles as serialised objects in your data store.
The profile object could contain descriptive information for each
control such as xy location, if its visible or not, color, size, etc.

Feb 20 '06 #4

"Michael C" <no****@nospam.com> wrote in message
news:OA**************@TK2MSFTNGP15.phx.gbl...
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:mC*******************@newsb.telia.net...
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls
at a different place then the other customer. In addition want to add
another control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these
problems but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.


Use an If statement


Ha ha.

Create an interface with properties, methods and events for the logical form
content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.
Feb 22 '06 #5
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:3e*******************@fe2.news.blueyonder.co. uk...
Use an If statement
Ha ha.


I'm not sure why you find that funny, the differences for the 2 customers
are very minor so just have an if statement to implement the different
functionality.
Create an interface with properties, methods and events for the logical
form content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.


The OP stated he wanted to do this without creating 2 forms as they are
almost identical.

Michael
Feb 26 '06 #6
1. Create a generic UI container.
2. Use an external definition (serialized format) to describe the dialog.
3. You also need to describe the events of the dialog items as you crate
them, so you can act upon these events.

Not a simple task. I have seen it done before, in other languages, using
XML.

J

On Mon, 20 Feb 2006 21:35:14 +0000, Tony Johansson Woke up an had these
words of wisdom to grace the world.:
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at a
different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.
//Tony


Feb 27 '06 #7

"Michael C" <no****@nospam.com> wrote in message
news:OI**************@TK2MSFTNGP14.phx.gbl...
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:3e*******************@fe2.news.blueyonder.co. uk...
Use an If statement
Ha ha.


I'm not sure why you find that funny, the differences for the 2 customers
are very minor so just have an if statement to implement the different
functionality.


I honestly thought it was supposed to be funny.

I think it is probably safe to say that the OP had already thought of using
an IF statement.
Create an interface with properties, methods and events for the logical
form content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.


The OP stated he wanted to do this without creating 2 forms as they are
almost identical.


I thought that what he was trying to do was break a mutual dependency
between 2 forms in 2 dlls but since I haven't got the original anymore I
can't say that you are wrong.
Feb 28 '06 #8
Don't any of you realise that this whole thread is redundant?

We all know its not possible to satisfy a customer....

Feb 28 '06 #9
"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
Don't any of you realise that this whole thread is redundant?

We all know its not possible to satisfy a customer....


Bribery? :-)
Mar 1 '06 #10

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

Similar topics

17
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now...
3
by: jquest | last post by:
I have a database about services and installations as well as warranty and services for a company I run. The main form is the customer info form. On this I record names, address and phone numbers....
4
by: sara | last post by:
I am learning with a simple application/form. I am ok - enter customer name, list box of customers, select a customer, see the items for that customer. The items form has customer ID and Name...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
3
by: Brad McMillan | last post by:
Hi: I have MS C# 2005 Express Edition and I'm trying to pass a string to a new form in my project. First I created the form, Customer, with a textbox, "textBox1", and declared a string...
2
by: rpjd | last post by:
I am trying to submit entries in a form to a database. I am using " within my submission form and $_POST I am getting the connection to the database but I my script is not executing,...
1
by: info | last post by:
I have a database for producing quotations for customers. I have a Quote Header table and a related Quote Detail table. There is also a Customer table to store the customer details. To produce a...
3
by: timothyriggs | last post by:
Building a CRM in Access 2007 with a MySQL backend. Have several objects defined, one of which is the Customer object, another is the Jobs object. The Customer object has a collection of Jobs...
6
by: CJONES | last post by:
I have a main form and use a combo box to open a pop up form. The combo box lists customers and only one customer requires the fields that are found on the pop up form. I can get the form to pop...
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: 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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.