public void DeleteTitle(int id) { using (IUnitOfWork work = UnitOfWork.Begin()) { Title title = _titleRepository.FindById(id); title.IsDeleted = true; var logTitleEntity = new TitleEventEntity(title); work.Commit(); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, logTitleEntity.GetDeleteMessage()); } }
public void EditTitle(int id, string name, string description, int companyId) { using (IUnitOfWork work = UnitOfWork.Begin()) { Title title = _titleRepository.FindById(id); var logTitleEntity = new TitleEventEntity(title); title.Name = name; title.Description = description; title.CompanyId = companyId; work.Commit(); logTitleEntity.SetNewTitle(_titleRepository.FindById(id)); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, logTitleEntity.GetEditMessage()); } }
public void CreateTitle(string name, string description, int companyId) { using (IUnitOfWork work = UnitOfWork.Begin()) { Title title = DomainObjectFactory.CreateTitle(); title.Name = name; title.Description = description; title.CompanyId = companyId; title.IsDeleted = false; _titleRepository.Add(title); work.Commit(); title = _titleRepository.FindById(title.Id); var logTitleEntity = new TitleEventEntity(title); _logService.CreateLog(CurrentUser.Get().Id, "web", flag, CurrentUser.Get().HostName, CurrentUser.Get().CompanyId, logTitleEntity.GetCreateMessage()); } }