public CommonResponce Delete(Classroom ClassroomToDelete) { CommonResponce result = new CommonResponce(); bool isValid = false; try { _commonRepository.Delete(_mapper.Map <Tblmclassroom>(ClassroomToDelete)); result.Stat = true; result.StatusMsg = "Classroom deleted successfully"; } catch { result.Stat = isValid; result.StatusMsg = "Failed to delete classroom information"; } return(result); }
public async Task <CommonResponce> DeleteTeacherProfile(int TeacherId) { CommonResponce result = new CommonResponce() { Stat = false, StatusMsg = "Error in deleting Student" }; try { var oTeacher = await _DBTeacherRepository.GetTeacherByTeacherId(TeacherId).ConfigureAwait(false); // get teacher details from db if (oTeacher != null) // Teacher found { _commonRepository.Delete(oTeacher); result.Stat = true; result.StatusMsg = "Teacher deleted successfully"; } else { result.StatusMsg = "Not a valid Teacher"; } } catch { result.StatusMsg = "Failed to delete Teacher"; } return(result); }
public async Task <CommonResponce> DeleteSubject(int SubjectId) { CommonResponce result = new CommonResponce() { Stat = false, StatusMsg = "Error in deleting Subject" }; try { var oSubject = await _DBSubjectRepository.GetSubjectBySubjectId(SubjectId).ConfigureAwait(false); // get subject details from db if (oSubject != null) // subject found { _commonRepository.Delete(oSubject); result.Stat = true; result.StatusMsg = "Subject deleted successfully"; } else { result.StatusMsg = "Not a valid Subject"; } } catch { result.StatusMsg = "Failed to delete Subject"; } return(result); }
public bool Delete(Shift item) { var activitiesToDelete = _activitiesRelationshipRepository.All.Where(i => i.ShiftId == item.Id).FirstOrDefault(); _activitiesRelationshipRepository.Delete(activitiesToDelete); return(_shiftRepository.Delete(item) > 0); }
public DbObjectDTO Delete(Tkey id) { DbObject dbObject = repository.GetObjInstance(id); repository.Delete(id); repository.Save(); return(_mapper.Map <DbObjectDTO>(dbObject)); }
/// <summary> ///删除 /// </summary> /// <param name="id">要删除的数据id</param> public bool Delete <T>(dynamic id) { ResultView rv = respository.Delete <T>(id); if (rv.Result == 1) { return(true); } return(false); }
public CommonResponce Delete(StudentClassroom StudentClassroomToDelete) { CommonResponce result = new CommonResponce(); bool isValid = false; try { _commonRepository.Delete(_mapper.Map <Tblrstudentclassroom>(StudentClassroomToDelete)); result.Stat = true; result.StatusMsg = "Student assignment to Classroom deleted successfully"; } catch { result.Stat = isValid; result.StatusMsg = "Failed to delete Student assignment to Classroom"; } return(result); }
public void DeleteTag(int id) { try { _repository.MaybeAs <IManagmentEntityWithUser>().Do((c) => c.SetUser(_currentUser)); _repository.Delete(new Tag { Id = id }); _logger.Trace(string.Format("Тэг с идентификатором {0} успешно удален", id)); } catch (Exception ex) { _logger.TraceError(MethodBase.GetCurrentMethod().Name, ex); throw; } }
public async Task <CommonResponce> DeleteStandard(int Id) { CommonResponce result = new CommonResponce { Stat = false, StatusMsg = "Error in deleting Standard" }; try { var oStandard = await _DBStandardMasterRepository.GetStandardByStandardID(Id).ConfigureAwait(false); if (oStandard != null) { _commonRepository.Delete(oStandard); result.Stat = true; result.StatusMsg = "Standard deleted successfully"; } } catch { } return(result); }
public void DeleteArticle(Article article, GroupService service = null) { try { if (service != null) { var group = service.GetGroupsByParams(c => c.Groups.Contains(article.ArticleName), c => c.GroupId); foreach (var articleGroup in group) { articleGroup.Groups.Remove(article.ArticleName); service.UpdateGroup(articleGroup); } } _logger.Trace(string.Format("Метод {0}.Производиться удаление статьи. Идентификатор статьи: {1}", MethodBase.GetCurrentMethod().Name, article.ArticleId)); _repository.MaybeAs <IManagmentEntityWithUser>().Do((c) => c.SetUser(_currentUser)); _repository.Delete(article); } catch (Exception ex) { _logger.TraceError(MethodBase.GetCurrentMethod().Name, ex); throw; } }
public bool Delete(Member item) { return(_memberRepository.Delete(item) > 0); }
public bool Delete(Activity item) { return(_activityRepository.Delete(item) > 0); }
public void DeleteGroup(ArticleGroup @group) { _repository.MaybeAs <IManagmentEntityWithUser>().Do((c) => c.SetUser(_currentUser)); _repository.Delete(group); }
public void DeletePlan(IPlan plan) { _repository.MaybeAs <IManagmentEntityWithUser>().Do((c) => c.SetUser(_currentUser)); _repository.Delete(plan); }
public virtual bool Delete(T entity) { return(_repository.Delete(entity)); }
public int Delete(TEntity entity) { return(service.Delete(entity)); }
public bool Delete(Category item) { return(_categoryRepository.Delete(item) > 0); }