Ejemplo n.º 1
0
 /// <summary>
 /// Update changes in the context
 /// </summary>
 /// <param name="role"></param>
 /// <param name="objContex"></param>
 public static void Update(UserDto userDto, ModelUnibookContainer objContex)
 {
     try
     {
         User user = UserBrl.Get(userDto.UserId, objContex);;
         user.Email   = userDto.Email;
         user.Deleted = userDto.Deleted;
         UserDal.Update(user, objContex);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new user Career
 /// </summary>
 /// <param name="userCareer"></param>
 /// <param name="objContex"></param>
 public static void Insert(UserCareerDto userCareerDto, ModelUnibookContainer objContex)
 {
     try
     {
         UserCareer userCareer = new UserCareer();
         userCareer.UserCareerId = userCareerDto.UserCareerId;
         userCareer.User         = UserBrl.Get(userCareerDto.User.UserId, objContex);
         userCareer.Career       = CareerBrl.Get(userCareerDto.Career.CareerId, objContex);
         UserCareerDal.Insert(userCareer, objContex);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Get list user
        /// </summary>
        /// <param name="objContex">Get table to object</param>
        /// <returns></returns>
        public static List <UserDto> GetAll(ModelUnibookContainer objContex)
        {
            try
            {
                List <UserDto> roleList = new List <UserDto>();
                foreach (var item in UserDal.GetAll(objContex))
                {
                    roleList.Add(UserBrl.GetDto(item.UserId, objContex));
                }

                return(roleList);
            }
            catch (DbEntityValidationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }