示例#1
0
        public void Save(DisplayPeriod displayPeriod)
        {
            if (_UOW.DisplayPeriodRepository.IsExistById(displayPeriod.ID))
            {
                Edit(displayPeriod);
            }
            else
            {
                Add(displayPeriod);
            }

            _UOW.SaveChanges();
        }
示例#2
0
        public DisplayPeriod GetDisplayPeriod(User user)
        {
            var result = _UOW.DisplayPeriodRepository.GetByEpmloyeeID(user.ID);

            if (result == null)
            {
                DisplayPeriod obj = new DisplayPeriod()
                {
                    EmployeeID = user.ID,
                    ID         = Guid.NewGuid(),
                    IsWeekly   = true,
                };
                result = obj;
            }
            return(result);
        }
示例#3
0
 public void Edit(DisplayPeriod entity)
 {
     _UOW.DisplayPeriodRepository.Edit(entity);
     _UOW.SaveChanges();
 }
示例#4
0
 void Add(DisplayPeriod entity)
 {
     _UOW.DisplayPeriodRepository.Add(entity);
 }