Exemple #1
0
        public static UserOperationCodeDefineRepository GetUserOperationCodeDefineRepository(IUnitOfWork unitOfWork)
        {
            var repository = new UserOperationCodeDefineRepository();

            repository.UnitOfWork = unitOfWork;
            return(repository);
        }
        public override void Add(UserOperationLog entity)
        {
            try
            {
                if (entity == null)
                {
                    throw new ArgumentNullException("entity");
                }

                var logdefined = UserOperationCodeDefineRepository.Get(entity.OpreationCode);

                if (logdefined == null)
                {
                    UserOperationCodeDefineRepository.Add(new UserOperationCodeDefine()
                    {
                        Description        = "自動產生",
                        MessageResourceKey = "",
                        OpreationCode      = entity.OpreationCode
                    });
                }
                base.Add(entity);
                UnitOfWork.Commit();
            }
            catch (Exception)
            {
                throw;
            }
        }