Пример #1
0
        public async Task <HttpResponseMessage> AddCashIn(HttpRequestMessage reqObject)
        {
            _requestedDataObjectAsync = _IDataManipulation.GetRequestedDataObjectAsync(reqObject);
            string result = string.Empty;

            _UserTransaction = new UserTransaction();
            _UserTransaction = await Task.Factory.StartNew(() => JsonConvert.DeserializeObject <UserTransaction>(_requestedDataObjectAsync.Result.BusinessData));

            result = await _ICashInService.AddCashIn(_UserTransaction);

            // more code here...
            //return result;

            if (result != null)
            {
                _serviceResponse = await _IDataManipulation.SetResponseObjectAsync(1, "Cash In successfully. Your transaction id " + result);
            }
            else
            {
                _serviceResponse = await _IDataManipulation.SetResponseObjectAsync(0, "Data Not Found...");
            }
            _response = await _IDataManipulation.CreateResponseAsync(_serviceResponse, reqObject);

            return(_response);
        }