public ActionResult UpdateLot(LotUpdateModel updatingLot)
        {
            if (ModelState.IsValid == false)
            {
                return(View(updatingLot));
            }

            if (updatingLot.UpdatingDateOfAuction < updatingLot.DateOfAuction)
            {
                ModelState.AddModelError("", "Updating date Of auction should be no earlier than already declared");
                return(View(updatingLot));
            }

            var lotForUpdate = new BLLLot()
            {
                Id              = updatingLot.Id,
                DateOfAuction   = updatingLot.UpdatingDateOfAuction,
                Description     = updatingLot.Description,
                MinimalStepRate = updatingLot.MinimalStepRate
            };

            _crudLotService.UpdateLot(lotForUpdate);

            return(RedirectToAction("Lot", "LotManager", new { id = updatingLot.Id }));
        }
 public LotUpdateModel(BLLLot bllLot)
 {
     Id                    = bllLot.Id;
     ArtworkName           = bllLot.ArtworkName;
     Author                = bllLot.Author;
     Description           = bllLot.Description;
     Photos                = bllLot.Photos;
     StartingPrice         = bllLot.StartingPrice;
     YearOfCreation        = bllLot.YearOfCreation;
     MinimalStepRate       = bllLot.MinimalStepRate;
     DateOfAuction         = bllLot.DateOfAuction;
     ArtworkFormat         = bllLot.ArtworkFormat;
     UpdatingDateOfAuction = bllLot.DateOfAuction;
 }
Exemplo n.º 3
0
 public LotViewModel(BLLLot lot)
 {
     Id              = lot.Id;
     Photos          = lot.Photos;
     Author          = lot.Author;
     UserOwnerId     = lot.UserOwnerId;
     ArtworkFormat   = lot.ArtworkFormat;
     CurrentBuyerId  = lot.CurrentBuyerId;
     CurrentPrice    = lot.CurrentPrice;
     DateOfAuction   = lot.DateOfAuction;
     Description     = lot.Description;
     MinimalStepRate = lot.MinimalStepRate;
     RatesCount      = lot.RatesCount;
     StartingPrice   = lot.StartingPrice;
     YearOfCreation  = lot.YearOfCreation;
     ArtworkName     = lot.ArtworkName;
     UsersLotsRates  = lot.UsersLotsRates;
 }
        private BLLLot BuildBllLot(LotCreateModel newLot, int userId)
        {
            var bllLot = new BLLLot
            {
                ArtworkName     = newLot.ArtworkName,
                Author          = newLot.Author,
                Photos          = newLot.Photos,
                ArtworkFormat   = newLot.ArtworkFormat,
                Description     = newLot.Description,
                YearOfCreation  = newLot.YearOfCreation,
                StartingPrice   = newLot.StartingPrice,
                MinimalStepRate = newLot.MinimalStepRate,
                DateOfAuction   = newLot.DateOfAuction,
                CurrentPrice    = newLot.StartingPrice,
                UserOwnerId     = userId
            };

            return(bllLot);
        }
Exemplo n.º 5
0
 public static Lot ToLot(this BLLLot lot)
 {
     return(new Lot
     {
         Id = lot.Id,
         Photos = lot.Photos,
         Author = lot.Author,
         UserId = lot.UserOwnerId,
         ArtworkFormat = lot.ArtworkFormat,
         CurrentBuyerId = lot.CurrentBuyerId,
         CurrentPrice = lot.CurrentPrice,
         DateOfAuction = lot.DateOfAuction,
         Description = lot.Description,
         MinimalStepRate = lot.MinimalStepRate,
         RatesCount = lot.RatesCount,
         StartingPrice = lot.StartingPrice,
         YearOfCreation = lot.YearOfCreation,
         ArtworkName = lot.ArtworkName
     });
 }
 public void UpdateLot(BLLLot lot)
 {
     _repositoryFactory.LotRepository.UpdateDescriptionDateStepOfLot(lot.ToLot());
 }
 public void CreateLot(BLLLot lot)
 {
     _repositoryFactory.LotRepository.CreateLot(lot.ToLot());
 }