Ejemplo n.º 1
0
        public void SaveDbVintages()
        {
            string queueAzureConnString = ConfigurationManager.AppSettings["QueueAzureConnString"];
            string queueName            = ConfigurationManager.AppSettings["QueueName"];
            var    user = manager.FindByEmail("*****@*****.**");

            var vintagesDto = SellOneVintage(user);

            // Mark for selling earliest and latest available vintages even if sold or locked
            var earliestVin = vintagesDto
                              .OrderBy(v => v.YearMonthStr)
                              .First();

            earliestVin.Selected = true;
            var latestVin = vintagesDto
                            .OrderByDescending(v => v.YearMonthStr)
                            .First();

            latestVin.Selected = true;

            invBalanceRepo.SetAllSelectedVintagesPresentMarketValue(user.Id, vintagesDto);

            invBalanceRepo
            .SaveDbSellAllSelectedVintagesInTransRetry(
                user.Id,
                vintagesDto,
                false,
                queueAzureConnString,
                queueName,
                null,
                null,
                null
                );
        }
Ejemplo n.º 2
0
        private void SellVintages(int caseNo, string currentYearMonthStr, ICollection <VintageDto> userVintages, int userId)
        {
            switch (caseNo)
            {
            // case 1 : No sold vintages
            case 2:
                SetCaseVintagesToSell_2(currentYearMonthStr, userVintages);
                break;

            case 3:
                SetCaseVintagesToSell_3(currentYearMonthStr, userVintages);
                break;

            case 4:
                SetCaseVintagesToSell_4(currentYearMonthStr, userVintages);
                break;
            }
            invBalRepo.SaveDbSellAllSelectedVintagesInTransRetry(userId, userVintages, false, null, null, null, null, null, currentYearMonthStr);
        }