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; using DataLibrary; namespace Saving.Applications.trading.w_sheet_td_contract_ctrl { public partial class DsMain : DataSourceFormView { public DataSet1.DsMainDataTable DATA { get; set; } public void InitdsMain(PageWeb pw) { css1.Visible = false; css2.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.DsMain; this.EventItemChanged = "OnItemDsMainChanged"; this.EventClicked = "OnDsMainClicked"; this.InitDataSource(pw, FormView1, this.DATA, "dsMain"); this.Button.Add("b_debtno"); this.Register(); } public void DdProject(string coopid, string store_id) { if (Sta.IS_MYSQL_MODE) { string sql = @" SELECT project_id, CONCAT( prefix,' ',project_name) as project_name, 1 as sorter FROM stproject WHERE COOP_ID = {0} and store_id ={1} and item_status=1 union select '','-- กรุณาเลือก --',0 from stproject order by sorter, project_id ASC"; sql = WebUtil.SQLFormat(sql, coopid, store_id); DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "project_id", "project_name", "project_id"); } else { string sql = @" SELECT project_id, ( prefix || ' - ' || project_name) as project_name, 1 as sorter FROM stproject WHERE COOP_ID = {0} and store_id ={1} and item_status=1 union select '','-- กรุณาเลือก --',0 from dual order by sorter, project_id ASC"; sql = WebUtil.SQLFormat(sql, coopid, store_id); DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "project_id", "project_name", "project_id"); } } 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"); } } }