Пример #1
0
 public static void CustomerContract(CustomerGeneral customer, CustomerGeneral customerposter, ClosedProject cp)
 {
     if (customer == null) return;
     if (cp.HighestBid == null) return;
     var context = new SidejobEntities();
     if (cp.CurrencyID == null) return;
     var customercontract = new CustomerContract
     {
         ContractID = GetNextContractID(),
         BidderID = customer.CustomerID,
         BidderFirstName = customer.FirstName,
         BidderLastName = customer.LastName,
         BidderUsername = customer.UserName,
         ContractDate = DateTime.Now,
         ProjectID = cp.ProjectID,
         CurrencyID = (int)cp.CurrencyID,
         CustomerID = customer.CustomerID,
         HighestBid = (double)cp.HighestBid,
         PosterID = customerposter.CustomerID,
         PosterUsername = customerposter.UserName,
         PosterFirstName = customerposter.FirstName,
         PosterLastName = customerposter.LastName
     };
     context.AddToCustomerContracts(customercontract);
 }