public string InsertUpdateChartOfAccounts(ChartOfAccountsViewModel _chartOfAccountsObj)
        {
            try
            {
                object result = null;
                AppUA  _appUA = Session["AppUA"] as AppUA;
                _chartOfAccountsObj.CommonObj             = new CommonViewModel();
                _chartOfAccountsObj.CommonObj.CreatedBy   = _appUA.UserName;
                _chartOfAccountsObj.CommonObj.CreatedDate = _appUA.DateTime;
                _chartOfAccountsObj.CommonObj.UpdatedBy   = _appUA.UserName;
                _chartOfAccountsObj.CommonObj.UpdatedDate = _appUA.DateTime;
                if (!string.IsNullOrEmpty(_chartOfAccountsObj.hdnCode))
                {
                    _chartOfAccountsObj.Code = _chartOfAccountsObj.hdnCode;
                    _chartOfAccountsObj.Type = _chartOfAccountsObj.hdnType;
                }

                result = _chartOfAccountsBusiness.InsertUpdateChartOfAccounts(Mapper.Map <ChartOfAccountsViewModel, ChartOfAccounts>(_chartOfAccountsObj));
                return(JsonConvert.SerializeObject(new { Result = "OK", Records = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
        public async Task <IActionResult> Index(int tenantId)
        {
            // TODO: Either in here or in an attribute, verify authorization for the tenant

            var accounts = await _accountRepository.GetAccountsByTenantAsync(tenantId);

            var viewModel = new ChartOfAccountsViewModel(accounts);

            return(View(viewModel));
        }
 public string GetChartOfAccountDetails(string Code)
 {
     try
     {
         ChartOfAccountsViewModel ChartOfAccountsList = Mapper.Map <ChartOfAccounts, ChartOfAccountsViewModel>(_chartOfAccountsBusiness.GetChartOfAccountDetails(Code));
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = ChartOfAccountsList }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
예제 #4
0
 public ChartOfAccountsView()
 {
     InitializeComponent();
     DataContext = new ChartOfAccountsViewModel();
 }