using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using CoreSavingLibrary; namespace Saving.Applications.trading.w_td_dec_loancontract_debt_ctrl { public partial class DsMain : DataSourceFormView { public DataSet1.DataTable1DataTable DATA { get; private set; } public void InitdsMain(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.DataTable1; this.InitDataSource(pw, FormView1, this.DATA, "dsMain"); this.EventItemChanged = "OnDsMainItemChanged"; this.EventClicked = "OnDsMainClicked"; this.Button.Add("b_debtno"); this.Register(); } public void DdDebtfromType() { string sql = "select trim(debtfromtype_code) debtfromtype_code, trim(debtfromtype_desc) debtfromtype_desc from stucfdebtfromtype where coop_id=" + state.SsCoopId + " and item_status = 1 order by debtfromtype_code"; DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "debtfromtype_code", "debtfromtype_desc", "debtfromtype_code"); } public void DdDebtType() { string sql = @"select trim(debttype_code) as debttype_code, trim(debttype_desc) as debttype_desc from stucfdebttype left join ststockconstant on ststockconstant.coop_id = stucfdebttype.coop_id where stucfdebttype.coop_id={0} and item_status = 1 and loancre_flag = 1 and debttype_code ='001' union select trim(debttype_code) as debttype_code, trim(debttype_desc) as debttype_desc from stucfdebttype left join ststockconstant on ststockconstant.coop_id = stucfdebttype.coop_id where stucfdebttype.coop_id={0} and item_status = 1 and loandebt_flag = 1 and debttype_code ='002' order by debttype_code"; sql = WebUtil.SQLFormat(sql, state.SsCoopId); DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "debttype_code", "debttype_desc", "debttype_code"); } } }