protected void btnSubmit_Click(object sender, EventArgs e) { PortfolioBo portfolioBo = new PortfolioBo(); String statusMsg = string.Empty; int totalFoliosMoved = 0; CustomerPortfolioVo portfolioVo = new CustomerPortfolioVo(); if (txtCustomerId.Value != string.Empty) { string portfolio = ddlAdvisorBranchList.SelectedValue; portfolioVo = portfolioBo.GetCustomerDefaultPortfolio1((Convert.ToInt32(txtCustomerId.Value)), portfolio); if (portfolioVo.PortfolioId < 1) { lblMessage.Text = "No default Portfolio found for the selected customer."; lblMessage.Visible = true; return; } } else { lblMessage.Text = "Please select a customer."; lblMessage.Visible = true; return; } foreach (GridViewRow dr in gvMFFolio.Rows) { CheckBox checkBox = (CheckBox)dr.FindControl("chkBox"); if (checkBox.Checked) { int MFAccountId = Convert.ToInt32(gvMFFolio.DataKeys[dr.RowIndex].Values[0]); bool isUpdated = PortfolioBo.TransferFolio(MFAccountId, portfolioVo.PortfolioId); if (isUpdated) { totalFoliosMoved++; } else { statusMsg += "<br/>Error occurred while moving folio with mutual fund accountId " + MFAccountId + ".<br/>"; } } } if (totalFoliosMoved > 0) { statusMsg += "<b style='color:Green'>Total Folios moved = " + totalFoliosMoved + "</b>"; } //lblMessage.Text = statusMsg; //lblMessage.Visible = true; lblTransferMsg.Text = statusMsg; divMessage.Attributes.Add("class", "yellow-box"); BindFolioGridView(); }
protected void btnSubmit_Click(object sender, EventArgs e) { PortfolioBo portfolioBo = new PortfolioBo(); int isBankAssociatedWithOtherTransactions = 0; String statusMsg = string.Empty; int totalFoliosMoved = 0; CustomerPortfolioVo portfolioVo = new CustomerPortfolioVo(); if (txtCustomerId.Value != string.Empty) { string portfolio = ddlAdvisorBranchList.SelectedValue; portfolioVo = portfolioBo.GetCustomerDefaultPortfolio1((Convert.ToInt32(txtCustomerId.Value)), portfolio); if (portfolioVo.PortfolioId < 1) { lblMessage.Text = "No default Portfolio found for the selected customer."; //trErrorMsg.Visible = true; tblTransferFolio.Visible = false; tblMoveFolio.Visible = false; return; } } else { lblMessage.Text = "Please select a customer."; //trErrorMsg.Visible = true; tblTransferFolio.Visible = false; tblMoveFolio.Visible = false; return; } foreach (GridDataItem dr in gvMFFolio.Items) { CheckBox checkBox = (CheckBox)dr.FindControl("chkBox"); if (checkBox.Checked) { int MFAccountId = Convert.ToInt32(gvMFFolio.MasterTableView.Items[dr.ItemIndex].GetDataKeyValue("FolioId").ToString()); bool isUpdated = PortfolioBo.TransferFolio(MFAccountId, portfolioVo.PortfolioId, isBankAssociatedWithOtherTransactions); if (isUpdated) { totalFoliosMoved++; } else { //statusMsgFailure.InnerText = statusMsg; //statusMsg += "Error occurred while moving folio with mutual fund accountId " + MFAccountId; //trFailure.Visible = true; //statusMsgSuccess.Visible = false; //statusMsgFailure.Visible = true; ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Cannot transfer this folio the bank is associate with some other transactions');", true); } //lblstatusMsgFailure.Visible = true; } } if (totalFoliosMoved > 0) { statusMsg += "Total Folios moved = " + totalFoliosMoved; statusMsgSuccess.InnerText = statusMsg; trFailure.Visible = true; statusMsgSuccess.Visible = true; statusMsgFailure.Visible = false; // lblstatusMsgSuccess.Text += "<br/>Total Folios moved = " + totalFoliosMoved + ".<br/>"; //lblstatusMsgSuccess.Visible = true; //lblMessage.Text = statusMsg; //lblMessage.Visible = true; //lblTransferMsg.Text = statusMsg; //divMessage.Attributes.Add("class", "yellow-box"); //if (trTransferMsg.Visible == false) // trTransferMsg.Visible = true; } BindFolioGridView(); }