Beispiel #1
0
        private string FindLinkedAccount(List <AccountPairModel> pairs, BookAccountsSettingsModel setting)
        {
            string result = null;

            if (pairs.Count != 0)
            {
                result = pairs.Where(
                    p => p.Name == SelectedUraPrimke.NazivDobavljaca &&
                    p.Description == setting.Name).DefaultIfEmpty(new AccountPairModel()).FirstOrDefault().Account;
            }

            return(result);
        }
Beispiel #2
0
        public void Insert(BookAccountsSettingsModel setting)
        {
            try
            {
                _sql.StartTransaction("AccountingConnStr");

                _sql.SaveDataInTransaction("dbo.spBookAccountsSettings_Insert", setting);
            }
            catch (System.Exception)
            {
                _sql.RollBackTransaction();
                throw;
            }
        }
Beispiel #3
0
 public async Task <bool> PostSetting(BookAccountsSettingsModel setting)
 {
     using (HttpResponseMessage response = await _apiService.ApiClient.PostAsJsonAsync("/api/BookSettings", setting))
     {
         if (response.IsSuccessStatusCode)
         {
             return(true);
         }
         else
         {
             var error = response.ReasonPhrase;
             return(false);
         }
     }
 }
Beispiel #4
0
 public void Post([FromBody] BookAccountsSettingsModel setting)
 {
     _settings.Insert(setting);
 }