Exemplo n.º 1
0
        public async void SetNotQualify()
        {
            if (SelectedId != 0)
            {
                await CompanyService.SetNotQualified(SelectedId);

                var company = await CompanyService.GetCompany(SelectedId);

                QualifyCompanyModel notQualified = new QualifyCompanyModel {
                    IsQualify = false, CompanyTradingName = company.TradingName
                };
                await AddLog(qualifyCompany : notQualified);
            }
            await TempService.UpdateCompanies();

            TempService.SetId(0);
            Pause();
        }
Exemplo n.º 2
0
        public async Task AddLog(int CompanyId = 0, string WebSite = null, string LinkedinOfTradingName          = null,
                                 QualifyCompanyModel qualifyCompany = null, int count = 0, string LinkedinOfUser = null, string ActionMesage = null)
        {
            if (WebSite != null)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = "Перешел на сайт " + WebSite,
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);

                //Thread.Sleep(3000);
            }
            else if (WebSite == null && CompanyId != 0)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = "Просмотрел компанию " + TempService.AllCompanies.Where(p => p.Id == SelectedId).FirstOrDefault().TradingName,
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);
            }
            else if (LinkedinOfTradingName != null)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = "Просмотрел аккаунт LinkedIn компании  " + LinkedinOfTradingName,
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);
            }
            else if (qualifyCompany != null)
            {
                LogDTO logDTO;
                if (qualifyCompany.IsQualify)
                {
                    logDTO = new LogDTO
                    {
                        Action = "Изменил статус компании " + qualifyCompany.CompanyTradingName + " на Квалифицированный",
                        UserId = TempService.CurrentUser.Id
                    };
                }
                else
                {
                    logDTO = new LogDTO
                    {
                        Action = "Изменил статус компании " + qualifyCompany.CompanyTradingName + " на НЕ квалифицированный",
                        UserId = TempService.CurrentUser.Id
                    };
                }
                await LogService.AddLog(logDTO);
            }
            else if (count != 0)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = "Добавил " + count + " контактов в lemmlist",
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);
            }
            else if (LinkedinOfUser != null)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = "Просмотрел аккаунт LinkedIn пользователя  " + LinkedinOfUser,
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);
            }
            else if (ActionMesage != null)
            {
                LogDTO logDTO = new LogDTO
                {
                    Action = ActionMesage,
                    UserId = TempService.CurrentUser.Id
                };
                await LogService.AddLog(logDTO);
            }
            await TempService.UpdateLogs();

            await RenderUpdate();
        }