Click or drag to resize

clsImportClassNotificationText Class

Import for table MPSysClassNotificationText: Notification Text Definition (Header Table). See clsImportClassNotificationTextLang for the language definition
Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportClassNotificationText

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
[SerializableAttribute]
public class clsImportClassNotificationText : clsImportBase

The clsImportClassNotificationText type exposes the following members.

Constructors
  NameDescription
Public methodclsImportClassNotificationText
Initializes a new instance of the clsImportClassNotificationText class
Top
Properties
  NameDescription
Public propertyChangeDate
ChangeDate
Public propertyChangeUser
ChangeUser
Public propertyClassID
ClassID Dimension of the class, where the notification is used to
Public propertyCreateDate
CreateDate (Automatically handled)
Public propertyCreateUser
CreateUser. Automatically login user to MARIInterface
Public propertyDefaultLanguage
DefaultLanguage. When the customer does not have a language, or the language of the customer is not in clsImportClassNotificationTextLang this language will be used.

List of languages are managed by clsImportSysCustomerLanguages.

Public propertyDescription
Description for the internal user in the notification event selection combo box
Public propertyEMailFormat
Handling of the text creation.
Public propertyICSNotifcationTextID
Defines Text for the iCal Attachment by linking another clsImportClassNotificationText for the text in the iCal Attachment.
Public propertyImageHandling
ImageHandling of the embedded images in the html source. (Only for EMailFormat other than 0.)
Public propertyNotifcationTextID
Unique key for the notification text definition. Can be empty for the import.
Public propertyNotificationTextLanguages
Collection to process the text by language to the notification text.

Add at least on Language definition of the text is required. This should be the DefaultLanguage defined here at the header

Public propertyUpdateStamp
UpdateStamp
Top
Methods
Remarks
Examples
Create noficiation text with placeholder
private int CreateNotificationText() {
    string sErrordetails;


    int lLangEN = 100004; //select CustomerLanguageID FROM MPSysKundenSprachen WHERE LanguageKey='en-US';
    int lLangDE = 100001;//select CustomerLanguageID FROM MPSysKundenSprachen WHERE LanguageKey='en-US';


    //Create a notification Text for project master 
    clsImportClassNotificationText oNotivText = new clsImportClassNotificationText();
    oNotivText.ClassID = clsImportBase.eCoreDataClassID.Projects; // 
    oNotivText.Description = "Project Creation Notification";
    oNotivText.DefaultLanguage = lLangEN;
    oNotivText.EMailFormat = clsImportClassNotificationText.eEMailRenderMethod.PlainText;
    oNotivText.ImageHandling = clsImportClassNotificationText.eImageHandling.DownloadAndInline;

    //English Text
    clsImportClassNotificationTextLang oEng = new clsImportClassNotificationTextLang();
    oEng.LanguageCode = lLangEN;
    oEng.Subject = "New project #24# #56# created";
    oEng.Message = "The project #24# has been created. Have fun";
    oNotivText.NotificationTextLanguages.Add(oEng);

    //English Text
    clsImportClassNotificationTextLang oGerman = new clsImportClassNotificationTextLang();
    oGerman.LanguageCode = lLangDE;
    oGerman.Subject = "Projekt #24# #56# wurde angelegt";
    oGerman.Message = "<!DOCTYPE HTML>Das Projekt #24# <font color=\"yellow\">angelegt</font>!";
    oNotivText.NotificationTextLanguages.Add(oGerman);

    if (oMPInterface.bImportClassNotificationText(oNotivText, clsImportBase.eImportMode.ValidateAndImport)) {

        //Link the new text to the project creation event 
        clsImportClassNotification oEventLink = new clsImportClassNotification();
        oEventLink.ClassID = clsImportBase.eCoreDataClassID.Projects;
        oEventLink.EventID = 40001; // special id for Project Creation
        oEventLink.Audience = 100; // special code for Project Manager
        oEventLink.Active = true;
        oEventLink.TextID = oNotivText.NotifcationTextID;
        oEventLink.MethodID = clsImportClassNotification.eMethodTypes.EMail_Reminder;

        if (oMPInterface.bImportClassNotificationEventLink(oEventLink, clsImportBase.eImportMode.ValidateAndImport)) {
            //Done
        } else {
            sErrordetails = oMPInterface.oErrors.PrintErrors(true);
            Assert.False(true, sErrordetails);
            return 0;
        }


        return oNotivText.NotifcationTextID;
    } else {
        sErrordetails = oMPInterface.oErrors.PrintErrors(true);
        Assert.False(true, sErrordetails);
        return 0;
    }
}
See Also