Example #1
0
        public Transaction_Rs Execute(int id)
        {
            Transaction_Rs rs = new Transaction_Rs();

            try
            {
                Transaction transaction = _dbContext.Transactions.Where(c => c.Id == id).FirstOrDefault();
                if (transaction != null)
                {
                    _dbContext.Remove(transaction);

                    rs.ResponseCode = ResponseCode.Success;
                }

                return(rs);
            }
            catch (Exception)
            {
                rs.ResponseCode = ResponseCode.InternalServerError;
                throw;
            }
        }
Example #2
0
        public Contract_Rs Execute(int id)
        {
            Contract_Rs rs = new Contract_Rs();

            try
            {
                Contract contract = _dbContext.Contracts.Where(c => c.Id == id).FirstOrDefault();
                if (contract != null)
                {
                    _dbContext.Remove(contract);
                    _dbContext.SaveChanges();

                    rs.ResponseCode = ResponseCode.Success;
                }

                return(rs);
            }
            catch (Exception)
            {
                rs.ResponseCode = ResponseCode.InternalServerError;
                throw;
            }
        }