Пример #1
0
        public Object SaveAccountReceipts(dynamic data)
        {
            AccountReceiptMaster accountReceipt = JsonConvert.DeserializeObject <AccountReceiptMaster>(data.ToString());

            _accountReceipt.AddorUpdate(accountReceipt);

            return(new
            {
                success = true,
                AccountReceiptMaster = new { Record = accountReceipt, TotalRecords = 1 },
                AccountReceiptDetails = new { Record = accountReceipt.AccountReceiptDetails, TotalRecords = accountReceipt.AccountReceiptDetails.Count }
            });
        }
 public AccountReceiptMaster AddorUpdate(AccountReceiptMaster master)
 {
     _accountRepository.AddOrUpdate(master);
     _accountRepository.SaveChanges();
     return(master);
 }