protected void ddlMenu_SelectedIndexChanged(object sender, EventArgs e) { string menu; try { DropDownList MyDropDownList = (DropDownList)sender; GridViewRow gvr = (GridViewRow)MyDropDownList.NamingContainer; int selectedRow = gvr.RowIndex; portfolioId = int.Parse(gvrPensionAndGratuities.DataKeys[selectedRow].Value.ToString()); pensionAndGratuitiesVo = pensionAndGratuitiesBo.GetPensionAndGratuities(portfolioId); Session["pensionAndGratuitiesVo"] = pensionAndGratuitiesVo; Session["customerAccountVo"] = customerAccountsBo.GetCustomerPensionAndGratuitiesAccount(pensionAndGratuitiesVo.AccountId); menu = MyDropDownList.SelectedItem.Value.ToString(); if (menu == "Edit") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionAndGratuities','?action=edit');", true); } if (menu == "View") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionAndGratuities','?action=view');", true); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PensionPortfolio.ascx:ddlMenu_SelectedIndexChanged()"); object[] objects = new object[3]; objects[0] = pensionAndGratuitiesBo; objects[1] = pensionAndGratuitiesVo; objects[2] = portfolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void ddlMenu_SelectedIndexChanged(object sender, EventArgs e) { string menu; try { DropDownList MyDropDownList = (DropDownList)sender; GridDataItem gvr = (GridDataItem)MyDropDownList.NamingContainer; int selectedRow = gvr.ItemIndex + 1; PortfolioId = int.Parse(gvrPensionAndGratuities.MasterTableView.DataKeyValues[selectedRow - 1]["PortfolioId"].ToString()); hdndeleteId.Value = portfolioId.ToString(); Session["customerAccountVo"] = customerAccountsBo.GetCustomerPensionAndGratuitiesAccount(PortfolioId); Session["pensionAndGratuitiesVo"] = pensionAndGratuitiesBo.GetPensionAndGratuities(PortfolioId); menu = MyDropDownList.SelectedItem.Value.ToString(); if (menu == "Edit") { if (hdnIsCustomerLogin.Value == "Customer" && hdnIsMainPortfolio.Value == "1") { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Permisssion denied for Manage Portfolio !!');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionAndGratuities','action=edit');", true); } } else if (menu == "View") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('PensionAndGratuities','action=view');", true); } else if (menu == "Delete") { if (hdnIsCustomerLogin.Value == "Customer" && hdnIsMainPortfolio.Value == "1") { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Permisssion denied for Manage Portfolio !!');", true); } else { 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", "PensionPortfolio.ascx:ddlMenu_SelectedIndexChanged()"); object[] objects = new object[3]; objects[0] = pensionAndGratuitiesBo; objects[1] = pensionAndGratuitiesVo; objects[2] = portfolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }