initial source commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Attachment
|
||||
{
|
||||
public class AttachmentModel
|
||||
{
|
||||
public _AttachmentModel Attachment { get; set; }
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Attachment
|
||||
{
|
||||
public class AttachmentsModel
|
||||
{
|
||||
public List<_AttachmentModel> Attachments { get; set; }
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Attachment
|
||||
{
|
||||
public class _AttachmentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Author { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string Filename { get; set; }
|
||||
public string MimeType { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFuzzy();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
||||
public static _AttachmentModel FromAttachment(Disco.Models.Repository.UserAttachment ua)
|
||||
{
|
||||
return new _AttachmentModel
|
||||
{
|
||||
Id = ua.Id,
|
||||
Author = ua.TechUser.ToString(),
|
||||
Timestamp = ua.Timestamp,
|
||||
Comments = ua.Comments,
|
||||
Filename = ua.Filename,
|
||||
MimeType = ua.MimeType
|
||||
};
|
||||
}
|
||||
public static _AttachmentModel FromAttachment(Disco.Models.Repository.JobAttachment ja)
|
||||
{
|
||||
return new _AttachmentModel
|
||||
{
|
||||
Id = ja.Id,
|
||||
Author = ja.TechUser.ToString(),
|
||||
Timestamp = ja.Timestamp,
|
||||
Comments = ja.Comments,
|
||||
Filename = ja.Filename,
|
||||
MimeType = ja.MimeType
|
||||
};
|
||||
}
|
||||
public static _AttachmentModel FromAttachment(Disco.Models.Repository.DeviceAttachment da)
|
||||
{
|
||||
return new _AttachmentModel
|
||||
{
|
||||
Id = da.Id,
|
||||
Author = da.TechUser.ToString(),
|
||||
Timestamp = da.Timestamp,
|
||||
Comments = da.Comments,
|
||||
Filename = da.Filename,
|
||||
MimeType = da.MimeType
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DeviceBatch
|
||||
{
|
||||
public class DeviceBatchTimelineEvent
|
||||
{
|
||||
public string id { get; set; }
|
||||
public DateTime start { get; set; }
|
||||
public DateTime? end { get; set; }
|
||||
public DateTime? latestStart { get; set; }
|
||||
public DateTime? earliestEnd { get; set; }
|
||||
public bool instant { get; set; }
|
||||
public string title { get; set; }
|
||||
public string description { get; set; }
|
||||
public string image { get; set; }
|
||||
public string link { get; set; }
|
||||
public string icon { get; set; }
|
||||
public string color { get; set; }
|
||||
public string textColor { get; set; }
|
||||
public string hoverText { get; set; }
|
||||
public string classname { get; set; }
|
||||
public string tapeImage { get; set; }
|
||||
public bool tapeRepeat { get; set; }
|
||||
public string caption { get; set; }
|
||||
public string eventID { get; set; }
|
||||
public string trackNum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DeviceBatch
|
||||
{
|
||||
public class DeviceBatchTimelineEventSource
|
||||
{
|
||||
public string wikiURL { get; set; }
|
||||
public string wikiSection { get; set; }
|
||||
public string dateTimeFormat { get { return "iso8601"; } }
|
||||
public DeviceBatchTimelineEvent[] events { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DeviceModel
|
||||
{
|
||||
public class ComponentModel
|
||||
{
|
||||
public _ComponentModel Component { get; set; }
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DeviceModel
|
||||
{
|
||||
public class _ComponentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Cost { get; set; }
|
||||
public List<string> JobSubTypes { get; set; }
|
||||
|
||||
public static _ComponentModel FromDeviceComponent(Disco.Models.Repository.DeviceComponent dc)
|
||||
{
|
||||
return new _ComponentModel
|
||||
{
|
||||
Id = dc.Id,
|
||||
Description = dc.Description,
|
||||
Cost = dc.Cost.ToString("C"),
|
||||
JobSubTypes = dc.JobSubTypes.Select(j => string.Format("{0}_{1}", j.JobTypeId, j.Id)).ToList()
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DeviceModel
|
||||
{
|
||||
public class _DeviceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string ModelType { get; set; }
|
||||
|
||||
public static _DeviceModel FromDeviceModel(Disco.Models.Repository.DeviceModel dm)
|
||||
{
|
||||
return new _DeviceModel()
|
||||
{
|
||||
Id = dm.Id,
|
||||
Description = dm.Description,
|
||||
Manufacturer = dm.Manufacturer,
|
||||
Model = dm.Model,
|
||||
ModelType = dm.ModelType
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
{
|
||||
public class ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
public string value { get; set; }
|
||||
public string label { get; set; }
|
||||
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(Disco.Models.BI.Search.DeviceSearchResultItem item)
|
||||
{
|
||||
return new ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
value = item.SerialNumber,
|
||||
label = string.Format("{0} - {1} - {2}", item.SerialNumber, item.ComputerName, item.DeviceModelDescription)
|
||||
};
|
||||
}
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(Disco.Models.BI.Job.JobTableModel.JobTableItemModel item)
|
||||
{
|
||||
return new ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
value = item.Id.ToString(),
|
||||
label = string.Format("{0} ({1}; {2})", item.Id, item.DeviceSerialNumber, item.UserDisplayName)
|
||||
};
|
||||
}
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(Disco.Models.BI.Search.UserSearchResultItem item)
|
||||
{
|
||||
return new ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
value = item.Id,
|
||||
label = string.Format("{0} - {1}", item.Id, item.DisplayName)
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
{
|
||||
public class ImporterUndetectedFilesModel
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Timestamp { get; set; }
|
||||
public string TimestampFuzzy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.BI.Expressions;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Expressions
|
||||
{
|
||||
public class ValidateExpressionModel
|
||||
{
|
||||
public string Expression { get; set; }
|
||||
public bool ExpressionValid { get; set; }
|
||||
public int PositionRow { get; set; }
|
||||
public int PositionColumn { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string MessageHtmlEncoded { get; set; }
|
||||
|
||||
public static ValidateExpressionModel FromEvaluateExpressionPart(EvaluateExpressionPart part)
|
||||
{
|
||||
var parseException = part.ParseException;
|
||||
if (parseException != null)
|
||||
{
|
||||
return new ValidateExpressionModel()
|
||||
{
|
||||
Expression = part.Source,
|
||||
ExpressionValid = false,
|
||||
Message = parseException.Message,
|
||||
MessageHtmlEncoded = HttpUtility.HtmlEncode(parseException.Message),
|
||||
PositionRow = parseException.PositionRow,
|
||||
PositionColumn = parseException.PositionColumn
|
||||
};
|
||||
}
|
||||
else
|
||||
return new ValidateExpressionModel() { Expression = part.Source, ExpressionValid = true };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class CommentPostModel
|
||||
{
|
||||
public string Result { get; set; }
|
||||
public _CommentModel Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class CommentsModel
|
||||
{
|
||||
public string Result { get; set; }
|
||||
public List<_CommentModel> Comments { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class ComponentModel
|
||||
{
|
||||
public _ComponentModel Component { get; set; }
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class _CommentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Author { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFuzzy();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
||||
public static _CommentModel FromJobLog(Disco.Models.Repository.JobLog jl)
|
||||
{
|
||||
return new _CommentModel
|
||||
{
|
||||
Id = jl.Id,
|
||||
Author = jl.TechUser.ToString(),
|
||||
Timestamp = jl.Timestamp,
|
||||
Comments = jl.Comments
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class _ComponentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Cost { get; set; }
|
||||
|
||||
public static _ComponentModel FromJobComponent(Disco.Models.Repository.JobComponent jc)
|
||||
{
|
||||
return new _ComponentModel
|
||||
{
|
||||
Id = jc.Id,
|
||||
Description = jc.Description,
|
||||
Cost = jc.Cost.ToString("C")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
public class _DateChangeModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Result { get; set; }
|
||||
public string UserDescription { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Logging.Models;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Logs
|
||||
{
|
||||
public class LogEventTypeModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Severity { get; set; }
|
||||
|
||||
public static LogEventTypeModel FromLogEventType(LogEventType EventType)
|
||||
{
|
||||
return new LogEventTypeModel()
|
||||
{
|
||||
Id = EventType.Id,
|
||||
Name = EventType.Name,
|
||||
Severity = EventType.Severity
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Logging;
|
||||
using System.Web.WebPages.Html;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Logs
|
||||
{
|
||||
public class LogModuleModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public List<LogEventTypeModel> EventTypes { get; set; }
|
||||
|
||||
public static LogModuleModel FromLogModule(LogBase LogModule)
|
||||
{
|
||||
return new LogModuleModel()
|
||||
{
|
||||
Id = LogModule.ModuleId,
|
||||
Name = LogModule.ModuleName,
|
||||
Description = LogModule.ModuleDescription,
|
||||
EventTypes = LogModule.EventTypes.Values.Select(et => LogEventTypeModel.FromLogEventType(et)).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.System
|
||||
{
|
||||
public class UpdateLastNetworkLogonDatesModel
|
||||
{
|
||||
public string Result { get; set; }
|
||||
public int UpdateCount { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user