using System; using CoreSavingLibrary; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; namespace Saving.Applications.mbshr.ws_sl_reqgain_true_ctrl { public partial class DsMain : DataSourceFormView { public DataSet1.DataTable2DataTable DATA { get; set; } public void InitDsMain(PageWeb pw) { css1.Visible = false; DataSet1 ds = new DataSet1(); this.DATA = ds.DataTable2; this.EventItemChanged = "OnDsMainItemChanged"; this.EventClicked = "OnDsMainClicked"; this.InitDataSource(pw, FormView1, this.DATA, "dsMain"); this.Button.Add("b_search"); this.Register(); } public void Retrieve(string mem_no) { decimal year = DateTime.Now.Year; String sql = @"SELECT MBMEMBMASTER.COOP_ID, MBMEMBMASTER.MEMBER_NO , MBUCFMEMBGROUP.MEMBGROUP_CODE , MBUCFMEMBGROUP.MEMBGROUP_DESC , MBMEMBMASTER.MEMB_NAME , MBMEMBMASTER.MEMB_SURNAME , MBMEMBMASTER.BIRTH_DATE , MBMEMBMASTER.RETRY_DATE , MBUCFPRENAME.PRENAME_DESC, MBMEMBMASTER.SALARY_ID, {2}-to_number(to_char(MBMEMBMASTER.BIRTH_DATE,'yyyy')) as c_age, (select distinct a.write_at from mbgainmaster a where member_no = {1} ) as write_at, (select distinct a.write_date from mbgainmaster a where member_no = {1} ) as write_date, (select distinct a.condition_type from mbgainmaster a where member_no = {1} ) as condition_type, (select distinct a.condition_etc from mbgainmaster a where member_no = {1} ) as condition_etc FROM MBMEMBMASTER, MBUCFMEMBGROUP, MBUCFPRENAME WHERE MBMEMBMASTER.MEMBGROUP_CODE = MBUCFMEMBGROUP.MEMBGROUP_CODE and MBMEMBMASTER.COOP_ID = MBUCFMEMBGROUP.COOP_ID and MBMEMBMASTER.PRENAME_CODE = MBUCFPRENAME.PRENAME_CODE and MBMEMBMASTER.COOP_ID = {0} and MBMEMBMASTER.MEMBER_NO ={1}"; sql = WebUtil.SQLFormat(sql, state.SsCoopId, mem_no,year); DataTable dt = WebUtil.Query(sql); this.ImportData(dt); } } }