using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EnVisage.Code;
namespace EnVisage.Models
{
public class ActivityCalendarRequestModel
{
public enum ActivityCalendarEntityType
{
Team = 1,
View = 2,
Company = 3,
Resource = 4
}
public Guid EntityId { get; set; }
public ActivityCalendarEntityType EntityType { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
public class ActivityCalendarScenarioModel
{
public Guid Id { get; set; }
public string Name { get; set; }
public bool IsBottomUp { get; set; }
public long StartDate { get; set; }
public long EndDate { get; set; }
}
public class ActivityCalendarProjectModel
{
public Guid ProjectId { get; set; }
public Guid CompanyId { get; set; }
public Guid ClientId { get; set; }
public Guid? ParentProjectId { get; set; }
///
/// Gets or sets a name of the master project if any
///
public string ParentName { get; set; }
public Guid? PartId { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public bool ReadOnly { get; set; }
public ActivityCalendarScenarioModel ActiveScenario { get; set; }
public List InactiveScenarios { get; set; }
/// Contains intersection of project's and filtered teams
public Dictionary Teams { get; set; }
public decimal Priority { get; set; }
public long DeadlineMs { get; set; }
public string TypeName { get; set; }
#region Constructors
public ActivityCalendarProjectModel()
{
InactiveScenarios = new List();
Teams = new Dictionary();
}
#endregion
}
public class ActivityCalendarModel
{
/// Contains Years->Months->Days
public List CostCenters { get; set; }
public List ProjectRoles { get; set; }
public Dictionary>> WeekEndings { get; set; }
public Dictionary Projects { get; set; }
public Dictionary Teams { get; set; }
public Dictionary NeedAllocations { get; set; }
public Dictionary UnassignedNeed { get; set; }
public Dictionary TeamAllocations { get; set; }
public Dictionary ResourceAllocations { get; set; }
public Dictionary ResourceActuals { get; set; }
public List WorkFlowActions { get; set; }
public ActivityCalendarRestData RestData { get; set; }
#region Constructors
public ActivityCalendarModel()
{
CostCenters = new List();
ProjectRoles = new List();
WeekEndings = new Dictionary>>();
Projects = new Dictionary();
Teams = new Dictionary();
NeedAllocations = new Dictionary();
TeamAllocations = new Dictionary();
ResourceAllocations = new Dictionary();
ResourceActuals = new Dictionary();
WorkFlowActions = new List();
}
#endregion
}
public class ActivityCalendarAllocationsModel
{
public Dictionary Allocations { get; set; }
#region Constructors
public ActivityCalendarAllocationsModel()
{
Allocations = new Dictionary();
}
#endregion
}
public class ActivityCalendarAllocationsByECModel
{
public Dictionary Expenditures { get; set; }
#region Constructors
public ActivityCalendarAllocationsByECModel()
{
Expenditures = new Dictionary();
}
#endregion
}
public class ActivityCalendarTeamAllocationsModel
{
public Dictionary Scenarios { get; set; }
#region Constructors
public ActivityCalendarTeamAllocationsModel()
{
Scenarios = new Dictionary();
}
#endregion
}
public class ActivityCalendarPeopleResourceAllocationsByTeamModel
{
public Dictionary Teams { get; set; }
#region Constructors
public ActivityCalendarPeopleResourceAllocationsByTeamModel()
{
Teams = new Dictionary();
}
#endregion
}
public class ActivityCalendarPeopleResourceAllocationsByScenarioModel
{
public Dictionary Scenarios { get; set; }
#region Constructors
public ActivityCalendarPeopleResourceAllocationsByScenarioModel()
{
Scenarios = new Dictionary();
}
#endregion
}
public class ActivityCalendarProjectTeamWithAssignedResourcesModel
{
// key - expenditure category id, value - list with resources ids
public Dictionary> Resources { get; set; }
#region Constructors
public ActivityCalendarProjectTeamWithAssignedResourcesModel()
{
Resources = new Dictionary>();
}
#endregion
}
public class ActivityCalendarRestData
{
/// Team allocations by rest teams that do not visible for users, but need for project unallocated calculation, key - scenario id
public Dictionary TeamAllocations { get; set; }
#region Constructors
public ActivityCalendarRestData()
{
TeamAllocations = new Dictionary();
}
#endregion
}
#region New Activity Calendar Save models
public class ActivityCalendarSaveModel
{
#region Scenario data save model
public class ScenarioSaveModel
{
///
/// Gets or sets a value indicating whether to update projections based on entered allocations or not.
///
///
/// If true then Team allocations (team need) will be recalculated based on entered resource allocations.
/// If true then Scenario Details (project need) will be recalculated based on entered resource allocations and team allocations.
///
public bool UpdateProjections { get; set; }
public bool isNew { get; set; }
public Dictionary Expenditures { get; set; }
public ScenarioSaveModel()
{
Expenditures = new Dictionary();
}
}
public class ScenarioExpenditureDataModel
{
public Dictionary Teams { get; set; }
public ScenarioExpenditureDataModel()
{
Teams = new Dictionary();
}
}
public class ScenarioTeamDataModel
{
public Dictionary Allocations { get; set; }
public Dictionary Resources { get; set; }
public ScenarioTeamDataModel()
{
Allocations = new Dictionary();
Resources = new Dictionary();
}
}
public class ScenarioResourceDataModel
{
public bool IsRemoved { get; set; }
public Dictionary ForecastAllocations { get; set; }
public Dictionary ActualAllocations { get; set; }
public ScenarioResourceDataModel()
{
ForecastAllocations = new Dictionary();
ActualAllocations = new Dictionary();
}
}
#endregion
#region Non-Project time data save model
public class NonProjectTimeSaveModel
{
public Dictionary Resources { get; set; }
// Allocations for team-wide NPTs
public Dictionary TeamWideNptAllocations { get; set; }
public NonProjectTimeSaveModel()
{
Resources = new Dictionary();
TeamWideNptAllocations = new Dictionary();
}
}
public class NptEntityDataModel
{
public Dictionary Allocations { get; set; }
public NptEntityDataModel()
{
Allocations = new Dictionary();
}
}
#endregion
public SaveAsScenario SaveAction { get; set; }
public string NewName { get; set; }
public ScenarioSaveType ScenarioType { get; set; }
public bool SetActive { get; set; }
public ActivityCalendarRequestModel.ActivityCalendarEntityType CalendarDisplayMode { get; set; }
public Guid? FilterEntityId { get; set; }
public Dictionary Scenarios { get; set; }
public Dictionary NonProjectTime { get; set; }
public List WorkFlowActions { get; set; }
public ActivityCalendarSaveModel()
{
Scenarios = new Dictionary();
NonProjectTime = new Dictionary();
}
}
#endregion
}