public bool OfferAcceptance(OfferModel model, Int64 merchantId, Int64 contractId, int iscompleted) { #region Insert list of offers string profileXml = string.Empty; if (model != null) { XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.CloseOutput = true; settings.OmitXmlDeclaration = false; StringBuilder sbXml = new StringBuilder(); XmlWriter writer = XmlWriter.Create(sbXml, settings); writer.WriteStartElement("merchantinfo"); writer.WriteStartElement("offers"); writer.WriteAttributeString("insertuserId", Convert.ToString(model.insertuserId)); writer.WriteAttributeString("loanAmount", Convert.ToString(model.loanAmount)); writer.WriteAttributeString("monthlyPayment", Convert.ToString(model.monthlyPayment)); writer.WriteAttributeString("offerAcceptanceDate", Convert.ToString(model.offerAcceptanceDate)); writer.WriteAttributeString("offerCreationDate", Convert.ToString(model.offerCreationDate)); writer.WriteAttributeString("offerexpirationDate", Convert.ToString(model.offerexpirationDate)); writer.WriteAttributeString("offerId", Convert.ToString(model.offerId)); writer.WriteAttributeString("ownedAmount", Convert.ToString(model.ownedAmount)); writer.WriteAttributeString("proportion", Convert.ToString(model.proportion)); writer.WriteAttributeString("retention", Convert.ToString(model.retention)); writer.WriteAttributeString("salestaken", Convert.ToString(model.salestaken)); writer.WriteAttributeString("turn", Convert.ToString(model.turn)); writer.WriteAttributeString("yearly", Convert.ToString(model.yearly)); writer.WriteAttributeString("IsSelected", Convert.ToString(model.IsSelected)); writer.WriteEndElement(); writer.WriteEndElement(); writer.Flush(); profileXml = sbXml.ToString(); Logger.LogMessage(profileXml); Logger.LogMessage("Contract Id: " + contractId); Logger.LogMessage("Merchant Id: " + merchantId); } return new DataAccess.DataAccess().ExecuteNonQuery("avz_cc_OfferAcceptance", new { dataxml = profileXml, merchantid = merchantId, contractid = contractId } ); #endregion }
public MerchantOffer RetrieveMerchantOffer(Int64 merchantId, Int64 contractId) { DataSet dsMoffer = new DataAccess.DataAccess().ExecuteDataSet("avz_mcr_merchantOffer", new { merchantId = merchantId, contractId = contractId }); var merchantOffer = new MerchantOffer(); if (dsMoffer.Tables[0].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Merchant, dsMoffer.Tables[0].Rows[0]); if (dsMoffer.Tables[1].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Merchant.Address, dsMoffer.Tables[1].Rows[0]); if (dsMoffer.Tables[2].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Owner, dsMoffer.Tables[2].Rows[0]); if (dsMoffer.Tables[3].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Owner.Address, dsMoffer.Tables[3].Rows[0]); if (dsMoffer.Tables[4].Rows.Count > 0) DataHelper.FillObjectFromDataRow(merchantOffer.Contract, dsMoffer.Tables[4].Rows[0]); if (dsMoffer.Tables[5].Rows.Count > 0) foreach (DataRow r in dsMoffer.Tables[5].Rows) { var offer = new OfferModel(); DataHelper.FillObjectFromDataRow(offer, r); merchantOffer.Offers.Add(offer); } return merchantOffer; }
public bool OfferAcceptance(OfferModel model, Int64 merchantId, Int64 contractId, int iscompleted) { return _creditRepository.OfferAcceptance(model, merchantId, contractId, iscompleted); }