Beispiel #1
0
        private void BindCustomerMFAlertGrid()
        {
            DataTable dtCustomerMFAlerts = new DataTable();
            DataRow   drMFAlerts;

            //int count;
            try
            {
                dsCustomerMFAlerts = alertsBo.GetCustomerMFAlerts(customerVo.CustomerId);
                //Session["SystemAlerts"] = dsSystemAlerts;
                //if (count > 0)
                //{
                //    lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                //    tblPager.Visible = true;
                //}
                if (dsCustomerMFAlerts.Tables[0].Rows.Count > 0)
                {
                    lblMessage.Visible = false;

                    dtCustomerMFAlerts.Columns.Add("SchemeId");
                    dtCustomerMFAlerts.Columns.Add("AccountId");
                    dtCustomerMFAlerts.Columns.Add("Scheme");
                    dtCustomerMFAlerts.Columns.Add("SIPReminder");
                    dtCustomerMFAlerts.Columns.Add("SIPConfirmation");
                    dtCustomerMFAlerts.Columns.Add("MFAbsoluteStopLoss");
                    dtCustomerMFAlerts.Columns.Add("MFAbsoluteProfitBooking");
                    dtCustomerMFAlerts.Columns.Add("SWPReminder");
                    dtCustomerMFAlerts.Columns.Add("SWPConfirmation");
                    dtCustomerMFAlerts.Columns.Add("ELSSMaturity");
                    dtCustomerMFAlerts.Columns.Add("DivTranxOccur");

                    foreach (DataRow dr in dsCustomerMFAlerts.Tables[0].Rows)
                    {
                        drMFAlerts = dtCustomerMFAlerts.NewRow();

                        drMFAlerts[0] = dr["MFALT_SchemeId"].ToString();
                        drMFAlerts[1] = dr["MFALT_AccountId"].ToString();
                        drMFAlerts[2] = dr["MFALT_SchemeName"].ToString().Trim();
                        if (dr["MFALT_SIPReminder"].ToString() != null)
                        {
                            drMFAlerts[3] = dr["MFALT_SIPReminder"].ToString();
                        }
                        if (dr["MFALT_SIPConfirmation"].ToString() != null)
                        {
                            drMFAlerts[4] = dr["MFALT_SIPConfirmation"].ToString();
                        }
                        if (dr["MFALT_MFAbsoluteStopLoss"].ToString() != null)
                        {
                            drMFAlerts[5] = dr["MFALT_MFAbsoluteStopLoss"].ToString();
                        }
                        if (dr["MFALT_MFAbsoluteProfitBooking"].ToString() != null)
                        {
                            drMFAlerts[6] = dr["MFALT_MFAbsoluteProfitBooking"].ToString();
                        }
                        if (dr["MFALT_SWPReminder"].ToString() != null)
                        {
                            drMFAlerts[7] = dr["MFALT_SWPReminder"].ToString().Trim();
                        }
                        if (dr["MFALT_SWPConfirmation"].ToString() != null)
                        {
                            drMFAlerts[8] = dr["MFALT_SWPConfirmation"].ToString();
                        }
                        if (dr["MFALT_ELSSMaturity"].ToString() != null)
                        {
                            drMFAlerts[9] = dr["MFALT_ELSSMaturity"].ToString();
                        }
                        if (dr["MFALT_DivTranx"].ToString() != null)
                        {
                            drMFAlerts[10] = dr["MFALT_DivTranx"].ToString().Trim();
                        }

                        dtCustomerMFAlerts.Rows.Add(drMFAlerts);
                    }

                    gvMFAlerts.DataSource = dtCustomerMFAlerts;
                    gvMFAlerts.DataBind();
                    gvMFAlerts.Visible = true;
                    //this.GetPageCount();
                }
                else
                {
                    lblMessage.Visible    = true;
                    lblDisclaimer.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerMFAlert.ascx:BindCustomerMFAlertGrid()");

                object[] objects = new object[0];

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