protected void ddlMenu_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //DropDownList ddlAction = (DropDownList)sender;
                RadComboBox  ddlAction = (RadComboBox)sender;
                GridDataItem gvr       = (GridDataItem)ddlAction.NamingContainer;
                //GridViewRow gvr = (GridViewRow)ddlAction.NamingContainer;
                int       selectedRow     = gvr.ItemIndex + 1;
                int       insuranceId     = int.Parse(gvrLifeInsurance.MasterTableView.DataKeyValues[selectedRow - 1]["InsuranceId"].ToString());
                DataTable dtAssociationId = new DataTable();

                // Set the VO into the Session
                insuranceVo = insuranceBo.GetInsuranceAssetLI(insuranceId, out dtAssociationId);
                Session["dtAssociationId"]   = dtAssociationId;
                Session["insuranceVo"]       = insuranceVo;
                Session["customerAccountVo"] = customerAccountsBo.GetCustomerInsuranceAccount(insuranceVo.AccountId);

                if (ddlAction.SelectedItem.Value.ToString() == "Edit")
                {
                    Session.Remove("table");
                    Session.Remove("moneyBackEpisodeList");
                    Session.Remove("insuranceULIPList");
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioInsuranceEntry','action=edit');", true);
                }
                if (ddlAction.SelectedItem.Value.ToString() == "View")
                {
                    Session.Remove("table");
                    Session.Remove("moneyBackEpisodeList");
                    Session.Remove("insuranceULIPList");
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioInsuranceEntry','action=view');", true);
                }
                if (ddlAction.SelectedItem.Value.ToString() == "Delete")
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "showmessage();", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewInsuranceDetails.ascx:ddlMenu_SelectedIndexChanged()");
                object[] objects = new object[1];
                objects[0]   = insuranceVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, null);/*, objects*/
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Exemplo n.º 2
0
        protected void lnkLifeInsurancePolicy_Click(object sender, EventArgs e)
        {
            GridViewRow gvRow           = ((GridViewRow)(((LinkButton)sender).Parent.Parent));
            int         rowIndex        = gvRow.RowIndex;
            DataKey     dk              = gvLifeInsurance.DataKeys[rowIndex];
            int         insuranceId     = Convert.ToInt32(dk.Value);
            DataTable   dtAssociationId = new DataTable();

            //insuranceVo = insuranceBo.GetInsuranceAsset(insuranceId);
            insuranceVo = insuranceBo.GetInsuranceAssetLI(insuranceId, out dtAssociationId);
            Session["dtAssociationId"]   = dtAssociationId;
            Session["insuranceVo"]       = insuranceVo;
            Session["customerAccountVo"] = customerAccountsBo.GetCustomerInsuranceAccount(insuranceVo.AccountId);

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PortfolioInsuranceEntry','action=view');", true);
        }