Changes
Created page with "{{Item/Resources/CodeSnippetHeader}} === Example 1: Create a copy of the uploaded file === {{Item/Resources/CodeSnippetInfo|KNO|Automatically create a copy of the uploaded d..."
{{Item/Resources/CodeSnippetHeader}}
=== Example 1: Create a copy of the uploaded file ===
{{Item/Resources/CodeSnippetInfo|KNO|Automatically create a copy of the uploaded document to a specific directory.}}
<syntaxhighlight lang="csharp">
protected override void OnLocalFileDocumentIsAvailable(System.String localFullPath)
{
//***UBIK
//Your code here
base.OnLocalFileDocumentIsAvailable(localFullPath);
string ComosDocumentDirectory = "\\\\auglnz0sql\\UBIKData\\BISCHEMSERV\\ComosDocuments\\";
//string ComosDocumentDirectory = "\\\\cs-web02\\d$\\Daten\\ComosDocuments\\";
//string ComosDocumentDirectory = "d:\\Daten\\ComosDocuments\\";
UBIK.Kernel.UBIKClassList<UBIK.Kernel.RelationalObject> relList = this.RelatesFrom("REL_CFILEDOCUMENT");
string comosUID = "";
string funcLoc = "";
if (relList.Count > 0)
{
for (int i=0; ((i < relList.Count) && (comosUID.Equals(""))); i++)
{
if (relList[i] is UBIK.Runtime.MAINTENANCE)
{
UBIK.Runtime.MAINTENANCE mntc = (UBIK.Runtime.MAINTENANCE)relList[i];
comosUID = mntc.FK_COMOSUID;
}
if (relList[i] is UBIK.Runtime.WORKPACKAGE)
{
UBIK.Runtime.WORKPACKAGE wp = (UBIK.Runtime.WORKPACKAGE)relList[i];
comosUID = wp.FK_COMOSUID;
}
}
if (!comosUID.Equals(""))
System.IO.File.Copy(localFullPath,ComosDocumentDirectory + comosUID + "_" + this.Description + "_" + this.ID + ".JPG", true);
}
}
</syntaxhighlight>
[[Category:Internal/Coding]]
=== Example 1: Create a copy of the uploaded file ===
{{Item/Resources/CodeSnippetInfo|KNO|Automatically create a copy of the uploaded document to a specific directory.}}
<syntaxhighlight lang="csharp">
protected override void OnLocalFileDocumentIsAvailable(System.String localFullPath)
{
//***UBIK
//Your code here
base.OnLocalFileDocumentIsAvailable(localFullPath);
string ComosDocumentDirectory = "\\\\auglnz0sql\\UBIKData\\BISCHEMSERV\\ComosDocuments\\";
//string ComosDocumentDirectory = "\\\\cs-web02\\d$\\Daten\\ComosDocuments\\";
//string ComosDocumentDirectory = "d:\\Daten\\ComosDocuments\\";
UBIK.Kernel.UBIKClassList<UBIK.Kernel.RelationalObject> relList = this.RelatesFrom("REL_CFILEDOCUMENT");
string comosUID = "";
string funcLoc = "";
if (relList.Count > 0)
{
for (int i=0; ((i < relList.Count) && (comosUID.Equals(""))); i++)
{
if (relList[i] is UBIK.Runtime.MAINTENANCE)
{
UBIK.Runtime.MAINTENANCE mntc = (UBIK.Runtime.MAINTENANCE)relList[i];
comosUID = mntc.FK_COMOSUID;
}
if (relList[i] is UBIK.Runtime.WORKPACKAGE)
{
UBIK.Runtime.WORKPACKAGE wp = (UBIK.Runtime.WORKPACKAGE)relList[i];
comosUID = wp.FK_COMOSUID;
}
}
if (!comosUID.Equals(""))
System.IO.File.Copy(localFullPath,ComosDocumentDirectory + comosUID + "_" + this.Description + "_" + this.ID + ".JPG", true);
}
}
</syntaxhighlight>
[[Category:Internal/Coding]]
