public void InsertDuplicateRecord(DuplicateRecord select)
 {
     using (LoanPriceEntities context = new LoanPriceEntities())
     {
         context.AddToDuplicateRecords(select);
     }
 }
Exemplo n.º 2
0
        private void InsertDuplicateRecord()
        {
            try
            {
                DuplicateRecord model = new DuplicateRecord();

                if (!string.IsNullOrEmpty(txtBidPriceA.Text))
                {
                    model.BidPrice = Convert.ToDecimal(txtBidPriceA.Text);
                }
                if (!string.IsNullOrEmpty(txtBidSpreadA.Text))
                {
                    string strBidSpread = Convert.ToDecimal(txtBidSpreadA.Text).ToString("0.00");
                    model.BidSpread = Convert.ToDecimal(strBidSpread);
                }
                model.CounterParty = ddlCounterPartyA.SelectedValue;
                model.LoanName = txtLoanNameA.Text;
                if (!string.IsNullOrEmpty(txtOfferPriceA.Text))
                {
                    model.OfferPrice = Convert.ToDecimal(txtOfferPriceA.Text);
                }
                if (!string.IsNullOrEmpty(txtOfferSpreadA.Text))
                {
                    string strOfferSpread = Convert.ToDecimal(txtOfferSpreadA.Text).ToString("0.00");
                    model.OfferSpread = Convert.ToDecimal(strOfferSpread);
                }
                // model.MarketValue
                model.TimeStamp = DateTime.UtcNow;
                model.Traded = chkBoxTradedA.Checked;
                if (txtLoanNameA.SelectedValue != string.Empty)
                {
                    LoansBLL loanBLL = new LoansBLL();
                    model.Country = loanBLL.GetCoutryIDbyLoanID(txtLoanNameA.SelectedValue);
                }
                // model.CountryID = Convert.ToInt32(ddlRegionA.SelectedValue);

                //need to ask whether to keep this lines or not?
                //List<QuotesAndTrades> lst = new List<QuotesAndTrades>();
                //lst.Add(model);
                QuotesAndTradesBLL bll = new QuotesAndTradesBLL();

                bll.InsertDuplicateRecord(model);

            }
            catch (Exception ex)
            {
                lblTradeQuoteStatusC.Text = "Error in saving";
                LogActivity("Quote and Loan A added(Unsuccessfull)", "Unable to add the quote and trade", ex.Message);
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the DuplicateRecords EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDuplicateRecords(DuplicateRecord duplicateRecord)
 {
     base.AddObject("DuplicateRecords", duplicateRecord);
 }
 /// <summary>
 /// Create a new DuplicateRecord object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static DuplicateRecord CreateDuplicateRecord(global::System.Int32 id)
 {
     DuplicateRecord duplicateRecord = new DuplicateRecord();
     duplicateRecord.ID = id;
     return duplicateRecord;
 }