using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CoreSavingLibrary; using DataLibrary; namespace Saving.Applications.trading.ws_td_receive_only_ctrl { public partial class DsMain : DataSourceFormView { TradingService _TradService = new TradingService(); public DataSet1.DSMAINDataTable DATA { get; private set; } public void InitdsMain(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.DSMAIN; this.InitDataSource(pw, FormViewMain, this.DATA, "dsMain"); this.EventItemChanged = "OnDsMainItemChanged"; this.EventClicked = "OnDsMainClicked"; this.Register(); } public void RetrieveMain(string slip_no, string coop_id, string store_id, string terminal_no) { Visible = true; Sdt dt = new Sdt(); DATA[0].slip_no = "- AUTO -"; DATA[0].refdoc_no = slip_no; DATA[0].slip_date = _TradService.GetWorkDate(coop_id, store_id); string sql = @"select * from ststockslip, stucfdebttype, stucfdebtfromtype, ststockslipdet where ststockslip.debttype_code=stucfdebttype.debttype_code and ststockslip.debtfromtype_code = stucfdebtfromtype.debtfromtype_code and ststockslip.slip_no=ststockslipdet.slip_no and ststockslip.coop_id={0} and ststockslip.store_id={1} and ststockslip.terminal_no={2} and ststockslip.slip_no={3} order by ststockslipdet.product_no "; sql = WebUtil.SQLFormat(sql, coop_id, store_id, terminal_no, slip_no); dt = WebUtil.QuerySdt(sql); dt.Next(); DATA[0].debtfromtype_code = dt.GetString("debtfromtype_code"); DATA[0].debtfromtype_desc = dt.GetString("debtfromtype_desc"); DATA[0].debt_no = dt.GetString("debt_no"); DATA[0].debt_name = dt.GetString("debt_name"); DATA[0].debttype_desc = dt.GetString("debttype_desc"); DATA[0].expense_code = dt.GetString("expense_code"); DATA[0].receive_amt = dt.GetDecimal("receive_amt"); DATA[0].remain_amt = dt.GetDecimal("remain_amt"); DATA[0].debttype_code = dt.GetString("debttype_code"); DATA[0].vat_type = "E"; } } }