示例#1
0
        public HttpResponseMessage GetReportConfigParamByFunc(HttpRequestMessage reqObject)
        {
            string _FunctionId = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                //_ReportConfigParam = JsonConvert.DeserializeObject<ReportConfigParam>(_requestedDataObject.BusinessData);
                _FunctionId = JsonConvert.DeserializeObject <string>(_requestedDataObject.BusinessData);

                //FunctionId = _ReportConfigParam.FunctionId;
            }

            var result = _IReportConfigarationService.GetReportConfigParamByFunc(_FunctionId);

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Report Configaration Parm Information Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage GetMiniStatment(HttpRequestMessage reqObject)
        {
            string             walletaccNo         = string.Empty;
            StatementDataModel _StatementDataModel = new StatementDataModel();

            _businessData = _IDataManipulation.GetBusinessData(reqObject);

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _StatementDataModel = JsonConvert.DeserializeObject <StatementDataModel>(_requestedDataObject.BusinessData);
            }
            var result = _IMiniStatementService.GetMiniStatment(_StatementDataModel);

            //var result = _IOrganogramService.GetChannelMemberData("01913584138");

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Data Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#3
0
        public HttpResponseMessage AddFundTransfer(HttpRequestMessage reqObject)
        {
            string result        = string.Empty;
            int    result_result = 0;
            string result_msg    = "information hasn't been added";

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _FundTransfer = new FundTransfer();
                _FundTransfer = JsonConvert.DeserializeObject <FundTransfer>(_requestedDataObject.BusinessData);

                bool IsValid = ModelValidation.TryValidateModel(_FundTransfer, out _modelErrorMsg);
                if (IsValid)
                {
                    result = _IFundTransferService.AddFundTransfer(_FundTransfer);
                    var split = result.ToString().Split(':');
                    result_result = Convert.ToInt32(split[0]);
                    result_msg    = split[1];
                }
            }
            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result_result, _modelErrorMsg);
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result_result, result_msg);
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#4
0
        public HttpResponseMessage DeleteErrorLog(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _ErrorLog = JsonConvert.DeserializeObject <ErrorLog>(_requestedDataObject.BusinessData);
            }

            if (_ErrorLog == null || string.IsNullOrWhiteSpace(_ErrorLog.SL))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Error Id Not Found...");
                _response        = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                return(_response);
            }

            result = _IErrorLogService.DeleteErrorLog(_ErrorLog);
            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been deleted successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Error Id Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#5
0
        public async Task <HttpResponseMessage> AddFundOut(HttpRequestMessage reqObject)
        {
            string result = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);

            _FundOut = new FundOut();
            _FundOut = await Task.Factory.StartNew(() => JsonConvert.DeserializeObject <FundOut>(_requestedDataObject.BusinessData));

            result = await _IFundOutService.AddFundOut(_FundOut);

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

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(1, "Fund Out successfully. Your transaction id " + result);
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(0, "Data Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage AddCommonService(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _CommonService = new CommonService();
                _CommonService = JsonConvert.DeserializeObject <CommonService>(_requestedDataObject.BusinessData);

                bool IsValid = ModelValidation.TryValidateModel(_CommonService, out _modelErrorMsg);
                if (IsValid)
                {
                    result = _ICommonService.AddCommonService(_CommonService);
                }
            }
            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg);
            }
            else if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been added successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been added");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#7
0
        public HttpResponseMessage GetEOD(HttpRequestMessage reqObject)
        {
            var result = _IEODService.GetEOD();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Data Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#8
0
        public HttpResponseMessage GetAllCusTypeWiseServiceList(HttpRequestMessage reqObject)
        {
            var result = _ICusTypeWiseServiceListService.GetAllCusTypeWiseServiceList();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Customer Type Wise Service s Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage UserActivityLogByAccNo(HttpRequestMessage reqObject)
        {
            string WalletAccountNo = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedData != null && _requestedDataObject.BusinessData != null)
            {
                _UserActivityLog = JsonConvert.DeserializeObject <UserActivityLog>(_requestedDataObject.BusinessData);
                WalletAccountNo  = _UserActivityLog.WalletAccountNo;
            }
            if (string.IsNullOrWhiteSpace(WalletAccountNo))
            {
                _serviceResponse = _IDataManipulation.ResopnseWhenDataNotFound("Information Not Found");
                _response        = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                return(_response);
            }

            var result = _IUserActivityLogService.UserActivityLogByAccNo(WalletAccountNo);

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Information Not Found");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage GetAllAccInfo(HttpRequestMessage reqObject)
        {
            //_businessData = _IDataManipulation.GetBusinessData(reqObject);
            var result = _IAccInfoService.GetAllAccInfo();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Data Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#11
0
        public HttpResponseMessage GetReportConfigParams(HttpRequestMessage reqObject)
        {
            string FunctionId = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                FunctionId = JsonConvert.DeserializeObject <string>(_requestedDataObject.BusinessData);
                //_ReportConfigMasters = JsonConvert.DeserializeObject<ReportConfigMaster>(_requestedDataObject.BusinessData);
                //FunctionId = _ReportConfigMasters.FunctionId;
            }

            if (!string.IsNullOrWhiteSpace(FunctionId))
            {
                _ReportConfigParam = new List <ReportConfigParam>();
                //_ReportConfigMasters = _IReportService.GetReportConfigMasterByFunctionId(FunctionId);
                _ReportConfigParam = _IReportService.GetReportConfigParamByFunctionId(FunctionId);
                //_ReportConfigMasters.DatabaseConnection = _IReportService.GetDatabaseConConfigByFunctionId(_ReportConfigMasters.ConnectionId);
            }
            if (_ReportConfigParam != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_ReportConfigParam, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_ReportConfigParam, "Account Status Setup Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#12
0
        public HttpResponseMessage AddAccTypeWiseTarget(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _AccTypeWiseTarget = JsonConvert.DeserializeObject <AccTypeWiseTarget>(_requestedDataObject.BusinessData);
                result             = _IAccTypeWiseTargetService.AddAccTypeWiseTarget(_AccTypeWiseTarget);
            }

            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been added successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Information hasn't been added");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage UploadFile(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _FileUpload = JsonConvert.DeserializeObject <File_Upload>(_requestedDataObject.BusinessData);
                result      = _IFile_UploadService.UploadFile(_FileUpload);
            }

            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been added successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Account Type Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage AddTransactionRule(HttpRequestMessage requestObj)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(requestObj);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _TransactionRules = JsonConvert.DeserializeObject <TransactionRules>(_requestedDataObject.BusinessData);
                result            = _ITransactionRulesService.AddTransactionRules(_TransactionRules);
            }
            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been added successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information can't be added successfully");
            }

            _response = _IDataManipulation.CreateResponse(_serviceResponse, requestObj);
            return(_response);
        }
        public HttpResponseMessage TopPerformerInfo(HttpRequestMessage reqObject)
        {
            LedgerTxn _LedgerTxn = new LedgerTxn();

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _LedgerTxn = JsonConvert.DeserializeObject <LedgerTxn>(_requestedDataObject.BusinessData);
            }

            var result = _ITopPerformerService.TopPerformerInfo(_LedgerTxn);

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(0, "Top Performer Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#16
0
        public HttpResponseMessage GetAllLedgerTxnByAccNoandDate(HttpRequestMessage reqObject)
        {
            List <LedgerTxnHist> _LedgerTxnHist = new List <LedgerTxnHist>();

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _LedgerTxn     = JsonConvert.DeserializeObject <LedgerTxn>(_requestedDataObject.BusinessData);
                _LedgerTxnHist = _IChannelLedgerService.GetAllLedgerTxnByAccNoandDate(_LedgerTxn);
            }
            if (_LedgerTxnHist != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_LedgerTxnHist, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_LedgerTxnHist, "Channel Account Profile Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#17
0
        public HttpResponseMessage GetAllTransactionTemplate(HttpRequestMessage reqObject)
        {
            var result = _ITransactionTemplateService.GetAllTransactionTemplate();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Status Wise Services Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#18
0
        public HttpResponseMessage GetAllSpecialOffer(HttpRequestMessage reqObject)
        {
            var result = _ISpecialOfferService.GetAllSpecialOffers();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Account Types Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#19
0
        public HttpResponseMessage VerifyAuthLog(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                var  _AuthLog = JsonConvert.DeserializeObject <AuthLog>(_requestedDataObject.BusinessData);
                bool IsValid  = ModelValidation.TryValidateModel(_AuthLog, out _modelErrorMsg);
                if (IsValid)
                {
                    if (_AuthLog.FunctionId == "090106001") //NFT
                    {
                        result = _IAuthLogService.VerifyAuthLog(_AuthLog.LogId, _AuthLog.Remarks, _AuthLog.AuthStatusId, _AuthLog.MakeBy, _AuthLog.SelectedAuthLogIdList);
                    }
                    else if (_AuthLog.FunctionId == "090106002") //FT
                    {
                        result = _IAuthLogService.VerifyAuthLog_FT(_AuthLog.LogId, _AuthLog.Remarks, _AuthLog.AuthStatusId, _AuthLog.MakeBy, _AuthLog.SelectedAuthLogIdList);
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg);
            }
            else if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Processed successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Can't Process");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#20
0
        public HttpResponseMessage GetBillInfo(HttpRequestMessage reqObject)
        {
            int    result     = 0;
            string APIADDRESS = null;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                //_UsbParamAPI = JsonConvert.DeserializeObject<UsbParam>(_requestedDataObject.BusinessData);
                //   string PvID = _UsbParamAPI.PvId;
                //   UsbParamService obj_UsbParamService = new UsbParamService();
                //   var AllUsbParam = obj_UsbParamService.GetAPI(PvID);
                //   if (AllUsbParam != null)
                //   {
                //       var json = JsonConvert.SerializeObject(AllUsbParam);
                //      // JArray a = JArray.Parse(json);
                //       //JObject jsonObj = JObject.Parse(json);

                //       //_serviceResponse = _IDataManipulation.SetResponseObject(AllUsbParam, "information has been updated successfully");
                //       //_response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);

                //       //_UsbParamAPI = JsonConvert.DeserializeObject<UsbParam>(_serviceResponse.ResponseBusinessData);
                //       //APIADDRESS = json[0];
                //   }
                //   else
                //   {
                //       APIADDRESS = null;
                //   }
                //UsbReceive obJ_UsbReceive = new UsbReceive();
                //USBServiceRequest obj_USBServiceRequest = new USBServiceRequest();
                _UsbParamAPI = JsonConvert.DeserializeObject <UsbParam>(_requestedDataObject.BusinessData);
                APIADDRESS   = _UsbParamAPI.PvApiAddress;
                RootObject obj_RootObject = new RootObject();
                obj_RootObject.body   = JsonConvert.DeserializeObject <Body>(_requestedDataObject.BusinessData);
                obj_RootObject.header = JsonConvert.DeserializeObject <Header>(_requestedDataObject.BusinessData);
                dynamic data = JsonConvert.SerializeObject(obj_RootObject);
                //dynamic url = ConfigurationManager.AppSettings["UtilityServiceAPIDev_server"].ToString() + "Service/UtilityServiceBillCollection/Request";
                dynamic url = APIADDRESS;
                using (var client = new WebClient())
                {
                    var response = string.Empty;
                    client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
                    try
                    {
                        response = client.UploadString(new Uri(url), "POST", data);
                    }
                    catch (Exception ex)
                    {
                        _serviceResponse = _IDataManipulation.SetResponseObject(result, "404 Server not responding!!");
                        _response        = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                        return(_response);
                    }

                    if (response != null)
                    {
                        _serviceResponse = _IDataManipulation.ResopnseWhenDataFound(response, "information has been fetched successfully");
                    }
                    else if (response == "")
                    {
                        _serviceResponse = _IDataManipulation.SetResponseObject(result, "404 Server not responding!!");
                    }
                    //obj_RootObject = JsonConvert.DeserializeObject<RootObject>(response);
                    _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                    return(_response);
                }
            }
            return(_response);
        }
        public HttpResponseMessage GetAllChannelAccProfile(HttpRequestMessage reqObject)
        {
            var result = _IChannelAccProfileService.GetAllChannelAccProfile();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Channel Account Profile Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage GetAllReportConfigMaster(HttpRequestMessage reqObject)
        {
            var result = _IReportConfigarationService.GetAllReportConfigMaster();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Report Configaration Master Information Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#23
0
        public HttpResponseMessage Login(HttpRequestMessage reqObject)
        {
            string result = "0";

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                var  _userObj = JsonConvert.DeserializeObject <UserCredentials>(_requestedDataObject.BusinessData);
                bool IsValid  = ModelValidation.TryValidateModel(_userObj, out _modelErrorMsg);
                if (IsValid)
                {
                    string url = ConfigurationManager.AppSettings["LgurdaService_server"] + "/Verify_User_And_Password_For_login/" + _userObj.UserId + "/" + _userObj.Password + "/" + _requestedDataObject.SessionId + "/" + _requestedDataObject.RequestClientIP + "/" + _requestedDataObject.RequestAppId + "?format=json";
                    result = HttpWcfRequest.PostParameter(url);
                    string[] vResult = result.Split(',');
                    if (vResult[0] == "1")
                    {
                        //_AccInfo = new AccInfo();
                        string _userId  = _userObj.UserId;
                        var    _AccInfo = _IAccInfoService.GetAccInfoForDetails(_userId);
                        if (_AccInfo != null)
                        {
                            vResult[1] = _AccInfo.AccTypeId;
                            result     = string.Join(",", vResult);
                        }
                        else
                        {
                            result = "0";
                        }
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg);
            }
            else if (!string.IsNullOrWhiteSpace(result))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been added");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#24
0
        public HttpResponseMessage AddCashInIso20022(HttpRequestMessage reqObject)
        {
            string result        = string.Empty;
            int    result_result = 0;
            string result_msg    = "information hasn't been added";
            var    requestedData = reqObject.Content.ReadAsStringAsync().Result;

            mTaka.Utility.ISO20022.Pacs008.Document obj = new mTaka.Utility.ISO20022.Pacs008.Document();
            Exception ex;
            var       deserializestatus = Utility.ISO20022.Pacs008.Document.Deserialize(requestedData, out obj, out ex);

            if (!deserializestatus)
            {
                return(new HttpResponseMessage(HttpStatusCode.NotAcceptable));
            }
            var responseDoucment = new mTaka.Utility.ISO20022.Camt054.Document();

            var cdtTrxInf = obj?.FIToFICstmrCdtTrf.CdtTrfTxInf.FirstOrDefault();

            if (cdtTrxInf?.IntrBkSttlmAmt.Value != null)
            {
                var creditorAccount = cdtTrxInf?.CdtrAcct.Id.Item as GenericAccountIdentification1;
                var debitorAccount  = cdtTrxInf?.DbtrAcct.Id.Item as GenericAccountIdentification1;
                _UserTransaction = new UserTransaction()
                {
                    FromSystemAccountNo = debitorAccount?.Id,
                    ToSystemAccountNo   = creditorAccount?.Id,
                    DefineServiceId     = "003",
                    FunctionId          = "090107003",
                    FunctionName        = "CashIn",
                    Amount    = (decimal)cdtTrxInf?.IntrBkSttlmAmt.Value,
                    Narration = "Cashout",
                    MakeBy    = "Prova"
                };

                bool IsValid = ModelValidation.TryValidateModel(_UserTransaction, out _modelErrorMsg);
                if (IsValid)
                {
                    result = _ICashInService.AddCashIn(_UserTransaction, out responseDoucment);
                    var split = result.ToString().Split(':');
                    result_result = Convert.ToInt32(split[0]);
                    result_msg    = split[1];
                }
            }
            if (result_result == 1)
            {
                var ntfctn = responseDoucment.BkToCstmrDbtCdtNtfctn.Ntfctn.FirstOrDefault() ?? new AccountNotification15();
                var ntry   = ntfctn.Ntry.FirstOrDefault() ?? new ReportEntry9();
                ntry.CdtDbtInd = CreditDebitCode.CRDT;
            }

            var responseString = responseDoucment.Serialize(new UTF8Encoding());

            return(_IDataManipulation.CreateHttpResponseXml(responseString));

            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result_result, _modelErrorMsg);
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result_result, result_msg);
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
        public HttpResponseMessage GetCustomerById(HttpRequestMessage reqObject)
        {
            dynamic WalletAccountNo = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _CustomerProfile = JsonConvert.DeserializeObject <CustomerAccProfile>(_requestedDataObject.BusinessData);
                WalletAccountNo  = _CustomerProfile.WalletAccountNo;
            }

            dynamic result = null;

            if (!string.IsNullOrWhiteSpace(WalletAccountNo))
            {
                //_CustomerProfile = new CustomerAccProfile();
                result = _ICustomerAccProfileService.GetCustomerById(_CustomerProfile);
            }
            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Customer Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#26
0
        public HttpResponseMessage GetAllDistrictInfo(HttpRequestMessage reqObject)
        {
            var result = _IDistrictInfoService.GetAllDistrictInfo();

            if (result != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Account Status Setup Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
示例#27
0
        public HttpResponseMessage CheckGLAccNo(HttpRequestMessage reqObject)
        {
            string glAccountNo = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                glAccountNo = _requestedDataObject.BusinessData;
            }

            if (!string.IsNullOrWhiteSpace(glAccountNo) && glAccountNo.Length == 11)
            {
                _GLChart = new GLChart();
                _GLChart = _IGLChartService.GetGLChartByAccNo(glAccountNo);
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(0, "Please select GL Type then type GL Account Number..");
            }

            if (_GLChart != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(0, "GL Account alrady exist.");
            }
            else
            {
                _serviceResponse = _serviceResponse == null?_IDataManipulation.SetResponseObject(1, "GL Account Not Found...") : _serviceResponse;
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }