public void displayRegInfo(UnitHolderRegistration unitRegObj) { dvLedger.Visible = true; DataTable dtRegInfo = opendMFDAO.getDtRegInfo(unitRegObj); DataTable dtNominee = opendMFDAO.dtNomineeRegInfo(unitRegObj); if (dtRegInfo.Rows.Count > 0) { //Trasaction Lock Status if (!(dtRegInfo.Rows[0]["ALL_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["ALL_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["SL_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["SL_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["REP_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["REP_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["TR_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["TR_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["LIEN_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["LIEN_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["REN_LOCK"].Equals(DBNull.Value) || (dtRegInfo.Rows[0]["REN_LOCK"].ToString() == "N")) || !(dtRegInfo.Rows[0]["LOCK_REMARKS"].Equals(DBNull.Value))) { dvLockin.Attributes.Add("style", "visibility:visible"); if (dtRegInfo.Rows[0]["ALL_LOCK"].ToString() == "Y") { SaleLockLabel.Text = "YES"; RepLockLabel.Text = "YES"; TransferLockLabel.Text = "YES"; LienLockLabel.Text = "YES"; RenLockLabel.Text = "YES"; LockRemarksTextBox.Text = dtRegInfo.Rows[0]["LOCK_REMARKS"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["LOCK_REMARKS"].ToString(); } else { if (dtRegInfo.Rows[0]["SL_LOCK"].ToString() == "Y") { SaleLockLabel.Text = "YES"; } else { SaleLockLabel.Text = "NO"; } if (dtRegInfo.Rows[0]["REP_LOCK"].ToString() == "Y") { RepLockLabel.Text = "YES"; } else { RepLockLabel.Text = "NO"; } if (dtRegInfo.Rows[0]["TR_LOCK"].ToString() == "Y") { TransferLockLabel.Text = "YES"; } else { TransferLockLabel.Text = "NO"; } if (dtRegInfo.Rows[0]["LIEN_LOCK"].ToString() == "Y") { LienLockLabel.Text = "YES"; } else { LienLockLabel.Text = "NO"; } if (dtRegInfo.Rows[0]["REN_LOCK"].ToString() == "Y") { RenLockLabel.Text = "YES"; } else { RenLockLabel.Text = "NO"; } LockRemarksTextBox.Text = dtRegInfo.Rows[0]["LOCK_REMARKS"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["LOCK_REMARKS"].ToString(); } } else { SaleLockLabel.Text = "NO"; RepLockLabel.Text = "NO"; TransferLockLabel.Text = "NO"; LienLockLabel.Text = "NO"; RenLockLabel.Text = "NO"; dvLockin.Attributes.Add("style", "visibility:hidden"); } regNoTextBox.Text = dtRegInfo.Rows[0]["REG_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["REG_NO"].ToString(); holderBOTextBox.Text = dtRegInfo.Rows[0]["BO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["BO"].ToString(); folioTextBox.Text = dtRegInfo.Rows[0]["FOLIO_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["FOLIO_NO"].ToString(); holderNameTextBox.Text = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString(); jHolderTextBox.Text = dtRegInfo.Rows[0]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["JNT_NAME"].ToString(); holderAddress1TextBox.Text = dtRegInfo.Rows[0]["ADDRS1"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS1"].ToString(); holderAddress2TextBox.Text = dtRegInfo.Rows[0]["ADDRS2"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS2"].ToString(); holderTelphoneTextBox.Text = dtRegInfo.Rows[0]["TEL_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["TEL_NO"].ToString(); tdTIN.InnerHtml = dtRegInfo.Rows[0]["TIN"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["TIN"].ToString(); string CIP = dtRegInfo.Rows[0]["CIP"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["CIP"].ToString(); string BEFTN = dtRegInfo.Rows[0]["IS_BEFTN"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["IS_BEFTN"].ToString(); if (string.Compare(CIP, "Y", true) == 0) { tdCIP.InnerHtml = "YES"; } else if (string.Compare(CIP, "N", true) == 0) { tdCIP.InnerHtml = "NO"; } else { tdCIP.InnerHtml = " "; } if (string.Compare(BEFTN, "Y", true) == 0) { tdBEFTN.InnerHtml = "YES"; } else { tdBEFTN.InnerHtml = "NO"; } if (dtNominee.Rows.Count > 1) { Nominee1NameTextBox.Text = dtNominee.Rows[0]["NOMI_NAME"].ToString(); Nominee2NameTextBox.Text = dtNominee.Rows[1]["NOMI_NAME"].ToString(); } else if (dtNominee.Rows.Count > 0) { Nominee1NameTextBox.Text = dtNominee.Rows[0]["NOMI_NAME"].ToString(); Nominee2NameTextBox.Text = ""; } else { Nominee1NameTextBox.Text = ""; Nominee2NameTextBox.Text = ""; } RemarksTextBox.Text = dtRegInfo.Rows[0]["REMARKS"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["REMARKS"].ToString(); if (dtRegInfo.Rows[0]["BK_FLAG"].ToString() == "Y") { string bankInfo = ""; if (!dtRegInfo.Rows[0]["BK_NM_CD"].Equals(DBNull.Value) && !dtRegInfo.Rows[0]["BK_BR_NM_CD"].Equals(DBNull.Value) && !dtRegInfo.Rows[0]["BK_AC_NO"].Equals(DBNull.Value)) { bankInfo = "AC:" + dtRegInfo.Rows[0]["BK_AC_NO"].ToString(); bankInfo = bankInfo + " , " + reportObj.getBankNameByBankCode(Convert.ToInt32(dtRegInfo.Rows[0]["BK_NM_CD"].ToString())).ToString(); bankInfo = bankInfo + " , " + reportObj.getBankBranchNameByCode(Convert.ToInt32(dtRegInfo.Rows[0]["BK_NM_CD"].ToString()), Convert.ToInt32(dtRegInfo.Rows[0]["BK_BR_NM_CD"].ToString())).ToString(); DataTable dtBankBracnhInfo = unitHolderRegBLObj.dtGetBankBracnhInfo(Convert.ToInt32(dtRegInfo.Rows[0]["BK_NM_CD"].ToString()), Convert.ToInt32(dtRegInfo.Rows[0]["BK_BR_NM_CD"].ToString())); if (dtBankBracnhInfo.Rows.Count > 0) { bankInfo = bankInfo + " Routing No=[" + dtBankBracnhInfo.Rows[0]["ROUTING_NO"].ToString() + "] " + dtBankBracnhInfo.Rows[0]["ADDRESS"].ToString() + " "; } } BankInfoTextBox.Text = bankInfo.ToString(); } else { BankInfoTextBox.Text = ""; } DataTable dtLedger = reportObj.GetLedgerData(unitRegObj); int balance = 0; if (dtLedger.Rows.Count > 0) { DataTable dtLedgerForReport = reportObj.GetDtLedgerTable(); DataRow drLedgerForReport; for (int looper = 0; looper < dtLedger.Rows.Count; looper++) { drLedgerForReport = dtLedgerForReport.NewRow(); drLedgerForReport["SI"] = looper + 1; if (!dtLedger.Rows[looper]["TRANS_DATE"].Equals(DBNull.Value)) { drLedgerForReport["TRANS_DATE"] = Convert.ToDateTime(dtLedger.Rows[looper]["TRANS_DATE"].ToString()).ToString("dd-MMM-yyyy"); } drLedgerForReport["TRANS_NO"] = Convert.ToInt32(dtLedger.Rows[looper]["TRANS_NO"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["TRANS_NO"].ToString()); //drLedgerForReport["TRANS_NO"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["TRANS_DATE"].Equals(DBNull.Value) ? "0" : dtLedgerForReport.Rows[looper]["TRANS_DATE"].ToString()); if (!dtLedger.Rows[looper]["TRANS_TYPE"].Equals(DBNull.Value)) { drLedgerForReport["TRANS_TYPE"] = dtLedger.Rows[looper]["TRANS_TYPE"].ToString(); if ((string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "SL", true) == 0) || (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "CIP", true) == 0)) { drLedgerForReport["UNIT_CREDIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); drLedgerForReport["RATE"] = decimal.Parse((dtLedger.Rows[looper]["RATE"].ToString())); int saleBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance + saleBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "TRI", true) == 0) { drLedgerForReport["UNIT_CREDIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); //drLedgerForReport["RATE"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["RATE"].ToString()); int transferInBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance + transferInBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "TRO", true) == 0) { drLedgerForReport["UNIT_DEBIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); //drLedgerForReport["RATE"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["RATE"].ToString()); int transferOutBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance - transferOutBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "REP", true) == 0) { drLedgerForReport["UNIT_DEBIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); drLedgerForReport["RATE"] = decimal.Parse((dtLedger.Rows[looper]["RATE"].ToString())); int repurchaseBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance - repurchaseBalance; drLedgerForReport["BALANCE"] = balance; } } dtLedgerForReport.Rows.Add(drLedgerForReport); } TotalLienUnitHoldingTextBox.Text = unitLienBLObj.totalLienAmount(unitRegObj).ToString(); dgLedger.DataSource = dtLedgerForReport; dgLedger.DataBind(); Session["dtLedgerForReport"] = dtLedgerForReport; displaySign(); } else { ClearText(); SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString()); dvLedger.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Ledger Balance Data Found');", true); } } else { SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString()); dvLedger.Visible = false; ClientScript.RegisterStartupScript(this.GetType(), "Popup", " window.fnResetAll();", true); tdCIP.InnerHtml = ""; } }
public void displayRegInfo() { dvLedger.Visible = true; UnitHolderRegistration unitRegObj = new UnitHolderRegistration(); unitRegObj.FundCode = fundCodeTextBox.Text.Trim(); unitRegObj.BranchCode = branchCodeTextBox.Text.Trim(); unitRegObj.RegNumber = regNoTextBox.Text.Trim(); DataTable dtRegInfo = opendMFDAO.getDtRegInfo(unitRegObj); DataTable dtNominee = opendMFDAO.dtNomineeRegInfo(unitRegObj); if (dtRegInfo.Rows.Count > 0) { holderNameTextBox.Text = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString(); jHolderTextBox.Text = dtRegInfo.Rows[0]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["JNT_NAME"].ToString(); holderAddress1TextBox.Text = dtRegInfo.Rows[0]["ADDRS1"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS1"].ToString(); holderAddress2TextBox.Text = dtRegInfo.Rows[0]["ADDRS2"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS2"].ToString(); holderTelphoneTextBox.Text = dtRegInfo.Rows[0]["TEL_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["TEL_NO"].ToString(); string CIP = dtRegInfo.Rows[0]["CIP"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["CIP"].ToString(); if (string.Compare(CIP, "Y", true) == 0) { tdCIP.InnerHtml = "YES"; } else if (string.Compare(CIP, "N", true) == 0) { tdCIP.InnerHtml = "NO"; } if (dtNominee.Rows.Count > 1) { Nominee1NameTextBox.Text = dtNominee.Rows[0]["NOMI_NAME"].ToString(); Nominee2NameTextBox.Text = dtNominee.Rows[1]["NOMI_NAME"].ToString(); } else if (dtNominee.Rows.Count > 0) { Nominee1NameTextBox.Text = dtNominee.Rows[0]["NOMI_NAME"].ToString(); Nominee2NameTextBox.Text = ""; } else { Nominee1NameTextBox.Text = ""; Nominee2NameTextBox.Text = ""; } DataTable dtLedger = reportObj.GetLedgerData(unitRegObj); int balance = 0; if (dtLedger.Rows.Count > 0) { DataTable dtLedgerForReport = reportObj.GetDtLedgerTable(); DataRow drLedgerForReport; for (int looper = 0; looper < dtLedger.Rows.Count; looper++) { drLedgerForReport = dtLedgerForReport.NewRow(); drLedgerForReport["SI"] = looper + 1; if (!dtLedger.Rows[looper]["TRANS_DATE"].Equals(DBNull.Value)) { drLedgerForReport["TRANS_DATE"] = Convert.ToDateTime(dtLedger.Rows[looper]["TRANS_DATE"].ToString()).ToString("dd-MMM-yyyy"); } drLedgerForReport["TRANS_NO"] = Convert.ToInt32(dtLedger.Rows[looper]["TRANS_NO"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["TRANS_NO"].ToString()); //drLedgerForReport["TRANS_NO"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["TRANS_DATE"].Equals(DBNull.Value) ? "0" : dtLedgerForReport.Rows[looper]["TRANS_DATE"].ToString()); if (!dtLedger.Rows[looper]["TRANS_TYPE"].Equals(DBNull.Value)) { drLedgerForReport["TRANS_TYPE"] = dtLedger.Rows[looper]["TRANS_TYPE"].ToString(); if ((string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "SL", true) == 0) || (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "CIP", true) == 0)) { drLedgerForReport["UNIT_CREDIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); drLedgerForReport["RATE"] = decimal.Parse((dtLedger.Rows[looper]["RATE"].ToString())); int saleBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance + saleBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "TRI", true) == 0) { drLedgerForReport["UNIT_CREDIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); //drLedgerForReport["RATE"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["RATE"].ToString()); int transferInBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance + transferInBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "TRO", true) == 0) { drLedgerForReport["UNIT_DEBIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); //drLedgerForReport["RATE"] = Convert.ToInt32(dtLedgerForReport.Rows[looper]["RATE"].ToString()); int transferOutBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance - transferOutBalance; drLedgerForReport["BALANCE"] = balance; } else if (string.Compare(dtLedger.Rows[looper]["TRANS_TYPE"].ToString(), "REP", true) == 0) { drLedgerForReport["UNIT_DEBIT"] = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); drLedgerForReport["RATE"] = decimal.Parse((dtLedger.Rows[looper]["RATE"].ToString())); int repurchaseBalance = Convert.ToInt32(dtLedger.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0" : dtLedger.Rows[looper]["QTY"].ToString()); balance = balance - repurchaseBalance; drLedgerForReport["BALANCE"] = balance; } } dtLedgerForReport.Rows.Add(drLedgerForReport); } TotalLienUnitHoldingTextBox.Text = unitLienBLObj.totalLienAmount(unitRegObj).ToString(); dgLedger.DataSource = dtLedgerForReport; dgLedger.DataBind(); Session["dtLedgerForReport"] = dtLedgerForReport; displaySign(); } else { ClearText(); SignImage.ImageUrl = Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString(); dvLedger.Visible = false; ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Ledger Balance Data Found');", true); } } else { SignImage.ImageUrl = Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString(); dvLedger.Visible = false; ClientScript.RegisterStartupScript(this.GetType(), "Popup", " window.fnResetAll();", true); tdCIP.InnerHtml = ""; } }