EnVisageOnline/Main/Source/EnVisage/Models/WorkFlowModel.cs

140 lines
4.8 KiB
C#

using EnVisage.Code;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Web.Script.Serialization;
namespace EnVisage.Models
{
public class WorkFlowModel
{
public Guid? Id { get; set; }
[Required]
[Remote("WorkFlowNameAvailable", "WorkFlowDefinition", AdditionalFields = "Id", ErrorMessage = "This Name has already been assigned to another workflow process.", HttpMethod = "POST")]
public string Name { get; set; }
public string Code { get { return this.Name.Replace(" ", ""); } }
[Required]
[Display(Name = "Area")]
public int DomainId { get; set; }
[Display(Name = "Default")]
public bool isDefault { get; set; }
public int ItemsInWorkFlow { get; set; }
[Display(Name = "Active")]
public bool isActive { get; set; }
public Guid? SchemeId { get; set; }
public string Area { get { return Utils.GetEnumDisplay(typeof(WorkFlowArea), DomainId); } }
public List<string> WorkFlowRoles { get; set; }
}
public class WorkFlowRoleModel
{
public Guid? Id { get; set; }
[Required]
[Remote("WorkFlowRoleNameAvailable", "WorkFlowDefinition", AdditionalFields = "Id", ErrorMessage = "This Name has already been assigned to another workflow role or User role.", HttpMethod = "POST")]
public string RoleName { get; set; }
public int UserCount { get; set; }
}
public class WorkFlowParameter
{
public string ParameterName { get; set; }
public string LocalizedName { get; set; }
public bool isRequired { get; set; }
public object Value { get; set; }
public object DefaultValue { get; set; }
public object Type { get; set; }
public string TypeName { get; set; }
}
public class WorkFlowCommandModel
{
public List<string> Identities { get; set; }
public List<WorkFlowParameter> Parameters { get; set; }
public Guid ProcessId { get; set; }
public string ValidForActivityName { get; set; }
public bool ValidForSubprocess { get; set; }
public string ValidForStateName { get; set; }
public int Classifier { get; set; }
public bool IsForSubprocess { get; set; }
public string CommandName { get; set; }
public string LocalizedName { get; set; }
}
public class ActivityCalWorkFlowCommand
{
public Guid? ScenarioId { get; set; }
public string ProjectName { get; set; }
public List<WorkFlowCommand> Commands { get; set; }
public bool HasChanges { get; set; }
}
public class WorkFlowCommand
{
public string command { get; set; }
public bool Selected { get; set; }
public Guid? Id { get; set; }
public bool HasChanges { get; set; }
}
public class WorkFlowState
{
public string state { get; set; }
public bool Selected { get; set; }
public Guid? Id { get; set; }
public bool HasChanges { get; set; }
}
public class WorkFlowTeamHistoryModel
{
public string TeamName { get; set; }
public Guid wf_TeamTracking { get; set; }
public Guid? ScenarioId { get; set; }
public string CurrentState { get; set; }
public string NextState { get; set; }
public DateTime StateDate { get; set; }
public string WhoChanged { get; set; }
}
public class WorkFlowContactModel
{
public Guid? Id { get; set; }
public Guid? ParentId { get; set; }
public Guid ContactId { get; set; }
public int ContactType { get; set; }
public string RoleName { get; set; }
}
public class WorkFlowContactDetails
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public Guid UserId { get; set; }
public string RoleName { get; set; }
public Guid? TeamId { get; set; }
public string TeamName { get; set; }
}
public class WorkflowScenarioModel
{
public string ProjectName { get; set; }
public string ScenarioName { get; set; }
public Guid? ScenarioId { get; set; }
public string Command { get; set; }
public string ScenarioStatus { get; set; }
public string WorkFlowState { get; set; }
public bool canExecuteCommands { get; set; }
}public class WorkflowSelectableCommandModel
{
public string command { get; set; }
public string value { get; set; }
}
public class WorkflowScenarioViewModel
{
public Guid ProjectId { get; set; }
public bool FullRefresh { get; set; }
}
}