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.ws_td_buy_oil_ctrl { public partial class DsMain : DataSourceFormView { public DataSet2.STSTOCKSLIPDataTable DATA { get; private set; } public void InitdsMain(PageWeb pw) { css1.Visible = false; DataSet2 ds = new DataSet2(); this.DATA = ds.STSTOCKSLIP; this.InitDataSource(pw, FormViewMain, this.DATA, "dsMain"); this.EventItemChanged = "OnDsMainItemChanged"; this.EventClicked = "OnDsMainClicked"; this.Button.Add("b_debtno"); this.Button.Add("b_adddebtno"); this.Register(); } public void DdDebtType() { string sql = "select debtfromtype_code, 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 DdStore() { string sql = @"select trim(store_id) store_id,trim(store_id) || ' : ' ||trim(store_desc) store_desc from ststore where coop_id={0} order by store_id"; sql = WebUtil.SQLFormat(sql, state.SsCoopId); DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "store_desc", "store_desc", "store_id"); } } }