56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace RunNxUpdate
|
|
{
|
|
/// <summary>
|
|
/// Description of Locations.
|
|
/// </summary>
|
|
class Locations
|
|
{
|
|
public enum Location
|
|
{
|
|
EA = 1,
|
|
EAZ,
|
|
EMCC,
|
|
EMCN,
|
|
EMCZ,
|
|
EMK,
|
|
EUS,
|
|
UNKNOWN
|
|
}
|
|
|
|
public static Locations.Location GetOwnLocation()
|
|
{
|
|
try
|
|
{
|
|
string plant = Environment.GetEnvironmentVariable("PLANT");
|
|
|
|
if (String.IsNullOrEmpty(plant))
|
|
{
|
|
plant = "UNKNOWN";
|
|
}
|
|
|
|
Locations.Location location = (Location)Enum.Parse(typeof(Location), plant);
|
|
|
|
return location;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
MessageBox.Show("Die Sprache konnte nicht eingestellt werden, weil der Standort nicht ermittelt werden konnte.\n\nBitte informieren sie ihren NX Administrator.\n\n\n\nThe language could not be set, because the location could not be determined.\n\nPlease inform your NX administrator",
|
|
"Schwerer Fehler / Fatal Error",
|
|
MessageBoxButtons.OK,
|
|
MessageBoxIcon.Error,
|
|
MessageBoxDefaultButton.Button1);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|