Пример #1
0
        /// <summary>
        /// 删除地区
        /// </summary>
        /// <param name="disciplineCode">地区编码</param>
        public void Delete(string disciplineCode)
        {
            Discipline discipline = Get(disciplineCode);

            EventBus <Discipline> .Instance().OnBefore(discipline, new CommonEventArgs(EventOperationType.Instance().Delete()));

            disciplineRepository.Delete(disciplineCode);
            EventBus <Discipline> .Instance().OnAfter(discipline, new CommonEventArgs(EventOperationType.Instance().Delete()));
        }
Пример #2
0
 public void DeleteDiscipline(Discipline selectedDiscipline)
 {
     using (var scope = Db.BeginWork())
     {
         var baseEntity = _disciplineRepository.Get(u => u.Id == selectedDiscipline.Id);
         if (baseEntity != null)
         {
             _disciplineRepository.Delete(baseEntity);
             scope.SaveChanges();
         }
     }
 }
        public async Task <bool> DeleteDiscipline(int id)
        {
            try
            {
                var dis = await GetDisciplineByID(id);

                _disciplineRepository.Delete(dis);
                await _disciplineRepository.SaveAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }
Пример #4
0
        public ICommandResult Handle(DisciplineInputDelete command)
        {
            _DREP.Delete(command.DisciplineId);
            var result = new StandardResult();

            if (_DREP.Get(command.DisciplineId) != null)
            {
                result.Notifications.Add("Error", "Não foi possivel deletar Discente!");
            }
            else
            {
                result.Notifications.Add("Success", "Discente Deletado");
            }

            return(result);
        }
Пример #5
0
        public void Clean()
        {
            var db = new SqlConnection(new DBConfiguration().StringConnection);

            // Delete Discipline
            _DREP.Delete(discipline.Id);

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

            // 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 });
        }
Пример #6
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 });
        }
Пример #7
0
        public void Clean()
        {
            var db = new SqlConnection(new DBConfiguration().StringConnection);

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

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

            // Delete Discipline
            _DREP.Delete(disciplineCC.Id);

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

            // Delete Student
            _SREP.Delete(student.Id);

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

            // Delete Student
            _SREP.Delete(studentEdit.Id);

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

            // Delete Course
            sql = "DELETE FROM [Course] WHERE Id = @Id";
            db.Execute(sql, param: new { Id = course.CourseId });
        }
Пример #8
0
 public void Delete(int id)
 {
     rep.Delete(id);
 }
Пример #9
0
 /// <summary>
 /// Удаляет дисциплину.
 /// </summary>
 /// <param name="id">Идентификатор.</param>
 public void Delete(int id)
 {
     _disciplineRepository.Delete(id);
 }