예제 #1
0
 /// <summary>
 /// Delete a list of activities
 /// </summary>
 /// <param name="activities"></param>
 public void Delete(IList <Activity> activities)
 {
     foreach (var activity in activities)
     {
         _activityRepository.Delete(activity);
     }
 }
        public ActionResult DeleteConfirmed(int id)
        {
            activityRepository.Delete(id);
            activityRepository.Save();

            return(RedirectToAction("Index"));
        }
        public bool Delete(long id)
        {
            bool deleted = Repo.Delete(id);

            Unit.SaveChanges();
            return(deleted);
        }
예제 #4
0
 public IActionResult DeleteConfirmed(Activity activity)
 {
     activityRepository.Delete(activity.Id);
     activityRepository.Commit();
     TempData["Message"] = $"Zadanie '{activity.Title}' zostało usunięte.";
     return(RedirectToAction("Index"));
 }
예제 #5
0
        public async Task Delete(long projectId, long activityId)
        {
            await _repoActivity.Delete(activityId);

            var project = await _repoActivity.GetProject(projectId);

            await AfterTransactionActivity(project);
        }
예제 #6
0
        public ICommandResult Handle(ActivityInputDelete command)
        {
            _AREP.Delete(command.Id);
            var result = new StandardResult();

            result.Notifications.Add("Success", "A atividade foi excluida.");
            return(result);
        }
        public void DeleteActivity_id(int id)
        {
            _activityRepository.Delete(1).Returns(true);

            var res = _activityService.DeleteActivity(1);

            Assert.IsTrue(res);
        }
예제 #8
0
        public async Task RemoveUserActivitiesAsync(int id)
        {
            var activities = await _activityRepository.FindByAsync(a => a.CreatorId == id);

            foreach (var act in activities)
            {
                _activityRepository.Delete(act);
            }
        }
예제 #9
0
        public ActionResult Delete(int id)
        {
            _activityRepository.Delete(_activityRepository.Get(id));

            if (_activityRepository.Save())
            {
                return(Ok(new { message = "Successfuly deleted" }));
            }

            return(Ok("eroare"));
        }
        public IActionResult Delete(int id)
        {
            var activity = _activityRepository.Delete(id);

            if (activity != null)
            {
                return(Ok(activity));
            }

            return(BadRequest("Couldn't find the activity you were looking for."));
        }
 public int ActivityDel(string id)
 {
     try
     {
         logger.Debug($"用户对秒杀配置进行删除,删除的配置ID为:{id}");
         return(_activityRepository.Delete(id));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public async Task DeleteAsync(int id)
        {
            var activity = await _activityRepository.GetAsync(id);

            if (activity == null)
            {
                throw new ServiceException(ErrorCodes.ActivityNotFound,
                                           $"task with this id: {activity.Title} not exists.");
            }

            _activityRepository.Delete(activity);
            await _unitOfWork.SaveChangesAsync();
        }
예제 #13
0
        public async Task DeleteActivity(long id)
        {
            await _activityRepository.Delete(id);

            var feedEvents = _feedEventService.GetFeedEvents().Where(e => e.Type == EventType.Activity && e.EventId == id);

            foreach (FeedEvent f in feedEvents)
            {
                await _feedEventService.DeleteFeedEvent(f.Id);
            }
            await _unit.Commit();

            await UpdateGoals();
        }
예제 #14
0
        public void InsertActivity(ApplicationUser user, string activity)
        {
            //Create PDR

            var activities = GetAllActivityUserId(user.Id);

            if (activities.Count() >= 5)
            {
                var firstAct = activities.OrderBy(x => x.DateTimeCreated).FirstOrDefault();
                if (firstAct != null)
                {
                    _ActivityRepository.Delete(firstAct);
                    Save();
                }
            }
            Activity act = new Activity();

            act.ApplicationUser   = user;
            act.ApplicationUserId = user.Id;
            act.Name = activity;
            _ActivityRepository.Add(act);
            Save();
        }
예제 #15
0
        public IActionResult Delete([FromRoute] int id, ActivityViewModel model)
        {
            var activity = _activityRepository.Get(id);

            if (activity == null)
            {
                return(NotFound());
            }

            _telemetryRepository.Delete(id);

            _activityRepository.Delete(id);

            return(RedirectToAction("/Index"));
        }
예제 #16
0
        public void Clean()
        {
            foreach (var id in Activities)
            {
                _AREP.Delete(id);
            }
            _DREP.Delete(Discipline.Id);
            var db = new SqlConnection(new DBConfiguration().StringConnection);

            // Delete Course
            db.Execute("DELETE FROM Course WHERE Id = @Id", new { Id = CourseId });

            // Delete Professor
            sql = "DELETE FROM [Professor] WHERE Id = @Id";
            db.Execute(sql, param: new { professor.Id });

            // Delete User
            sql = "DELETE FROM [User] WHERE Id = @Id";
            db.Execute(sql, param: new { professor.Id });
        }
예제 #17
0
 public async Task <ActionResult> Delete([FromBody] Dto.ActivityForDelete activity)
 {
     if (activity == null)
     {
         return(BadRequest());
     }
     if (activity.Id == null)
     {
         return(BadRequest());
     }
     if (activity.Id == "")
     {
         return(BadRequest());
     }
     Models.Activity activityModel = new Models.Activity {
         Id = activity.Id
     };
     if (await Repo.Delete(activityModel))
     {
         return(Ok());
     }
     return(BadRequest());
 }
예제 #18
0
 public Task <bool> Delete(int Id)
 {
     return(activity.Delete(Id));
 }
예제 #19
0
 public void Delete(int activityId)
 {
     Repository.Delete(activityId);
     UnitOfWork.SaveChanges();
 }
예제 #20
0
 public IActionResult DeleteActivity([FromRoute] Guid id)
 {
     _activityRepository.Delete(id);
     return(new OkResult());
 }
 /*
  * Supprimer une activité
  */
 public bool DeleteActivity(int activityId)
 {
     return(_activityRepository.Delete(activityId));
 }
예제 #22
0
        /// <summary>
        /// 刪除活動
        /// </summary>
        /// <param name="activity"></param>
        public bool Delete(int Id)
        {
            var result = repo.Delete(Id);

            return(result > 0 ? true : false);
        }
예제 #23
0
 public void DeleteActivity(Activity activity)
 {
     _repository.Delete(activity);
 }
예제 #24
0
 public void Delete(IActivityRepository activityRepository)
 {
     activityRepository.Delete(_id);
 }
예제 #25
0
 public void Delete(Guid id)
 {
     _repository.Delete(id);
 }