public bool UpdateFixedIncomePortfolio(FixedIncomeVo fixedIncomeVo, int userId) { bool bResult = false; FixedIncomeDao fixedIncomeDao = new FixedIncomeDao(); try { bResult = fixedIncomeDao.UpdateFixedIncomePortfolio(fixedIncomeVo, userId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "FixedIncomeBo.cs:UpdateFixedIncomePortfolio()"); object[] objects = new object[2]; objects[0] = fixedIncomeVo; objects[1] = userId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }
public FixedIncomeVo GetFixedIncomePortfolio(int portfolioId) { FixedIncomeVo fixedIncomeVo = new FixedIncomeVo(); FixedIncomeDao fixedIncomeDao = new FixedIncomeDao(); try { fixedIncomeVo = fixedIncomeDao.GetFixedIncomePortfolio(portfolioId); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "FixedIncomeBo.cs:GetFixedIncomePortfolio()"); object[] objects = new object[1]; objects[0] = portfolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(fixedIncomeVo); }
public List <FixedIncomeVo> GetFixedIncomePortfolioList(int portfolioId, string SortOrder) { List <FixedIncomeVo> FixedIncomeList = null; FixedIncomeVo fixedincomeVo; Database db; DbCommand getFixedIncomePortfolioListCmd; DataSet dsGetFixedIncomePortfolioList; DataTable dtGetFixedIncomePortfolioList; try { db = DatabaseFactory.CreateDatabase("wealtherp"); getFixedIncomePortfolioListCmd = db.GetStoredProcCommand("SP_GetFixedIncomeList"); db.AddInParameter(getFixedIncomePortfolioListCmd, "@CP_PortfolioId", DbType.Int32, portfolioId); //db.AddInParameter(getFixedIncomePortfolioListCmd, "@CurrentPage", DbType.Int32, CurrentPage); db.AddInParameter(getFixedIncomePortfolioListCmd, "@SortOrder", DbType.String, SortOrder); dsGetFixedIncomePortfolioList = db.ExecuteDataSet(getFixedIncomePortfolioListCmd); if (dsGetFixedIncomePortfolioList.Tables[0].Rows.Count > 0) { dtGetFixedIncomePortfolioList = dsGetFixedIncomePortfolioList.Tables[0]; FixedIncomeList = new List <FixedIncomeVo>(); foreach (DataRow dr in dtGetFixedIncomePortfolioList.Rows) { fixedincomeVo = new FixedIncomeVo(); fixedincomeVo.FITransactionId = int.Parse(dr["CFINP_FINPId"].ToString()); fixedincomeVo.AccountId = int.Parse(dr["CFIA_AccountId"].ToString()); fixedincomeVo.AssetInstrumentCategoryCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString(); fixedincomeVo.AssetInstrumentCategoryName = dr["PAIC_AssetInstrumentCategoryName"].ToString(); fixedincomeVo.AssetGroupCode = dr["PAG_AssetGroupCode"].ToString(); fixedincomeVo.DebtIssuerCode = dr["XDI_DebtIssuerCode"].ToString(); fixedincomeVo.InterestBasisCode = dr["XIB_InterestBasisCode"].ToString(); fixedincomeVo.CompoundInterestFrequencyCode = dr["XF_CompoundInterestFrequencyCode"].ToString(); fixedincomeVo.InterestPayableFrequencyCode = dr["XF_InterestPayableFrequencyCode"].ToString(); fixedincomeVo.Name = dr["CFINP_Name"].ToString(); fixedincomeVo.PrinciaplAmount = float.Parse(dr["CFINP_PrincipalAmount"].ToString()); fixedincomeVo.InterestAmtPaidOut = float.Parse(dr["CFINP_InterestAmtPaidOut"].ToString()); fixedincomeVo.InterestAmtAccumulated = float.Parse(dr["CFINP_InterestAmtAcculumated"].ToString()); fixedincomeVo.InterestRate = float.Parse(dr["CFINP_InterestRate"].ToString()); fixedincomeVo.PurchasePrice = float.Parse(dr["CFINP_PurchasePrice"].ToString()); fixedincomeVo.PurchaseValue = float.Parse(dr["CFINP_PurchaseValue"].ToString()); if (dr["CFINP_PurchaseDate"].ToString() != String.Empty) { fixedincomeVo.PurchaseDate = DateTime.Parse(dr["CFINP_PurchaseDate"].ToString()); } if (dr["CFINP_MaturityDate"].ToString() != String.Empty) { fixedincomeVo.MaturityDate = DateTime.Parse(dr["CFINP_MaturityDate"].ToString()); } fixedincomeVo.MaturityValue = double.Parse(dr["CFINP_MaturityValue"].ToString()); fixedincomeVo.IsInterestAccumulated = int.Parse(dr["CFINP_IsInterestAccumulated"].ToString()); fixedincomeVo.CurrentPrice = float.Parse(dr["CFINP_CurrentPrice"].ToString()); fixedincomeVo.CurrentValue = float.Parse(dr["CFINP_CurrentValue"].ToString()); fixedincomeVo.AccountNum = dr["CFIA_AccountNum"].ToString(); fixedincomeVo.DebtIssuerName = dr["XDI_DebtIssuerName"].ToString(); FixedIncomeList.Add(fixedincomeVo); } } //if (dsGetFixedIncomePortfolioList.Tables[1] != null && dsGetFixedIncomePortfolioList.Tables[1].Rows.Count > 0) // Count = Int32.Parse(dsGetFixedIncomePortfolioList.Tables[1].Rows[0][0].ToString()); //else // Count = 0; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "FixedIncomeDao.cs:GetFixedIncomePortfolioList()"); object[] objects = new object[1]; objects[0] = portfolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(FixedIncomeList); }
public FixedIncomeVo GetFixedIncomePortfolio(int portfolioId) { FixedIncomeVo fixedIncomeVo = null; Database db; DbCommand getFixedIncomePortfolioCmd; DataSet dsGetFixedIncomePortfolio; DataRow dr; try { db = DatabaseFactory.CreateDatabase("wealtherp"); getFixedIncomePortfolioCmd = db.GetStoredProcCommand("SP_GetFixedIncomeNetPosition"); db.AddInParameter(getFixedIncomePortfolioCmd, "@CFINP_FINPId", DbType.Int32, portfolioId); dsGetFixedIncomePortfolio = db.ExecuteDataSet(getFixedIncomePortfolioCmd); if (dsGetFixedIncomePortfolio.Tables[0].Rows.Count > 0) { fixedIncomeVo = new FixedIncomeVo(); dr = dsGetFixedIncomePortfolio.Tables[0].Rows[0]; fixedIncomeVo.FITransactionId = int.Parse(dr["CFINP_FINPId"].ToString()); fixedIncomeVo.AccountId = int.Parse(dr["CFIA_AccountId"].ToString()); fixedIncomeVo.AssetGroupCode = dr["PAG_AssetGroupCode"].ToString(); fixedIncomeVo.AssetInstrumentCategoryCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString(); fixedIncomeVo.CompoundInterestFrequencyCode = dr["XF_CompoundInterestFrequencyCode"].ToString(); fixedIncomeVo.CurrentPrice = float.Parse(dr["CFINP_CurrentPrice"].ToString()); fixedIncomeVo.CurrentValue = float.Parse(dr["CFINP_CurrentValue"].ToString()); fixedIncomeVo.DebentureNum = int.Parse(dr["CFINP_DebentureNum"].ToString()); fixedIncomeVo.DebtIssuerCode = dr["XDI_DebtIssuerCode"].ToString(); fixedIncomeVo.DepositFrequencyCode = dr["XF_DepositFrquencycode"].ToString(); fixedIncomeVo.FaceValue = float.Parse(dr["CFINP_FaceValue"].ToString()); fixedIncomeVo.InterestAmtAccumulated = float.Parse(dr["CFINP_InterestAmtAcculumated"].ToString()); fixedIncomeVo.InterestAmtPaidOut = float.Parse(dr["CFINP_InterestAmtPaidOut"].ToString()); fixedIncomeVo.InterestBasisCode = dr["XIB_InterestBasisCode"].ToString(); fixedIncomeVo.InterestPayableFrequencyCode = dr["XF_InterestPayableFrequencyCode"].ToString(); fixedIncomeVo.InterestRate = float.Parse(dr["CFINP_InterestRate"].ToString()); fixedIncomeVo.IsInterestAccumulated = int.Parse(dr["CFINP_IsInterestAccumulated"].ToString()); if (dr["CFINP_IssueDate"].ToString() != String.Empty) { fixedIncomeVo.IssueDate = DateTime.Parse(dr["CFINP_IssueDate"].ToString()); } if (dr["CFINP_MaturityDate"].ToString() != String.Empty) { fixedIncomeVo.MaturityDate = DateTime.Parse(dr["CFINP_MaturityDate"].ToString()); } fixedIncomeVo.MaturityFaceValue = float.Parse(dr["CFINP_MaturityFaceValue"].ToString()); fixedIncomeVo.MaturityValue = float.Parse(dr["CFINP_MaturityValue"].ToString()); fixedIncomeVo.Name = dr["CFINP_Name"].ToString(); fixedIncomeVo.PrinciaplAmount = float.Parse(dr["CFINP_PrincipalAmount"].ToString()); if (dr["CFINP_PurchaseDate"].ToString() != String.Empty) { fixedIncomeVo.PurchaseDate = DateTime.Parse(dr["CFINP_PurchaseDate"].ToString()); } fixedIncomeVo.PurchasePrice = float.Parse(dr["CFINP_PurchasePrice"].ToString()); fixedIncomeVo.PurchaseValue = float.Parse(dr["CFINP_PurchaseValue"].ToString()); // fixedIncomeVo.Quantity=float.Parse(dr["CFINP_Quantity"].ToString()); fixedIncomeVo.Remark = dr["CFINP_Remark"].ToString(); fixedIncomeVo.SubsequentDepositAmount = double.Parse(dr["CFINP_SubsequentDepositAmount"].ToString()); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "FixedIncomeDao.cs:GetFixedIncomePortfolio()"); object[] objects = new object[1]; objects[0] = portfolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(fixedIncomeVo); }
public bool CreateFixedIncomePortfolio(FixedIncomeVo fixedincomeVo, int userId) { bool bResult = false; Database db; DbCommand createFixedIncomePortfolioCmd; try { db = DatabaseFactory.CreateDatabase("wealtherp"); createFixedIncomePortfolioCmd = db.GetStoredProcCommand("SP_CreateFixedIncomeNetPosition"); // db.AddInParameter(createFixedIncomePortfolioCmd, "@C_CustomerId", DbType.Int32, fixedincomeVo.CustomerId); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFIA_AccountId", DbType.Int32, fixedincomeVo.AccountId); db.AddInParameter(createFixedIncomePortfolioCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, fixedincomeVo.AssetInstrumentCategoryCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@PAG_AssetGroupCode", DbType.String, fixedincomeVo.AssetGroupCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@XDI_DebtIssuerCode", DbType.String, fixedincomeVo.DebtIssuerCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@XIB_InterestBasisCode", DbType.String, fixedincomeVo.InterestBasisCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@XF_CompoundInterestFrequencyCode", DbType.String, fixedincomeVo.CompoundInterestFrequencyCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@XF_InterestPayableFrequencyCode", DbType.String, fixedincomeVo.InterestPayableFrequencyCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_Name", DbType.String, fixedincomeVo.Name); if (fixedincomeVo.IssueDate != DateTime.MinValue) { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_IssueDate", DbType.DateTime, fixedincomeVo.IssueDate); } else { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_IssueDate", DbType.DateTime, DBNull.Value); } db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_PrincipalAmount", DbType.Decimal, fixedincomeVo.PrinciaplAmount); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_InterestAmtPaidOut", DbType.Decimal, fixedincomeVo.InterestAmtPaidOut); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_InterestAmtAcculumated", DbType.Decimal, fixedincomeVo.InterestAmtAccumulated); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_InterestRate", DbType.Decimal, fixedincomeVo.InterestRate); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_FaceValue", DbType.Decimal, fixedincomeVo.FaceValue); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_MaturityFaceValue", DbType.Decimal, fixedincomeVo.MaturityFaceValue); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_PurchasePrice", DbType.Decimal, fixedincomeVo.PurchasePrice); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_SubsequentDepositAmount", DbType.Decimal, fixedincomeVo.SubsequentDepositAmount); db.AddInParameter(createFixedIncomePortfolioCmd, "@XF_DepositFrquencycode", DbType.String, fixedincomeVo.DepositFrequencyCode); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_DebentureNum", DbType.Int32, fixedincomeVo.DebentureNum); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_PurchaseValue", DbType.Decimal, fixedincomeVo.PurchaseValue); if (fixedincomeVo.PurchaseDate != DateTime.MinValue) { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_PurchaseDate", DbType.DateTime, fixedincomeVo.PurchaseDate); } else { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_PurchaseDate", DbType.DateTime, DBNull.Value); } if (fixedincomeVo.MaturityDate != DateTime.MinValue) { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_MaturityDate", DbType.DateTime, fixedincomeVo.MaturityDate); } else { db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_MaturityDate", DbType.DateTime, DBNull.Value); } db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_MaturityValue", DbType.Decimal, fixedincomeVo.MaturityValue); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_IsInterestAccumulated", DbType.Int16, fixedincomeVo.IsInterestAccumulated); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_CurrentPrice", DbType.Decimal, fixedincomeVo.CurrentPrice); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_CurrentValue", DbType.Decimal, fixedincomeVo.CurrentValue); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_Remark", DbType.String, fixedincomeVo.Remark); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_CreatedBy", DbType.Int32, userId); db.AddInParameter(createFixedIncomePortfolioCmd, "@CFINP_ModifiedBy", DbType.Int32, userId); if (db.ExecuteNonQuery(createFixedIncomePortfolioCmd) != 0) { bResult = true; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "FixedIncomeDao.cs:CreateFixedIncomePortfolio()"); object[] objects = new object[2]; objects[0] = fixedincomeVo; objects[1] = userId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } return(bResult); }
protected void LoadGridView() { try { path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"]).ToString(); customerVo = (CustomerVo)Session["CustomerVo"]; portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString()); int count; fixedincomeList = fixedincomeBo.GetFixedIncomePortfolioList(portfolioId, mypager.CurrentPage, hdnSort.Value, out count); if (count > 0) { lblTotalRows.Text = hdnRecordCount.Value = count.ToString(); tblPager.Visible = true; } if (fixedincomeList == null) { lblMessage.Visible = true; } else { lblMessage.Visible = false; DataTable dtFixedIncomePortfolio = new DataTable(); dtFixedIncomePortfolio.Columns.Add("FITransactionId"); dtFixedIncomePortfolio.Columns.Add("Name"); dtFixedIncomePortfolio.Columns.Add("Category"); dtFixedIncomePortfolio.Columns.Add("Purchase Date"); dtFixedIncomePortfolio.Columns.Add("Maturity Date"); dtFixedIncomePortfolio.Columns.Add("Deposit Amount"); dtFixedIncomePortfolio.Columns.Add("Interest Rate"); dtFixedIncomePortfolio.Columns.Add("Current Value"); dtFixedIncomePortfolio.Columns.Add("Maturity Value"); DataRow drFixedIncomePortfolio; for (int i = 0; i < fixedincomeList.Count; i++) { drFixedIncomePortfolio = dtFixedIncomePortfolio.NewRow(); fixedincomeVo = new FixedIncomeVo(); fixedincomeVo = fixedincomeList[i]; drFixedIncomePortfolio[0] = fixedincomeVo.FITransactionId.ToString(); drFixedIncomePortfolio[1] = fixedincomeVo.Name.ToString(); drFixedIncomePortfolio[2] = fixedincomeVo.AssetInstrumentCategoryName.ToString(); drFixedIncomePortfolio[3] = fixedincomeVo.PurchaseDate.ToShortDateString(); drFixedIncomePortfolio[4] = fixedincomeVo.MaturityDate.ToShortDateString(); if (Convert.ToDecimal(fixedincomeVo.PrinciaplAmount.ToString()) == 0) { drFixedIncomePortfolio[5] = "0"; } else { drFixedIncomePortfolio[5] = decimal.Parse(fixedincomeVo.PrinciaplAmount.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")); } drFixedIncomePortfolio[6] = fixedincomeVo.InterestRate.ToString(); if (Convert.ToDecimal(fixedincomeVo.CurrentValue.ToString()) == 0) { drFixedIncomePortfolio[7] = "0"; } else { drFixedIncomePortfolio[7] = decimal.Parse(fixedincomeVo.CurrentValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")); } // drFixedIncomePortfolio[7] = String.Format("{0:n2}", decimal.Parse(fixedincomeVo.CurrentValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))); if (Convert.ToDecimal(fixedincomeVo.MaturityValue.ToString()) == 0) { drFixedIncomePortfolio[8] = "0"; } else { drFixedIncomePortfolio[8] = decimal.Parse(fixedincomeVo.MaturityValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")); } // drFixedIncomePortfolio[8] = String.Format("{0:n2}", decimal.Parse(fixedincomeVo.MaturityValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))); dtFixedIncomePortfolio.Rows.Add(drFixedIncomePortfolio); } gvFixedIncomePortfolio.DataSource = dtFixedIncomePortfolio; gvFixedIncomePortfolio.DataBind(); this.GetPageCount(); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioFixedIncomeView.ascx:Page_Load()"); object[] objects = new object[5]; objects[0] = customerVo; objects[1] = fixedincomeVo; objects[2] = fixedincomeList; objects[3] = portfolioId; objects[4] = path; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }