Доброго утра коллеги. Перестал работать morpher. У меня версия express, купленна.
Сценарий такой:
Код:
using EleWise.ELMA.Model.Scripts.morpher;
namespace EleWise.ELMA.Model.Scripts
{
public partial class P_OutgoingLetter_Scripts : EleWise.ELMA.Workflow.Scripts.ProcessScriptBase<Context>
{
/// <summary>
/// docGenerate
/// </summary>
/// <param name="context">Контекст процесса</param>
public virtual void docGenerate (Context context)
{
context.Roditeljnyy = "";
context.Dolzhnostj = "";
context.Initials = "";
if (context.OutgoingLetter.Contact != null) {
EleWise.ELMA.Model.Scripts.morpher.GetXmlResult send = new EleWise.ELMA.Model.Scripts.morpher.GetXmlResult ();
EleWise.ELMA.Model.Scripts.morpher.WebService b = new EleWise.ELMA.Model.Scripts.morpher.WebService ();
try {
send = b.GetXml (context.OutgoingLetter.Contact.Surname);
context.Roditeljnyy = send.Д;
}
catch {
context.Roditeljnyy = context.OutgoingLetter.Contact.Surname;
}
try {
send = b.GetXml (context.OutgoingLetter.Contact.Position);
context.Dolzhnostj = send.Д;
}
catch {
context.Dolzhnostj = context.OutgoingLetter.Contact.Position;
}
if (context.OutgoingLetter.Contact.Firstname == null || context.OutgoingLetter.Contact.Middlename == null) {
context.Initials = "";
}
else {
if (context.OutgoingLetter.Contact.Firstname.Length > 1) {
context.Initials = context.OutgoingLetter.Contact.Firstname.Remove (1) + ".";
}
else {
context.Initials = context.OutgoingLetter.Contact.Firstname + ". ";
}
if (context.OutgoingLetter.Contact.Middlename.Length > 1) {
context.Initials += context.OutgoingLetter.Contact.Middlename.Remove (1) + ".";
}
else {
context.Initials += context.OutgoingLetter.Contact.Middlename + ".";
}
}
}