Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
        /// <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
        }
Beispiel #4
0
        /// <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;
        }
Beispiel #5
0
        /// <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
            };
        }
Beispiel #9
0
 /// <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);
 }