public AddMFTransactionResponse AddTransaction(AddMFTransactionRequest mfTransactionRequest)
        {
            int retVal = -1;
            AddMFTransactionResponse response = new AddMFTransactionResponse();
            DataTable dtResult = _mutualFundsDataAccess.AddTransaction(mfTransactionRequest);

            if (dtResult == null || dtResult.Rows.Count <= 0)
            {
                response = new AddMFTransactionResponse()
                {
                    ReturnCode    = retVal,
                    ReturnMessage = "Failed to update!!"
                };
            }

            int.TryParse(dtResult.Rows[0][0].ToString(), out retVal);

            if (retVal == 0)
            {
                response = new AddMFTransactionResponse()
                {
                    ReturnCode    = retVal,
                    ReturnMessage = "Success"
                };
            }
            else
            {
                response = new AddMFTransactionResponse()
                {
                    ReturnCode    = retVal,
                    ReturnMessage = "Failed to update!!"
                };
            }

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage AddTransaction(AddMFTransactionRequest _mfTransactionRequest)
        {
            AddMFTransactionResponse response = _mutualFundsRepository.AddTransaction(_mfTransactionRequest);

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }