public static void UpdateEntitleDayAppUser(this Entitleday_AppUser entitleday_AppUser, EntitleDay_AppUserModel entitleDay_AppUserModel) { entitleday_AppUser.ID = entitleDay_AppUserModel.EntitleDayAppUserId; entitleday_AppUser.MaxEntitleDayAppUser = entitleDay_AppUserModel.MaxEntitleDay; entitleday_AppUser.NumberDayOff = entitleDay_AppUserModel.NumberDayOff; entitleday_AppUser.Note = entitleDay_AppUserModel.Note; }
public void AddEntitleDayUser(EntitleDay entitleDay) { var model = _entitleDayAppUserRepository.GetAll(); foreach (var item in model) { AppUser appUser = new AppUser(); Entitleday_AppUser entitleday_AppUser = new Entitleday_AppUser(); entitleday_AppUser.UserId = appUser.Id; entitleday_AppUser.EntitleDayId = entitleDay.ID; _entitleDayAppUserRepository.Add(entitleday_AppUser); } }
/// <summary> /// Add Entitle Day /// </summary> /// <param name="entitleDay"></param> public void Add(EntitleDay entitleDay) { var model = _userService.GetAll(); foreach (var item in model) { Entitleday_AppUser entitleday_AppUser = new Entitleday_AppUser(); entitleday_AppUser.UserId = item.Id; entitleday_AppUser.EntitleDayId = entitleDay.ID; entitleday_AppUser.MaxEntitleDayAppUser = entitleDay.MaxEntitleDay; _entitleDayAppUserRepository.Add(entitleday_AppUser); } _unitOfWork.Commit(); }
//Create entitle day of user new public void CreateEntitleDayAppUser(AppUser appUser) { var model = _entitleDayService.GetAllType(); foreach (var item in model) { Entitleday_AppUser entitleday_AppUser = new Entitleday_AppUser(); entitleday_AppUser.UserId = appUser.Id; entitleday_AppUser.EntitleDayId = item.ID; if (item.HolidayType == "Authorized Leave") { entitleday_AppUser.MaxEntitleDayAppUser = 0; } else { entitleday_AppUser.MaxEntitleDayAppUser = item.MaxEntitleDay; } _entitleDayAppUserRepository.Add(entitleday_AppUser); } _unitOfWork.Commit(); }
public void Update(Entitleday_AppUser entitleday_AppUser) { _entitleDayAppUserRepository.Update(entitleday_AppUser); }
public void UpdateEntitleDayAppUser(Entitleday_AppUser entitleday_AppUser) { _entitleDayAppUserRepository.Update(entitleday_AppUser); _unitOfWork.Commit(); }