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; using DataLibrary; namespace Saving.Applications.trading.ws_td_sentonly_ctrl { public partial class DsMain : DataSourceFormView { public DataSet1.STSTOCKSLIPDataTable DATA { get; private set; } TradingService _TradService = new TradingService(); public void InitdsMain(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.STSTOCKSLIP; this.InitDataSource(pw, FormViewMain, this.DATA, "dsMain"); this.EventItemChanged = "OnDsMainItemChanged"; this.EventClicked = "OnDsMainClicked"; this.Button.Add("b_debtno"); this.Register(); } public void DdDebtType() { string sql = "select debtfromtype_code, debtfromtype_desc from stucfdebtfromtype"; DataTable dt = WebUtil.Query(sql); this.DropDownDataBind(dt, "debtfromtype_code", "debtfromtype_desc", "debtfromtype_code"); } 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].DEBT_NO = dt.GetString("debt_no"); DATA[0].DEBT_NAME = dt.GetString("debt_name"); 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 = "I"; } } }