Example #1
0
        public int AddExpense(ExpensesEntity expense)
        {
            try
            {
                _context.Add(expense);
                var result = _context.SaveChanges();

                return(expense.ExpensesID);
            }
            catch (Exception ex)
            {
                _logger.LogError(ErrorMsg.ReturErrorMsgWithClassAndMethodName(this.GetType().FullName, MethodBase.GetCurrentMethod().Name, ex.Message));
                return(0);
            }
        }
        public void SetLastLoadDate(DateTime loadDate)
        {
            var record = _context.EmailConfig.FirstOrDefault();

            record.LastLoadDate = loadDate;

            _context.SaveChanges();
            _context.Dispose();
        }