Exemple #1
0
        public static MS_ACCT_SERVICE_TAX GetServiceTax(string code)
        {
            var _db = new SibaModel();

            using (_db)
            {
                return
                    ((from st in _db.MS_ACCT_SERVICE_TAX where st.TX_TAX_CODE == code select st).ToList()
                     .Select(s => new MS_ACCT_SERVICE_TAX
                {
                    TX_TAX_CODE = s.TX_TAX_CODE,
                    TX_SUB_ACCT_CODE = s.TX_SUB_ACCT_CODE,
                    TX_MAIN_ACCT_CODE = s.TX_MAIN_ACCT_CODE,
                    TX_CRTE_BY = s.TX_CRTE_BY,
                    TX_CRTE_DATE = s.TX_CRTE_DATE,
                    TX_CUST_CAT_CODE = s.TX_CUST_CAT_CODE,
                    TX_FROM_DATE = s.TX_FROM_DATE,
                    TX_MIN_TAX_APP = s.TX_MIN_TAX_APP,
                    TX_MOD_BY = s.TX_MOD_BY,
                    TX_MOD_DATE = s.TX_MOD_DATE,
                    TX_STATUS = s.TX_STATUS,
                    TX_SYS_ID = s.TX_SYS_ID,
                    TX_TAX_NAME = s.TX_TAX_NAME,
                    TX_TAX_PERC = s.TX_TAX_PERC,
                    TX_TO_DATE = s.TX_TO_DATE,
                    MS_ACCT_MAIN_ACCOUNT = MainAccountMdl.GetMainAccount(s.TX_MAIN_ACCT_CODE),
                    MS_ACCT_SUB_ACCOUNT = SubAccountMdl.GetSubAccount(s.TX_SUB_ACCT_CODE),
                    MS_CUSTOMER_CATEGORY = CustomerCategoryMdl.get_custcat(s.TX_CUST_CAT_CODE)
                }).SingleOrDefault());
            }
        }
 // GET: api/Intermediary/5
 public dynamic Get(string code)
 {
     try
     {
         return(CustomerCategoryMdl.get_custcat(code));
     }
     catch (Exception e)
     {
         return(new { state = false, message = "Server Error", exception = e });
     }
 }
 public object Check(string code)
 {
     try
     {
         var result = CustomerCategoryMdl.get_custcat(code);
         return(result != null ? (object)new { state = true, name = result.CUS_CAT_NAME } : new { state = false });
     }
     catch (Exception e)
     {
         return(new { state = false, message = "Server Error", exception = e });
     }
 }