Changes
Created page with "{{Internal/Coding/Basics}} === Change the display string at the clients side to name and desription. === {{Internal/CodeSnippetInfo|KNO}} <syntaxhighlight lang="csharp"> pub..."
{{Internal/Coding/Basics}}
=== Change the display string at the clients side to name and desription. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(Int32 priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = base.DisplayStringItem(priorityIndex);
string value = "";
switch (priorityIndex)
{
case 0:
if (displayText.Equals(""))
{
displayText = this.Name;
}
break;
case 1:
if (displayText.Equals(""))
{
displayText = this.Description;
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
=== Change the display string at the clients side to name and desription of a linked object. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(Int32 priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = "";
string value = "";
switch (priorityIndex)
{
case 0:
if (displayText.Equals(""))
{
BMA rightObj = (BMA)this.GetLinkedObject("RIGHTUID");
if (rightObj != null)
displayText = rightObj.Name;
}
break;
case 1:
if (displayText.Equals(""))
{
BMA rightObj = (BMA)this.GetLinkedObject("RIGHTUID");
if (rightObj != null)
displayText = rightObj.Description;
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
=== Change the display string at the clients side. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(int priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = "";
string value = "";
UBIK.Runtime.WORKPACKAGE wp = null;
switch (priorityIndex)
{
case 0:
wp = (WORKPACKAGE)this.LK_WORKPACKAGE;
if (wp != null)
{
displayText = wp.Name;
if (wp.TryGetValue<string>("PP_MNTCORDER", out value))
if (!value.Equals(""))
displayText = string.Concat(displayText, " (", value, ")");
}
break;
case 1:
wp = (WORKPACKAGE)this.LK_WORKPACKAGE;
if (wp != null)
{
if (!wp.Description.Equals(""))
{
if (wp.Description.Length > 30)
{
displayText = string.Concat(displayText, " ", wp.Description.Substring(0,30));
displayText = string.Concat(displayText, "...");
}
else
displayText = wp.Description;
}
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
=== Change the display string at the clients side to name and desription. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(Int32 priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = base.DisplayStringItem(priorityIndex);
string value = "";
switch (priorityIndex)
{
case 0:
if (displayText.Equals(""))
{
displayText = this.Name;
}
break;
case 1:
if (displayText.Equals(""))
{
displayText = this.Description;
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
=== Change the display string at the clients side to name and desription of a linked object. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(Int32 priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = "";
string value = "";
switch (priorityIndex)
{
case 0:
if (displayText.Equals(""))
{
BMA rightObj = (BMA)this.GetLinkedObject("RIGHTUID");
if (rightObj != null)
displayText = rightObj.Name;
}
break;
case 1:
if (displayText.Equals(""))
{
BMA rightObj = (BMA)this.GetLinkedObject("RIGHTUID");
if (rightObj != null)
displayText = rightObj.Description;
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
=== Change the display string at the clients side. ===
{{Internal/CodeSnippetInfo|KNO}}
<syntaxhighlight lang="csharp">
public override System.String DisplayStringItem(int priorityIndex)
{
//***UBIK
//Your code here
//return base.DisplayStringItem(priorityIndex);
string displayText = "";
string value = "";
UBIK.Runtime.WORKPACKAGE wp = null;
switch (priorityIndex)
{
case 0:
wp = (WORKPACKAGE)this.LK_WORKPACKAGE;
if (wp != null)
{
displayText = wp.Name;
if (wp.TryGetValue<string>("PP_MNTCORDER", out value))
if (!value.Equals(""))
displayText = string.Concat(displayText, " (", value, ")");
}
break;
case 1:
wp = (WORKPACKAGE)this.LK_WORKPACKAGE;
if (wp != null)
{
if (!wp.Description.Equals(""))
{
if (wp.Description.Length > 30)
{
displayText = string.Concat(displayText, " ", wp.Description.Substring(0,30));
displayText = string.Concat(displayText, "...");
}
else
displayText = wp.Description;
}
}
break;
default: break;
}
return(displayText);
}
</syntaxhighlight>
