/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarComposite = data.AvatarComposite; AvatarInventory = data.AvatarInventory; AvatarLevel = data.AvatarLevel; Tokens = data.Tokens; Status = data.Status; ExperiencePoints = data.ExperiencePoints; Password = data.Password; Inventory = data.Inventory; Attendance = data.Attendance; EmotionCurrent = data.EmotionCurrent; EmotionUri = Emotion.GetEmotionURI(EmotionCurrent); Truck = data.Truck; Truck.TruckUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Truck); Truck.WheelsUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Wheels); Truck.TopperUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Topper); Truck.TrailerUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Trailer); Truck.SignUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Sign); Truck.MenuUri = Backend.DataSourceBackend.Instance.FactoryInventoryBackend.GetFactoryInventoryUri(Truck.Menu); }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarId = data.AvatarId; Status = data.Status; Password = data.Password; }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarId = data.AvatarId; Status = data.Status; TimeIn = data.TimeIn; // set time in TimeOut = data.TimeOut; // set time out }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarId = data.AvatarId; AvatarLevel = data.AvatarLevel; Tokens = data.Tokens; Status = data.Status; }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarId = data.AvatarId; AvatarLevel = data.AvatarLevel; Tokens = data.Tokens; Status = data.Status; isUpdate = data.isUpdate; ReportsId = data.ReportsId; }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarId = data.AvatarId; AvatarLevel = data.AvatarLevel; Tokens = data.Tokens; Status = data.Status; ExperiencePoints = data.ExperiencePoints; Password = data.Password; Inventory = data.Inventory; Attendance = data.Attendance; }
/// <summary> /// Convert a Student Display View Model, to a Student Model, used for when passed data from Views that use the full Student Display View Model. /// </summary> /// <param name="data">The student data to pull</param> public StudentModel(StudentDisplayViewModel data) { Id = data.Id; Name = data.Name; AvatarComposite = data.AvatarComposite; AvatarInventory = data.AvatarInventory; AvatarLevel = data.AvatarLevel; Tokens = data.Tokens; Status = data.Status; ExperiencePoints = data.ExperiencePoints; Password = data.Password; Attendance = data.Attendance; EmotionCurrent = data.EmotionCurrent; EmotionUri = Emotion.GetEmotionURI(EmotionCurrent); }
public ApplicationUserViewModel(ApplicationUser User) { if (User == null) { return; } UserRole = new List <UserRoleEnum>(); foreach (UserRoleEnum RoleEnum in Enum.GetValues(typeof(UserRoleEnum))) { if (DataSourceBackend.Instance.IdentityBackend.UserHasClaimOfType(User.Id, RoleEnum)) { UserRole.Add(RoleEnum); } } var StudentData = DataSourceBackend.Instance.StudentBackend.Read(User.Id); Student = new StudentDisplayViewModel(StudentData) { Name = User.UserName, Id = User.Id }; }
/// <summary> /// Take the data passed in, and convert to a new StudentDisplayViewModel item /// </summary> /// <param name="data"></param> public StudentViewModel(StudentModel data) { Student = new StudentDisplayViewModel(data); }