private void LoadDataByRegNo(string sTransNo, string sRegNo, string sApprovalStaus) { LienDAL oLienDAL = new LienDAL(); Result oResult = null; if (SEARCH_FROM.Equals(2)) //LienMark search { oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo("", sTransNo, sRegNo, ""); } else if (SEARCH_FROM.Equals(1) || SEARCH_FROM.Equals(3) || SEARCH_FROM.Equals(4)) { oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo(sTransNo, "", sRegNo, sApprovalStaus); } TotalClear(); //hdIssueTransNo.Value = sRegNo; if (oResult.Status) { LienRemove oLienRemove = (LienRemove)oResult.Return; SetObject(oLienRemove); if (hdDataType.Value.Equals("2")) { EnableDisableControl(true); Util.ControlEnabled(btnReject, false); Util.ControlEnabled(btnApprove, false); Util.ControlEnabled(btnBack, false); Util.ControlEnabled(btnReset, true); Util.ControlEnabled(btnSave, true); Util.ControlEnabled(btnDelete, true); fsList.Visible = true; btnRegSearch.Enabled = true; btnUnLienSearch.Enabled = true; } else if (SEARCH_FROM.Equals(4)) { EnableDisableControl(true); Util.ControlEnabled(ucUserDet.FindControl("txtCheckerComments"), true); } else { EnableDisableControl(false); } } else { ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); } }
private void LoadDataByRegNo(string sTransNo, string sRegNo, string sApprovalStaus, string sType) { LienDAL oLienDAL = new LienDAL(); Result oResult = null; TotalClear(); DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Reg No", typeof(string))); dt.Columns.Add(new DataColumn("Issue Date", typeof(string))); dt.Columns.Add(new DataColumn("Bond Holder", typeof(string))); dt.Columns.Add(new DataColumn("Certificate No", typeof(string))); dt.Columns.Add(new DataColumn("Denomination", typeof(string))); dt.Columns.Add(new DataColumn("Amount", typeof(string))); DataRow row = null; ArrayList al = new ArrayList(); if (sType.Equals("LM")) //LienMark search { oResult = (Result)oLienDAL.LoadLienMarkByTransactionNo(sTransNo, sApprovalStaus); if (oResult.Status) { Lien oLien = (Lien)oResult.Return; if (oLien != null) { txtLienBank.Text = oLien.LienBank + (oLien.LienBankAddress == "" ? "" : "," + oLien.LienBankAddress); txtOurRefNo.Text = oLien.OurRef; txtThierRefNo.Text = oLien.TheirRef; txtLienTransNo.Text = oLien.LienTransNo; txtLienDate.Text = oLien.LienDate.ToString(Constants.DATETIME_FORMAT); if (oLien.DtLienDetails.Rows.Count > 0) { for (int i = 0; i < oLien.DtLienDetails.Rows.Count; i++) { if (!al.Contains(oLien.DtLienDetails.Rows[i]["SP Series"])) { row = dt.NewRow(); row["Reg No"] = oLien.Issue.RegNo; row["Issue Date"] = oLien.Issue.VersionIssueDate.ToString(Constants.DATETIME_dd_MMM_yyyy); row["Bond Holder"] = oLien.Issue.BondHolderName; row["Certificate No"] = oLien.DtLienDetails.Rows[i]["SP Series"] + "-" + oLien.DtLienDetails.Rows[i]["SPScripID"]; row["Denomination"] = oLien.DtLienDetails.Rows[i]["Denomination"]; row["Amount"] = oLien.DtLienDetails.Rows[i]["Denomination"]; dt.Rows.Add(row); al.Add(oLien.DtLienDetails.Rows[i]["SP Series"]); } else { dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Amount"] = Convert.ToDouble(dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Amount"]) + Convert.ToDouble(oLien.DtLienDetails.Rows[i]["Denomination"]); dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Certificate No"] = dt.Rows[al.IndexOf(oLien.DtLienDetails.Rows[i]["SP Series"])]["Certificate No"] + ", " + oLien.DtLienDetails.Rows[i]["SP Series"] + "-" + oLien.DtLienDetails.Rows[i]["SPScripID"]; } } } if (dt.Rows.Count > 0) { gvData.DataSource = dt; } else { gvData.DataSource = null; } gvData.DataBind(); } } } else if (sType.Equals("LMR")) //LienMark remove search { oResult = (Result)oLienDAL.LoadLienRemoveMarkByRegNo(sTransNo, "", sRegNo, sApprovalStaus); if (oResult.Status) { LienRemove oLienRemove = (LienRemove)oResult.Return; if (oLienRemove != null) { txtLienBank.Text = oLienRemove.LienBank + (oLienRemove.LienBankAddress == "" ? "" : "," + oLienRemove.LienBankAddress); txtOurRefNo.Text = oLienRemove.OurRef; txtThierRefNo.Text = oLienRemove.TheirRef; //txtLienTransNo.Text = oLienRemove.Lien.LienTransNo; txtLienTransNo.Text = sTransNo; txtLienDate.Text = oLienRemove.Lien.LienDate.ToString(Constants.DATETIME_FORMAT); if (oLienRemove.DtLienRemoveDetail.Rows.Count > 0) { for (int i = 0; i < oLienRemove.DtLienRemoveDetail.Rows.Count; i++) { if (!al.Contains(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])) { row = dt.NewRow(); row["Reg No"] = oLienRemove.Issue.RegNo; row["Issue Date"] = oLienRemove.Issue.VersionIssueDate.ToString(Constants.DATETIME_dd_MMM_yyyy); row["Bond Holder"] = oLienRemove.Issue.BondHolderName; row["Certificate No"] = oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"] + "-" + oLienRemove.DtLienRemoveDetail.Rows[i]["SPScripID"]; row["Denomination"] = oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"]; row["Amount"] = oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"]; dt.Rows.Add(row); al.Add(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"]); } else { dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Amount"] = Convert.ToDouble(dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Amount"]) + Convert.ToDouble(oLienRemove.DtLienRemoveDetail.Rows[i]["Denomination"]); dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Certificate No"] = dt.Rows[al.IndexOf(oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"])]["Certificate No"] + ", " + oLienRemove.DtLienRemoveDetail.Rows[i]["SP Series"] + "-" + oLienRemove.DtLienRemoveDetail.Rows[i]["SPScripID"]; } } } if (dt.Rows.Count > 0) { gvData.DataSource = dt; } else { gvData.DataSource = null; } gvData.DataBind(); } } } }