Murali this is the connecting code between Interface and JobFlow Manger I would like you to write so that we can go live and I can start debugging.

Interface (Walter), will access and modify the following tables: tUser, tRegSender, tMailRef, tContact, tForward, and tMail based on Firewall rules. (ignore this for now)

JobFlowManager ( Murali) will access and modify only tMail table based on rules below :
tMail (table)
cID (generated),
cFilePath (generated path to the file in c:/MailSystem),
cDate(date message arrived),
cStatus (discussed below),
cTo (message To:),
cFrom (message From:) .

To look at the SQL Server database (although there is no need) double click SQL Management Studio Express on the desk top, then click connect.

use the following connection string in your code:

private const string GConnectionString = "Driver={SQL Server};server=NS\\SQLEXPRESS;dsn=MailSystem;Database=MailSystem;Uid=walter;Pwd=mishi";

Incoming Mail:
Place the incoming message in to folder: MailSystem (created)
Insert a new record into table tMail as above and set cStatus = ' newin'

Outgoing Mail:
Check tMail table for records with cStaus = ' newout'
Fetch the message from folder MailSystem using filepath in tMail. cFilePath column for this record.
Update tMail. cStatus = ' doneout'
Send the message to its destination.

Delete Mail
Check tMail table for records with cStatus=' delete', deletes the message from its system and then deletes the corresponding record from tMail.
No need to delete the message from MailSystem that was done by the Interface.

Review of CStatus attribute in table TMail:

‘ delete’ - The Interface decides when to delete the message from folder MailSystem and sets cStatus to ‘ delete’ and deletes the message from folder MailSystem.
JobFlowManeger scans for records with cStaus =‘ delete’ and deletes the message from its system and then deletes the corresponding record from TMail.

 

‘ newin’ – The JobFlowManeger places a new message into MailSystem folder and inserts a record into tMail ( cID, cFilePath, cStatus, cDate, cTo, cFrom)
and sets CStatus = ‘ newin’ .

 

‘ donein’ - The interface scans the tMail table for cStaus = ‘ newin’ then updates its tables and sets cStatus to ‘ donein’
(JobFlow manager ignores records with cStaus=' donein'

 

‘ newout’ – The Interface places a new message into MailSystem folder and inserts a record into tMail ( cID, cFilePath, cStatus, cDate, cTo, cFrom)
with CStatus = ‘ newout’ .

 

‘ doneout’ - JobFlowManeger scans for records for cStaus= ‘ newout’ then sends the massage out and sets cStatus = ‘ doneout’ .

 

Note:
The ‘ donein’ VS. ‘ doneout’ . The Interface needs to distinguish between ‘ donein’ VS. ‘ doneout’ because it scans records for cStaus = ‘ doneout’ in order
to change the cStaus in table tMailRef from ‘OutBox’ to ‘Sent”
Advantage over other email system is that if you send a regrettable letter and would like to cancel it then it's possible provided the
JobFlow Manager did not send it yet and tMail. cStatus still has ' newout'. (Have not implemented this rule yet but it should be easy to do).