Пример #1
0
        public static void Update(this IUserService <User> userData,
                                  ViewModels.Users.UserEditViewModel data)
        {
            var toUpdate = userData.GetAll().FirstOrDefault(s => s.Id == data.Id);

            if (toUpdate != null)
            {
                toUpdate.FirstName  = data.FirstName;
                toUpdate.LastName   = data.LastName;
                toUpdate.BirthDate  = data.BirthDate;
                toUpdate.PersonalNo = data.PersonalNo;
                toUpdate.Type       = data.Type;
                toUpdate.State      = data.State;
            }
        }
Пример #2
0
        public static void Update(this IUserService <Student> userData,
                                  ViewModels.Users.UserEditViewModel data)
        {
            var toUpdate = userData.GetAll().FirstOrDefault(s => s.Id == data.Id);

            if (toUpdate != null)
            {
                toUpdate.FirstName        = data.FirstName;
                toUpdate.LastName         = data.LastName;
                toUpdate.BirthDate        = data.BirthDate;
                toUpdate.PersonalNo       = data.PersonalNo;
                toUpdate.Type             = data.Type;
                toUpdate.State            = data.State;
                toUpdate.HasTheoryClasses = data.HasTheoryClasses;
                toUpdate.PracticeCount    = data.PracticeCount;
            }
        }