Solved

what would an Expert do?

Posted on 2011-09-30
2
290 Views
Last Modified: 2012-05-12
i'm writing a customer support app (vs 2010\vb.net\mysql) for my company. it's very straightforward, get customer details and populate a bunch of controls - txt fields, listboxes, etc. there's also a bunch of transactional functionality through buttons. never having written, or worked with, a customer support app before, i made the mistake of having the app work only with a single customer at a time. but now there's a need to work with more than one customer - identical data (but for diff customers), identical functionality.

my question is this: what is the best way to manage this kind of identical duplication of data\functionality? basically, i simply created a tab control and put all the original controls on tab page one, and then made a copy of them on tab page two and renamed them from txtCustomerName --> txtCustomerName2, txtCustomerID --> txtCustomerID2, etc. then, i just set a flag recording what tab page i'm on, and all the code behind behaves according to the flag. The problem with this is that i've basically doubled the amount of code i have,

if i'm on tab page 1 then

      do this

elseif i'm on tab page 2 then

      do this

end if

is there a better way to manage these types of more-or-less identical collections of controls\functionality? for example, i'd like to put even a couple more tab pages on my tab control and let them have 3 or 4 different customers open at the same time, but i'm sure i'm not handling this problem in the best way.

any advice is greatly appreciated...

TIA,

crafuse
0
Comment
Question by:crafuse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 36892669
I would rather go for a MDI (Multiple Documents Interface) type of interface. This is the same system used by Word and Excel so that you can open multiple document at the same time.

That would enable the user to see both customers at the same time on the screen. And as an extra, without doing any thing special, the user will be able to display as many customers as he wants. Another extra. Since you will be reusing multiple copies a the same form and each form is individual, you won't have to make the difference between TextBoxName1 on the first tab and TextBoxName2 on the second tab. Each form with handle itself from a shared code base.

Create a Form with the display you intended to put in a tab. This will create what we will refer to as a child form, so let's call it FormChild.

Create another form. That will be the MDI, so call let's call it FormMDI. In that form, set the IsMdiContainer property to True.

Add a button or a menu to FormMDI with the following code:
Dim frm As New FormChild
frm.MdiParent = Me
frm.Show()

Open in new window

Startup the application in FormMDI.

Each time the use activates the button or the menu, a new copy of FormChild will open inside of the MDIForm.

Have fun.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 36892698
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question