Пример #1
0
 public static void ProfessionalContract(ProfessionalGeneral professionalposter, ProfessionalGeneral professionalbidder, ClosedProject cp)
 {
     if (professionalbidder == null) return;
     if (cp.HighestBid == null) return;
     var context = new SidejobEntities();
     if (cp.CurrencyID == null) return;
     var professionalcontract = new ProfessionalContract
     {
         BidderID = professionalbidder.ProID,
         BidderFirstName = professionalbidder.FirstName,
         BidderLastName = professionalbidder.LastName,
         BidderUsername = professionalbidder.UserName,
         ContractDate = DateTime.Now,
         ProjectID = cp.ProjectID,
         ContractID = GetNextContractID(),
         CurrencyID = (int)cp.CurrencyID,
         HighestBid = (double)cp.HighestBid,
         PosterID = professionalposter.ProID,
         PosterUsername = professionalposter.UserName,
         PosterFirstName = professionalposter.FirstName,
         PosterLastName = professionalposter.LastName
     };
     context.AddToProfessionalContracts(professionalcontract);
 }