Example #1
0
        public PmsResponseDto AddExpense([FromBody] ExpenseRequestDto request)
        {
            if (request == null || request.Expense == null)
            {
                throw new PmsException("Expense Type can not be added.");
            }

            var response = new PmsResponseDto();
            var Id       = _iPmsLogic.AddExpense(request.Expense);

            if (Id > 0)
            {
                response.ResponseStatus    = PmsApiStatus.Success.ToString();
                response.StatusDescription = "Record(s) saved successfully.";
                response.ResponseObject    = Id;
            }
            else
            {
                response.ResponseStatus    = PmsApiStatus.Failure.ToString();
                response.StatusDescription = "Operation failed.Please contact administrator.";
            }
            return(response);
        }