Make your own free website on Tripod.com
EPolWS
Page Main Example
Home
Account
ep_test.txt
SerializableBase
DbConnectionBase
EPolESForm
DbSTable
EmailFactory.cs
epmain
EPolES
DbVariableView.cs
ProfileView
EPolLOcal Main
Page Main Example
EPolWS EPolWS.asmx
EPolWS EPolWS.cs
CommandManager
CommandFactory
CommandFactoryBase
OrganisationView
EPolConsole Main
DbEPBase.cs
DbRecordArray
DbTable

Enter subhead content here

using System; using System.Text; using System.Runtime.InteropServices; using System.Collections; using System.IO; using System.Diagnostics; using EXCommon; using EXDb97; using EPol; //###Exemple namespace QuantitativeTestTools { class Program { static void Main(string[] args) { CTestWithAvatar oTestAvatar = new CTestWithAvatar("_quant"); oTestAvatar.dCreateTeam("lby", "mjia", "kliu", "huia"); // oTestAvatar.dSend("lby", " c attribute project_name='quant framework of lby' -org:quantitative_team"); oTestAvatar.dSend("lby", "c attribute project_name='quant framework of lby' -org:quantitative_team"); oTestAvatar.dSend("kliu", "c attribute project_name='quant framework of kliu'-org:quantitative_team"); // oTestAvatar.dSend("lby", "c function lby_project=(c attribute project_name='quant framework of lby' -org:quantitative_team)"); //oTestAvatar.dSend("kliu", "c function lby_project=(c attribute project_name='quant framework of kliu' -org:quantitative_team)"); // oTestAvatar.dSend("lby", "l project_name -org:quantitative_team -variable:$project_name"); // oTestAvatar.dSend("lby", "l $project_name"); // oTestAvatar.dSend("lby", "c attribute project_name='quant framework of kliu'-org:quantitative_team"); //oTestAvatar.dSend("lby", "support meme 6.0 -against:6.1 "); CIdentifier oIdentifierObject0, oIdentifierObject1; oTestAvatar.DbEntityManager.dConvert("organisation_attribute,organisation=i:1.project_name#0", out oIdentifierObject0); CTrace.i().vWriteLn(ENMessage.Identifier, oIdentifierObject0.ToString()); oTestAvatar.DbEntityManager.dConvert("organisation_attribute,organisation=i:1.project_name#1", out oIdentifierObject1); CTrace.i().vWriteLn(ENMessage.Identifier, oIdentifierObject1.ToString()); oTestAvatar.dSend("lby", "support identifier organisation_attribute,organisation=i:1.project_name#0 -avatar:lby_quant -language:english -avatar_name:lby_quant -against:organisation_attribute,organisation=i:1.project_name#1 "); // oTestAvatar.dSend("lby", "c function project=(l attribute project_name -org:quantitative_team -author:lby_quant);c function project2=(c attribute project_name -org:quantitative_team -author:kliu_quant);support $project -against:$project2"); // oTestAvatar.dCreateAttributeAndSupport(); } void vLessonManager() { CLessonManager oLessonManager = new CLessonManager(CLessonBase.ENLessonPurpose.test); oLessonManager.vLoad("ep_analytic_test.txt"); CTrace.i().vWriteLn(ENMessage.Lesson, "ep_test=" + oLessonManager.csDump()); CStatusEmail oStatusMail; CDbEPBase.ec dStatus = oLessonManager.dExecute(oLessonManager.dFindIndex("create_workgroup"), out oStatusMail); } } public class CTestWithAvatar : CTest { public CTestWithAvatar(string sAvatarSuffix) : base() { m_sAvatarSuffix = sAvatarSuffix; } string m_sAvatarSuffix; public CDbEPBase.ec dCreateAv(string sName) { return dSend(sName, "c av " + sName + m_sAvatarSuffix); } public CDbEPBase.ec dSend(string sName, string sText) { return dSend(sName, sName + m_sAvatarSuffix, sText); } public CDbEPBase.ec dCreateAttributeAndSupport() { dCreateTeam("lby", "mjia", "kliu", "huia"); dSend("lby", "c attribute project_name='quant framework of lby' -org:quantitative_team "); dSend("mjia", "c attribute project_name='quant framework of mjia' -org:quantitative_team "); dSend("kliu", "c attribute project_name='quant framework of kliu' -org:quantitative_team "); dSend("lby", "l project_name -org:quantitative_team "); dSend("kliu", "support attribute project_name -author:kliu_quant -org:quantitative_team "); // oTestAvatar.dSend("huia", "support attribute project_name -author:mjia_quant -org:quantitative_team "); dSend("mjia", "support attribute project_name -author:mjia_quant -org:quantitative_team "); dSend("lby", "support attribute project_name -author:lby_quant -org:quantitative_team "); // oTestAvatar.dSend("kliu", "vc attribute project_name -org:quantitative_team -trace "); return dSend("kliu", "vc attribute project_name -org:quantitative_team"); } public CDbEPBase.ec dCreateTeam(params string[] sNameMember) { for (int i = 0; i < sNameMember.Length; i++) { dCreateAv(sNameMember[i], sNameMember[i] + m_sAvatarSuffix); } dSend(sNameMember[0], "c org quantitative_team"); for (int i = 1; i < sNameMember.Length; i++) { dSend(sNameMember[0], "add member " + sNameMember[i] + m_sAvatarSuffix + " -org:quantitative_team"); } for (int i = 0; i < sNameMember.Length; i++) { dSend(sNameMember[i], "grant access quantitative_team"); } return dSend(sNameMember[0], "l member -org:quantitative_team"); } public CDbEPBase.ec dCreateOrganisationAttribute() { dCreateTeam("lby", "mjia", "kliu", "huia"); dSend("lby", "c attribute project_name='quant framework of lby' -org:quantitative_team "); // oTest.dSend("lby", "c attribute project_name='quant framework created lby for mjia' -org:quantitative_team -member:mjia_quant"); // oTest.dSend("lby", "l project_name -org:quantitative_team -member:mjia_quant "); // oTest.dSend("lby", "c attribute my_birthday='june' " ); // oTest.dSend("lby", "l my_birthday "); // oTest.dSend("lby", "c attribute his_birthday='february' -member:mjia_quant"); // oTest.dSend("lby", "l his_birthday "); // oTest.dSend("mjia", "mjia_quant", "l project_name -av:lby_quant"); dSend("mjia", "c attribute project_name='quant framework of mjia' -org:quantitative_team "); dSend("kliu", "c attribute project_name='quant framework of kliu' -org:quantitative_team "); dSend("huia", "c attribute project_name='quant framework of huia' -org:quantitative_team "); // dSend("lby", "l project_name -org:quantitative_team -author:kliu_quant "); return dSend("lby", "l project_name -org:quantitative_team "); } }; public class CTest { public CTest() { m_oEmailManager = new CEmailManager(); vRegister(); } public string sDatabaseName { get { return m_oEmailManager.sDatabaseName; } } public CCommandManager CommandManager { get { return m_oEmailManager.CommandManager; } } public CDbEntityManager DbEntityManager { get { return CommandManager.DbEntityManager; } } CEmailManager m_oEmailManager; // public const string INPUT_EMAIL = "dest@test.fr"; public const string QUANT_DB = "QUANT_TEST_DB"; public const string RECIPIENT_EMAIL = "root@test.fr"; public const string DOMAIN= "@test.fr"; public void vRegister() { if (m_oEmailManager.bInitDatabase(QUANT_DB)) { m_oEmailManager.vCleanAllData(); m_oEmailManager.vRegister(); } } public CDbEPBase.ec dCreateAv(string sName, string sAvName) { return dSendPrivate(sName, "c av " + sAvName); } public CDbEPBase.ec dSend(string sName, string sAvName, string sText) { return dSendPrivate(sName, sText + " -avatar:" + sAvName); } public CDbEPBase.ec dCreateAvTest(string sName) { CReceivedEmail oRecievedEmail = new CReceivedEmail(sName + DOMAIN, sName, RECIPIENT_EMAIL, DateTime.Now); oRecievedEmail.dAddText("c av achille -language:eng"); oRecievedEmail.dAddText("c av avatar1_of_achille -parent:achille"); oRecievedEmail.dAddText("c av avatar1_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("c av avatar2_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("c av avatar3_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("c av avatar4_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("list av -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = m_oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = m_oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); return dStatus; } public CDbEPBase.ec dSendPrivate( string sName, string sText) { CReceivedEmail oRecievedEmail = new CReceivedEmail(sName + DOMAIN, sName, RECIPIENT_EMAIL, DateTime.Now); oRecievedEmail.dAddText(sText); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = m_oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = m_oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); return dStatus; } }; }

Enter supporting content here