Exemplo n.º 1
0
        public bool setNewBid(QuoteBidDTO newBid, int companyId)
        {
            //bool result = false;
               QuoteParticipantService newParticipantSupplier = new QuoteParticipantService();
            newParticipantSupplier.CompanyID = companyId;
            newParticipantSupplier.QuoteID = newBid.QuoteID;
            newParticipantSupplier.SetNewParticipant(companyId, newBid.QuoteID);
            using (TransactionScope transaction = new TransactionScope())
            {

                try
                {

                    QuoteParticipant newQuoteParticipant = new QuoteParticipant();
                    QuoteParticipantBase newParticipant;
                    newParticipant = newParticipantSupplier.GetQuoteParticipant(companyId, newBid.QuoteID);
                    newQuoteParticipant.QuoteParticipantID = newParticipant.QuoteParticipantID;
                    QuoteBid newBidToCreate = new QuoteBid()
                    {
                    QuoteParticipantID = newQuoteParticipant.QuoteParticipantID,
                    QuoteID = newBid.QuoteID,
                    Amount = newBid.Amount,
                    Notes = newBid.Notes

                };
                  using (var context = new RFQEntities())
                    {

                        if (newBidToCreate.EntityState == EntityState.Detached)
                        {
                            context.QuoteBids.AddObject(newBidToCreate);
                        }

                        context.SaveChanges();

                    }

                }

                catch (Exception e)
                {
                    transaction.Dispose();
                    return false;

                }
                transaction.Complete();
                return true;

            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the QuoteBids EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToQuoteBids(QuoteBid quoteBid)
 {
     base.AddObject("QuoteBids", quoteBid);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new QuoteBid object.
 /// </summary>
 /// <param name="quoteBidID">Initial value of the QuoteBidID property.</param>
 /// <param name="quoteID">Initial value of the QuoteID property.</param>
 /// <param name="quoteParticipantID">Initial value of the QuoteParticipantID property.</param>
 /// <param name="amount">Initial value of the Amount property.</param>
 public static QuoteBid CreateQuoteBid(global::System.Int32 quoteBidID, global::System.Int32 quoteID, global::System.Int32 quoteParticipantID, global::System.Decimal amount)
 {
     QuoteBid quoteBid = new QuoteBid();
     quoteBid.QuoteBidID = quoteBidID;
     quoteBid.QuoteID = quoteID;
     quoteBid.QuoteParticipantID = quoteParticipantID;
     quoteBid.Amount = amount;
     return quoteBid;
 }