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.trading.w_sheet_scales_take_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 = "OnItemDwMaterChanged"; this.EventClicked = "OnDsMainClicked"; this.InitDataSource(pw, FormView1, this.DATA, "dsMain"); this.Button.Add("b_search"); this.Button.Add("b_search_2"); this.Button.Add("weight_get"); this.Register(); } public void RetriveProduct_no() { string sql = null; sql = "select product_no,product_no ||' : '|| product_desc as product_desc, 1 as sorter from stproductmaster where productgroup_code = '003' and coop_id = '" + state.SsCoopId + "' "; sql += "union select '','',0 from dual order by sorter, product_no"; DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "product_name", "product_desc", "product_no"); } public void RetriveOld(string slip) { string sql = @"select slip_no,stscales_slip_take.member_no,mem_full,registration,price,weight_before,weight_after,weight_net, weight_sack,moisture_amt,etc_amt,weight_balance,make_money,slip_date,stscales_slip_take.product_no,entry_id_before,entry_id_after as entry_id,status_before,status_after ,stproductmaster.product_desc as product_name ,stscales_slip_take.registration as registration_number, TO_CHAR(time_before, 'HH24:MI:SS') as time_before,TO_CHAR(time_after, 'HH24:MI:SS') as time_after from stscales_slip_take inner join stproductmaster on stscales_slip_take.product_no = stproductmaster.product_no where slip_no = {0}"; sql = WebUtil.SQLFormat(sql, slip); DataTable dt = WebUtil.Query(sql); ImportData(dt); } } }