protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList ddlAction = (DropDownList)sender; GridViewRow gvr = (GridViewRow)ddlAction.NamingContainer; int selectedRow = gvr.RowIndex; FolioId = int.Parse(gvMFFolio.DataKeys[selectedRow].Value.ToString()); Session["FolioVo"] = CustomerTransactionBo.GetCustomerMFFolioDetails(FolioId); if (ddlAction.SelectedValue.ToString() == "Edit") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd','?action=Edit');", true); } if (ddlAction.SelectedValue.ToString() == "View") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd','?action=View');", true); } } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerMFFolioView.ascx:ddlAction_OnSelectedIndexChange()"); object[] objects = new object[1]; objects[0] = FolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList ddlAction = (DropDownList)sender; GridDataItem gvr = (GridDataItem)ddlAction.NamingContainer; int selectedRow = gvr.ItemIndex + 1;; FolioId = Convert.ToInt32(gvMFFolio.MasterTableView.DataKeyValues[selectedRow - 1]["FolioId"].ToString()); Session["FolioId"] = FolioId; Session["FolioVo"] = CustomerTransactionBo.GetCustomerMFFolioDetails(FolioId); if (ddlAction.SelectedValue.ToString() == "Edit") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd','?action=Edit');", true); } if (ddlAction.SelectedValue.ToString() == "View") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd','?action=View');", true); } if (ddlAction.SelectedValue.ToString() == "Delete") { // bool CheckMFFolioNoAssociationWithTransactions; //CheckMFFolioNoAssociationWithTransactions = CustomerTransactionBo.CheckMFFOlioAssociatedWithTransactions(FolioId); //if (CheckMFFolioNoAssociationWithTransactions == true) //{ // ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", @"alert('Folio can not be deleted as some Transactions are Associated with this Folio Number.');", true); // } //else if (CheckMFFolioNoAssociationWithTransactions == false) //{ Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", "ShowAlertToDelete();", true); // } } } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerMFFolioView.ascx:ddlAction_OnSelectedIndexChange()"); object[] objects = new object[1]; objects[0] = FolioId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }