Linking Forms Dynamically

  • Thread starter Thread starter JohnSouth
  • Start date Start date
J

JohnSouth

Hi

I'm developing a scheduling application (C#, Windows Forms, SQL Server)
that matches up engineers and sites. I've got one form that shows an
engineer and what sites he's visiting (EngineerView), and another that
shows a site and what engineer visits are planned (SiteView). Both are
made up from a number of ListViews that the user can Drag & Drop
between.

I'd like the user to be able to open multiple instances of EngineerView
and SiteView, and I want a change to one of them to be immediately
reflected in any of the others that show related data. For example if
I schedule Engineer A to Site B on Tuesday in an EngineerView then I
want any SiteViews for Site B to show Engineer A on Tuesday.

My question is what's the best way to achieve this? My idea so far is
to create a central public array that they all update. Would this work?
Can anyone suggest an alternative?
Also I'm not sure how to make updates appear immediately in another
open form.

Hope that's fairly clear.

Cheers

John South
www.WhereCanWeGo.com
Pangbourne UK
 
I would probably create a class on the server, that would hold your
master array of schedules. then to make the changes instant, you could
use AJAX, set each form to refresh every X seconds to poll for the
Array off the server. If the server array is different than the one on
the client side, it gets the updates and updates the UI.

there is an article on MSDN called ASP.NET Spiced, that explains how to
use asp.net and ajax together. some pretty impressive stuff if you ask
me.

hope that helps, little hazy on the details but you get the idea.
 
i take that back about the form refreshing, that wouldnt be necessary,
all you would have to do is in the javascript on the client forms,
setup an AJAX method on the server, that your forms would call every X
seconds. thats what i was trying to say
 
Sorry, I thought I had made it clear that it's a Windows Forms
Application not ASP.Net.

John South
 
Back
Top