/// <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); }
public IActionResult DeleteConfirmed(Activity activity) { activityRepository.Delete(activity.Id); activityRepository.Commit(); TempData["Message"] = $"Zadanie '{activity.Title}' zostało usunięte."; return(RedirectToAction("Index")); }
public async Task Delete(long projectId, long activityId) { await _repoActivity.Delete(activityId); var project = await _repoActivity.GetProject(projectId); await AfterTransactionActivity(project); }
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); }
public async Task RemoveUserActivitiesAsync(int id) { var activities = await _activityRepository.FindByAsync(a => a.CreatorId == id); foreach (var act in activities) { _activityRepository.Delete(act); } }
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(); }
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(); }
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(); }
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")); }
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 }); }
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()); }
public Task <bool> Delete(int Id) { return(activity.Delete(Id)); }
public void Delete(int activityId) { Repository.Delete(activityId); UnitOfWork.SaveChanges(); }
public IActionResult DeleteActivity([FromRoute] Guid id) { _activityRepository.Delete(id); return(new OkResult()); }
/* * Supprimer une activité */ public bool DeleteActivity(int activityId) { return(_activityRepository.Delete(activityId)); }
/// <summary> /// 刪除活動 /// </summary> /// <param name="activity"></param> public bool Delete(int Id) { var result = repo.Delete(Id); return(result > 0 ? true : false); }
public void DeleteActivity(Activity activity) { _repository.Delete(activity); }
public void Delete(IActivityRepository activityRepository) { activityRepository.Delete(_id); }
public void Delete(Guid id) { _repository.Delete(id); }