using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CoreSavingLibrary; using System.Data; namespace Saving.Applications.shrlon.ws_sl_intcert_list_ctrl { public partial class DsLoan : DataSourceFormView { public DataSet1.LNCONTMASTERDataTable DATA { get; private set; } public void InitDsLoan(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.LNCONTMASTER; this.EventItemChanged = "OnDsLoanItemChanged"; this.EventClicked = "OnDsLoanClicked"; this.InitDataSource(pw, FormView1, this.DATA, "dsLoan"); this.Register(); } public void DdLoanContractNo(string member_no) { string sql = @"select lncontmaster.loancontract_no, 1 as sorter from lncontmaster, lnloantype where ( ( lncontmaster.coop_id = lnloantype.coop_id ) and ( lncontmaster.loantype_code = lnloantype.loantype_code ) and ( lncontmaster.coop_id = {0} ) and ( lncontmaster.member_no = {1} ) and ( lnloantype.intcertificate_status > 0 ) ) union select '', 0 from dual order by sorter, loancontract_no"; sql = WebUtil.SQLFormat(sql, state.SsCoopControl, member_no); this.DropDownDataBind(sql, "loancontract_no", "loancontract_no", "loancontract_no"); } public void RetrieveLoan() { string sql = @"select lncontmaster.coop_id, lncontmaster.loancontract_no, lncontmaster. loantype_code, lnloantype. loantype_desc, lncontmaster.startcont_date, lncontmaster.loanapprove_amt, lncontmaster.principal_balance, lncontmaster.lastpayment_date, lncontmaster.intaccum_lastyear, lncontmaster.period_payment from lncontmaster, lnloantype where ( lncontmaster.coop_id = lnloantype.coop_id ) and ( lncontmaster.loantype_code = lnloantype.loantype_code ) and ( ( lncontmaster.coop_id = {0} ) and ( lncontmaster.loancontract_no = {1} ) )"; sql = WebUtil.SQLFormat(sql, state.SsCoopControl, this.DATA[0].LOANCONTRACT_NO); DataTable dt = WebUtil.Query(sql); this.ImportData(dt); } } }