示例#1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the C6_40tblDealExpenses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToC6_40tblDealExpenses(C6_40tblDealExpenses c6_40tblDealExpenses)
 {
     base.AddObject("C6_40tblDealExpenses", c6_40tblDealExpenses);
 }
示例#2
0
        private static int? ImportDealExpense(CookieCollection cookies, C6_40tblDealExpenses dealExpense, int dealId, out string resp)
        {
            int? dealExpenseId = null;
            resp = string.Empty;
            DealClosingCostModel model = new DealClosingCostModel();
            model.DealId = dealId;
            model.Amount = (decimal)dealExpense.Amount;
            model.Date = dealExpense.Date;

            if (model.Amount > 0) {

                DealClosingCostType defaultClosingCostType = Globals.DealClosingCostTypes.Where(x => x.Name.Equals(Globals.LegalFee)).FirstOrDefault();

                DealClosingCostType dclosingCostType = Globals.DealClosingCostTypes.Where(x => x.Name.Equals(dealExpense.Description)).FirstOrDefault();
                if (dclosingCostType != null) {
                    model.DealClosingCostTypeId = Globals.DealClosingCostTypes.Where(x => x.Name.Equals(dealExpense.Description)).SingleOrDefault().DealClosingCostTypeID;
                }
                else {
                    model.DealClosingCostTypeId = defaultClosingCostType.DealClosingCostTypeID;
                }

                NameValueCollection formValues = HttpWebRequestUtil.SetUpForm(model, string.Empty, string.Empty);

                // Send the request
                string url = HttpWebRequestUtil.GetUrl("Deal/CreateDealExpense");
                string data = HttpWebRequestUtil.ToFormValue(formValues);
                messageLog.AppendLine("Form Data:" + data);
                byte[] postData = System.Text.Encoding.ASCII.GetBytes(data);
                HttpWebResponse response = HttpWebRequestUtil.SendRequest(url, postData, true, cookies);
                if (response.StatusCode == System.Net.HttpStatusCode.OK) {
                    using (Stream receiveStream = response.GetResponseStream()) {
                        // Pipes the stream to a higher level stream reader with the required encoding format.
                        using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8)) {
                            resp = readStream.ReadToEnd();
                            messageLog.AppendLine("Response: " + resp);
                            dealExpenseId = HttpWebRequestUtil.GetNewKeyFromResponse(resp);
                            response.Close();
                            readStream.Close();
                        }
                    }
                }
            }
            return dealExpenseId;
        }
示例#3
0
 /// <summary>
 /// Create a new C6_40tblDealExpenses object.
 /// </summary>
 /// <param name="transactionID">Initial value of the TransactionID property.</param>
 /// <param name="amberbrookFundNo">Initial value of the AmberbrookFundNo property.</param>
 /// <param name="amberbrookDealNo">Initial value of the AmberbrookDealNo property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="amount">Initial value of the Amount property.</param>
 /// <param name="sSMA_TimeStamp">Initial value of the SSMA_TimeStamp property.</param>
 public static C6_40tblDealExpenses CreateC6_40tblDealExpenses(global::System.Int32 transactionID, global::System.String amberbrookFundNo, global::System.Int32 amberbrookDealNo, global::System.DateTime date, global::System.Double amount, global::System.Byte[] sSMA_TimeStamp)
 {
     C6_40tblDealExpenses c6_40tblDealExpenses = new C6_40tblDealExpenses();
     c6_40tblDealExpenses.TransactionID = transactionID;
     c6_40tblDealExpenses.AmberbrookFundNo = amberbrookFundNo;
     c6_40tblDealExpenses.AmberbrookDealNo = amberbrookDealNo;
     c6_40tblDealExpenses.Date = date;
     c6_40tblDealExpenses.Amount = amount;
     c6_40tblDealExpenses.SSMA_TimeStamp = sSMA_TimeStamp;
     return c6_40tblDealExpenses;
 }