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.ws_td_receive_only_ctrl { public partial class DsDetail : DataSourceRepeater { public DataSet1.DSDETAILDataTable DATA { get; private set; } public void InitdsDetail(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.DSDETAIL; this.InitDataSource(pw, Repeater1, this.DATA, "dsDetail"); this.EventItemChanged = "OnDsDetailItemChanged"; this.Register(); } public void RetrieveDetail(string coop_id, string store_id, string slip_no) { Visible = true; string sql = @"select ststockslipdet.product_no , stproductmaster.product_desc , ststockslipdet.product_price , sum(ststockslipdet.item_qty) as item_qty , ststockslipdet.item_return_qty,ststockslipdet.product_cost from ststockslipdet, stproductmaster where ststockslipdet.product_no=stproductmaster.product_no and ststockslipdet.coop_id={0} and ststockslipdet.store_id={1} and ststockslipdet.slip_no={2} group by ststockslipdet.product_no , stproductmaster.product_desc , ststockslipdet.product_price , ststockslipdet.item_return_qty,ststockslipdet.product_cost"; sql = WebUtil.SQLFormat(sql, coop_id, store_id, slip_no); DataTable dt = WebUtil.Query(sql); this.ImportData(dt); int row = RowCount; for (int i = 0; i < row; i++) { DATA[i].item_amt = DATA[i].product_price * DATA[i].item_return_qty; DATA[i].itemnet_amt = (DATA[i].item_amt + DATA[i].vat_amt) - DATA[i].discount_amt; } } public void Change_Item_retun_qty(int row_fc) { DATA[row_fc].item_amt = DATA[row_fc].product_price * DATA[row_fc].item_return_qty; DATA[row_fc].itemnet_amt = (DATA[row_fc].item_amt + DATA[row_fc].vat_amt) - DATA[row_fc].discount_amt; } } }