コード例 #1
0
        //function to populate the maturity dates in the grid
        public void BindCustomerAssetMaturityDates()
        {
            DataTable dtMaturityDates = new DataTable();

            try
            {
                dsCustomerAssetMaturityDates = assetBo.GetAssetMaturityDates(portfolioId);
                if (dsCustomerAssetMaturityDates.Tables[0].Rows.Count == 0)
                {
                    lblMaturityMsg.Visible = true;
                }
                else
                {
                    dtMaturityDates.Columns.Add("Asset Group");
                    dtMaturityDates.Columns.Add("Asset Particulars");
                    dtMaturityDates.Columns.Add("Maturity Date");

                    foreach (DataRow dr in dsCustomerAssetMaturityDates.Tables[0].Rows)
                    {
                        drMaturityDates = dtMaturityDates.NewRow();

                        drMaturityDates[0] = dr["AssetGroup"].ToString();
                        if (dr["AssetParticulars"].ToString() != "")
                        {
                            drMaturityDates[1] = dr["AssetParticulars"].ToString();
                        }
                        else
                        {
                            drMaturityDates[1] = "N/A";
                        }
                        if (dr["MaturityDate"].ToString() != "")
                        {
                            drMaturityDates[2] = (DateTime.Parse(dr["MaturityDate"].ToString())).ToShortDateString();
                        }
                        else
                        {
                            drMaturityDates[2] = "N/A";
                        }

                        dtMaturityDates.Rows.Add(drMaturityDates);
                    }
                    gvMaturitySchedule.DataSource = dtMaturityDates;
                    gvMaturitySchedule.DataBind();
                    gvMaturitySchedule.Visible = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorRMCustIndiDashboard.ascx:BindCustomerAssetMaturityDates()");


                object[] objects = new object[2];

                objects[0] = portfolioId;
                objects[1] = dsCustomerAssetMaturityDates;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }