using System;
using System.Collections.Generic;
using System.Web.Mvc;
using MongoDB.Bson.Serialization.Attributes;
using EnVisage.Code.DAL.Mongo;
namespace EnVisage.Models
{
public class MixTeamViewModel
{
public string Id { get; set; }
public string TVName { get; set; }
public Guid? CompanyId { get; set; }
public Guid? CostCenterId { get; set; }
public Guid? CapacityTeamId { get; set; }
public bool CopyPlanned { get; set; }
public WidgetExpCategory[] Data { get; set; }
public bool IsNew { get; set; }
public Guid[] UserId { get; set; }
public SelectListGroup Group { get; set; }
///
/// Converts an instance of entity to the new instance of entity.
///
/// An object of type.
/// An object of prefilled with values from .
public static explicit operator MixTeamViewModel(EnVisage.Code.DAL.Mongo.MixTeamView entity)
{
var model = new MixTeamViewModel
{
Id = entity.Id,
IsNew = entity.IsNew,
TVName = entity.Name,
Group = new SelectListGroup {Name = entity.Group, Disabled = false},
CompanyId = entity.CompanyId,
CostCenterId = entity.CostCenterId,
CapacityTeamId = entity.CapacityTeamId,
CopyPlanned = entity.CopyPlanned,
Data = entity.Data,
UserId = entity.UserId
};
return model;
}
}
}