//get SubAccount record by Code public static MS_ACCT_SUB_ACCOUNT GetSubAccount(string code) { var db = new SibaModel(); try { return((from subAcct in db.MS_ACCT_SUB_ACCOUNT where subAcct.SUB_ACCT_CODE == code select subAcct).ToList().Select(sbAcct => new MS_ACCT_SUB_ACCOUNT { SUB_ACCT_CODE = sbAcct.SUB_ACCT_CODE, SUB_ACCT_NAME = sbAcct.SUB_ACCT_NAME, SUB_ACCT_DESC = sbAcct.SUB_ACCT_DESC, SUB_ACCT_CRTE_BY = sbAcct.SUB_ACCT_CRTE_BY, SUB_ACCT_CRTE_DATE = sbAcct.SUB_ACCT_CRTE_DATE, SUB_ACCT_MOD_BY = sbAcct.SUB_ACCT_MOD_BY, SUB_ACCT_MOD_DATE = sbAcct.SUB_ACCT_MOD_DATE, SUB_ACCT_STATUS = sbAcct.SUB_ACCT_STATUS, MS_ACCT_SUB_CURRERNCY = sbAcct.MS_ACCT_SUB_CURRERNCY != null? sbAcct.MS_ACCT_SUB_CURRERNCY.Select(sc => new MS_ACCT_SUB_CURRERNCY { SUB_CURR_ACTIVE_YN = sc.SUB_CURR_ACTIVE_YN, SUB_CURR_CODE = sc.SUB_CURR_CODE, SUB_CURR_CRTE_BY = sc.SUB_CURR_CRTE_BY, SUB_CURR_CRTE_DATE = sc.SUB_CURR_CRTE_DATE, SUB_CURR_MOD_BY = sc.SUB_CURR_MOD_BY, SUB_CURR_MOD_DATE = sc.SUB_CURR_MOD_DATE, SUB_CURR_STATUS = sc.SUB_CURR_STATUS, SUB_CURR_SUB_CODE = sc.SUB_CURR_SUB_CODE, SUB_CURR_SYS_ID = sc.SUB_CURR_SYS_ID, MS_INS_CURRENCY = CurrencyMdl.get_currency(sc.SUB_CURR_CODE) }).ToList():null, MS_ACCT_SUB_MAIN_ACCOUNT = sbAcct.MS_ACCT_SUB_MAIN_ACCOUNT != null? sbAcct.MS_ACCT_SUB_MAIN_ACCOUNT.Select(sma => new MS_ACCT_SUB_MAIN_ACCOUNT { SUB_MAIN_ACCT_CODE = sma.SUB_MAIN_ACCT_CODE, SUB_MAIN_ACCT_CRTE_BY = sma.SUB_MAIN_ACCT_CRTE_BY, SUB_MAIN_ACCT_CRTE_DATE = sma.SUB_MAIN_ACCT_CRTE_DATE, SUB_MAIN_ACCT_MOD_BY = sma.SUB_MAIN_ACCT_MOD_BY, SUB_MAIN_ACCT_MOD_DATE = sma.SUB_MAIN_ACCT_MOD_DATE, SUB_MAIN_ACCT_STATUS = sma.SUB_MAIN_ACCT_STATUS, SUB_MAIN_ACCT_SYS_ID = sma.SUB_MAIN_ACCT_SYS_ID, SUB_MAIN_ACTIVT_YN = sma.SUB_MAIN_ACTIVT_YN, SUB_MAIN_SUB_ACCT_CODE = sma.SUB_MAIN_ACCT_CODE, MS_ACCT_MAIN_ACCOUNT = MainAccountMdl.GetMainAccount(sma.SUB_MAIN_ACCT_CODE) }).ToList():null }).Single()); } catch (Exception e) { return(null); } }
public static MS_CUSTOMER_CATEGORY get_custcat(string code) { var db = new SibaModel(); return((from mdl in db.MS_CUSTOMER_CATEGORY where mdl.CUS_CAT_CODE == code select mdl).ToList().Select(mdl => new MS_CUSTOMER_CATEGORY { CUS_CAT_CODE = mdl.CUS_CAT_CODE, CUS_CAT_INTERM_YN = mdl.CUS_CAT_INTERM_YN, CUS_CAT_NAME = mdl.CUS_CAT_NAME, CUS_CAT_MAIN_ACCT = mdl.CUS_CAT_MAIN_ACCT, CUS_CAT_SUB_ACCT = mdl.CUS_CAT_SUB_ACCT, CUS_CAT_CRTE_DATE = mdl.CUS_CAT_CRTE_DATE, CUS_CAT_CRTE_BY = mdl.CUS_CAT_CRTE_BY, CUS_CAT_MOD_DATE = mdl.CUS_CAT_MOD_DATE, CUS_CAT_MOD_BY = mdl.CUS_CAT_MOD_BY, CUS_CAT_STATUS = mdl.CUS_CAT_STATUS, MS_ACCT_MAIN_ACCOUNT = MainAccountMdl.GetMainAccount(mdl.CUS_CAT_MAIN_ACCT), MS_ACCT_SUB_ACCOUNT = SubAccountMdl.GetSubAccount(mdl.CUS_CAT_SUB_ACCT) }).Single()); }
public static MS_COMPULSORY_FEES get_CompFees(string code) { var db = new SibaModel(); return((from comfee in db.MS_COMPULSORY_FEES where comfee.FEE_CODE == code select comfee).ToList().Select(comfee => new MS_COMPULSORY_FEES { FEE_CODE = comfee.FEE_CODE, FEE_NAME = comfee.FEE_NAME, FEE_DESC = comfee.FEE_DESC, FEE_CRTE_BY = comfee.FEE_CRTE_BY, FEE_CRTE_DATE = comfee.FEE_CRTE_DATE, FEE_FROM_DATE = comfee.FEE_FROM_DATE, FEE_MOD_BY = comfee.FEE_MOD_BY, FEE_MOD_DATE = comfee.FEE_MOD_DATE, FEE_AMOUNT = comfee.FEE_AMOUNT, FEE_MODIFY_YN = comfee.FEE_MODIFY_YN, FEE_REFUND_YN = comfee.FEE_REFUND_YN, FEE_STATUS = comfee.FEE_STATUS, FEE_TO_DATE = comfee.FEE_TO_DATE, MS_ACCT_MAIN_ACCOUNT = MainAccountMdl.GetMainAccount(comfee.FEE_MAIN_ACCOUNT), MS_ACCT_SUB_ACCOUNT = SubAccountMdl.GetSubAccount(comfee.FEE_SUB_ACCOUNT) }).Single()); }