Example #1
0
 public ActionResult Edit(BidWinner bidWinner)
 {
     if (ModelState.IsValid)
     {
         _bidWinnerService.EditBidWinner(bidWinner);
         return(RedirectToAction("Index"));
     }
     return(View(bidWinner));
 }
Example #2
0
 public bool DeleteBidWinner(BidWinner bidWinner)
 {
     if (bidWinner == null)
     {
         return(false);
     }
     _unitOfWork.BidWinnerRepository.Delete(bidWinner);
     _unitOfWork.Save();
     return(true);
 }
Example #3
0
 public bool Disqualified(BidWinner bidWinner)
 {
     if (bidWinner != null)
     {
         bidWinner.Status = (int)BidWinnerStatus.Disqualified;
         _unitOfWork.BidWinnerRepository.Edit(bidWinner);
         _unitOfWork.Save();
         return(true);
     }
     return(false);
 }
Example #4
0
        public List <BidWinner> TransformBidQuotationToBidWinner(List <TransportBidQuotation> proposals, int rank)
        {
            var winners = new List <BidWinner>();

            foreach (var proposal in proposals)
            {
                var winner = new BidWinner();
                winner.SourceID      = proposal.SourceID;
                winner.DestinationID = proposal.DestinationID;
                winner.BidID         = proposal.BidID;
                winner.CommodityID   = 1;
                winner.TransporterID = proposal.TransporterID;
                winner.Amount        = 0;
                winner.Tariff        = proposal.Tariff;
                winner.Position      = rank;
                winner.Status        = 1;
                winner.ExpiryDate    = DateTime.Today;
                winner.BidWinnerID   = 0;

                winners.Add(winner);
            }
            return(winners);
        }
Example #5
0
 public bool EditBidWinner(BidWinner bidWinner)
 {
     _unitOfWork.BidWinnerRepository.Edit(bidWinner);
     _unitOfWork.Save();
     return(true);
 }
Example #6
0
 public bool AddBidWinner(BidWinner bidWinner)
 {
     _unitOfWork.BidWinnerRepository.Add(bidWinner);
     _unitOfWork.Save();
     return(true);
 }