Пример #1
0
        public void Add(IEnumerable <ReportDto> reportdto)
        {
            try
            {
                List <ReportEntity> newReportList = new List <ReportEntity>();

                reportdto.ToList().ForEach(e =>
                {
                    newReportList.Add(ReportEntity.Create(_mapper.Map <ReportDto, ReportEntity>(e)));
                });

                if (newReportList != null)
                {
                    _reportRepository.AddReport(newReportList);
                    _rALUnitOfWork.Save();

                    newReportList.ToList().ForEach(e =>
                    {
                        logCentral.Info(string.Format("Report {0} has been created", e.id));
                    });
                }
                else
                {
                    logCentral.Info("Create Report: Invalid Role information");
                }
            }
            catch (Exception ex)
            {
                logCentral.Error("Create Report", ex);
                throw;
            }
        }
Пример #2
0
        public void AddLastLogin(LastLoginDto lastlogindto)
        {
            try
            {
                LastLoginEntity newLastLogin = LastLoginEntity.Create(_mapper.Map <LastLoginDto, LastLoginEntity>(lastlogindto));
                if (newLastLogin != null)
                {
                    _loginRepository.AddLastLogin(newLastLogin);
                }
                else
                {
                    logCentral.Info("Create User Profile: Invalid User Profile information");
                }
                //LastLoginEntity lastLoginEntity = new LastLoginEntity();
                //lastLoginEntity.username = lastlogindto.username;
                //lastLoginEntity.jda_connection = lastlogindto.jda_connection;
                //lastLoginEntity.jda_connection_id = lastlogindto.jda_connection_id;

                //_loginRepository.AddLastLogin(lastLoginEntity);
            }
            catch (Exception ex)
            {
                logCentral.Error("Create Report", ex);
                throw;
            }
        }