74 lines
1.8 KiB
C#
74 lines
1.8 KiB
C#
using System;
|
|
|
|
namespace TellmePdmsPluging.Models
|
|
{
|
|
public class OpenProjectRequest
|
|
{
|
|
public string ExecutionId { get; set; }
|
|
public string execution_id { get { return ExecutionId; } set { ExecutionId = value; } }
|
|
|
|
/// <summary>
|
|
/// PDMS Project name
|
|
/// </summary>
|
|
public string ProjectName { get; set; }
|
|
|
|
/// <summary>
|
|
/// PDMS login user name
|
|
/// </summary>
|
|
public string UserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// PDMS login password
|
|
/// </summary>
|
|
public string Password { get; set; }
|
|
|
|
public void ApplyDefaults()
|
|
{
|
|
ProjectName = Normalize(ProjectName);
|
|
UserName = Normalize(UserName);
|
|
Password = Password ?? string.Empty;
|
|
}
|
|
|
|
private static string Normalize(string value)
|
|
{
|
|
if (IsNullOrWhiteSpace(value))
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return value.Trim();
|
|
}
|
|
|
|
private static bool IsNullOrWhiteSpace(string value)
|
|
{
|
|
if (value == null)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
for (int i = 0; i < value.Length; i++)
|
|
{
|
|
if (!char.IsWhiteSpace(value[i]))
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class OpenProjectResult
|
|
{
|
|
public bool Success { get; set; }
|
|
public string Message { get; set; }
|
|
public string ProjectName { get; set; }
|
|
public bool WasAlreadyOpen { get; set; }
|
|
public long FileSize { get; set; }
|
|
public long PolygonCount { get; set; }
|
|
public long FeatureCount { get; set; }
|
|
public DateTime CompletedAt { get; set; }
|
|
}
|
|
}
|
|
|