Ejemplo n.º 1
0
 private void ChangeGridColumnHeaderValue()
 {
     if (PriceUnits.ElementAt(SelectedPriceUnitIndex) == "%")
     {
         Column2Header = ApplicationConstants.Percent;
     }
     else
     {
         Column2Header = ApplicationConstants.Prices;
     }
 }
Ejemplo n.º 2
0
        private async Task PriceChangeAsync()
        {
            if (IsAllFieldsEntered())
            {
                if (SelectedPriceIndex >= 0 &&
                    !(StockPriceModel?.SpecialPriceTypes.ElementAt(SelectedPriceIndex)).Equals(ApplicationConstants.RegularPriceText))
                {
                    var ChangePrice = new ChangePrice()
                    {
                        Fromdate           = StockPriceModel.FromDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture),
                        Todate             = StockPriceModel.ToDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture),
                        StockCode          = StockCode,
                        RegisterNumber     = CacheBusinessLogic.RegisterNumber,
                        TillNumber         = CacheBusinessLogic.TillNumber,
                        SaleNumber         = CacheBusinessLogic.SaleNumber,
                        RegularPrice       = decimal.Parse(StockPriceModel.RegularPriceText, CultureInfo.InvariantCulture),
                        IsEndDate          = StockPriceModel.IsEndDateChecked,
                        PerDollarChecked   = PriceUnits.ElementAt(_selectedPriceUnitIndex).Equals("$"),
                        PriceType          = StockPriceModel?.SpecialPriceTypes.ElementAt(SelectedPriceIndex),
                        GridPricesContract = GetGridPrices()
                    };

                    var response = await _stockBussinessLogic.EditPrice(ChangePrice, false);

                    WriteToLineDisplay(response.LineDisplay);
                    MapStockPriceModel(response);
                    EditPrice(false);
                }
                else
                {
                    var ChangePrice = new ChangePrice()
                    {
                        StockCode      = StockCode,
                        RegisterNumber = CacheBusinessLogic.RegisterNumber,
                        TillNumber     = CacheBusinessLogic.TillNumber,
                        SaleNumber     = CacheBusinessLogic.SaleNumber,
                        RegularPrice   = decimal.Parse(StockPriceModel.RegularPriceText, CultureInfo.InvariantCulture)
                    };

                    var response = await _stockBussinessLogic.EditPrice(ChangePrice, true);

                    WriteToLineDisplay(response.LineDisplay);
                    MapStockPriceModel(response);
                    EditPrice(false);
                }
            }
        }