Exemplo n.º 1
0
        private void DefaultParametrs(LotEF lot = null, bool refresh = false)
        {
            if (!refresh)
            {
                UnitList = DataBaseClient.ReadUnits();
            }

            if (lot == null)
            {
                Lot               = new LotEF();
                Lot.auctionid     = _auctionId;
                Lot.number        = DataBaseClient.ReadAuction(_auctionId).siteid == 4 ? "0G" : "";
                Lot.deliveryplace = "Согласно договору";
                Lot.deliverytime  = "Согласно договору";
                Lot.paymentterm   = "Согласно договору";
                Lot.step          = 1;
                Lot.warranty      = 0.1;
                SelectedUnit      = UnitList[0];
            }
            else
            {
                try {
                    SelectedUnit = UnitList.FirstOrDefault(x => x.id == lot.unitid);
                } catch (Exception) {
                    SelectedUnit = UnitList[0];
                }

                Quantity = Lot.amount;
                Price    = Lot.price;
                Sum      = Lot.sum;
                Lot      = Lot;
            }
        }