/// <summary> /// Update changes in the context /// </summary> /// <param name="career"></param> /// <param name="objContex"></param> public static void Update(CareerDto careerDto, ModelUnibookContainer objContex) { try { Career career = CareerBrl.Get(careerDto.CareerId, objContex); career.Name = careerDto.Name; career.Deleted = careerDto.Deleted; career.Faculty = FacultyBrl.Get(careerDto.Faculty.FacultyId, objContex); CareerDal.Update(career, objContex); } catch (Exception ex) { throw ex; } }
/// <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; } }