Beispiel #1
0
        public static ReportContainerVm GetContainer(ReportRequestVm _reportRequestVm, IPartnerServiceIntegration _partnerIntegration, IDlsIntegration _dlsIntegration)
        {
            var reportContainer = ReportContainerHelper.GetStagedContainer(ReportType.DailyTranDetail, _partnerIntegration, _reportRequestVm);

            //DomainTranformation
            var userReportRequest = _reportRequestVm.ToUserReportsRequestModel();

            var userReport             = new ReportVm(BusinessReportsConstants.Common.USER_REPORT_NAME);
            var userReportResponseList = _partnerIntegration.GetUserReportsInfo(userReportRequest);

            foreach (UserReportsInfoResponse userReportsResponse in userReportResponseList.UserReportsInfoList)
            {
                var row = new Dictionary <string, string>();
                row.Add(BusinessReportsConstants.UserDetails.ACTIVE_USER_FLAG, string.IsNullOrEmpty(userReportsResponse.ActiveUserFlag) ? string.Empty : userReportsResponse.ActiveUserFlag);
                row.Add(BusinessReportsConstants.UserDetails.ACTIVITY_TYPE, string.IsNullOrEmpty(userReportsResponse.ActivityType) ? string.Empty : userReportsResponse.ActivityType);
                row.Add(BusinessReportsConstants.UserDetails.AGENT_ID, Convert.ToString(userReportsResponse.AgentId));
                row.Add(BusinessReportsConstants.UserDetails.AGENT_NAME, string.IsNullOrEmpty(userReportsResponse.AgentName) ? string.Empty : userReportsResponse.AgentName);
                row.Add(BusinessReportsConstants.UserDetails.DEVICE_NAME, string.IsNullOrEmpty(userReportsResponse.DeviceName) ? string.Empty : userReportsResponse.DeviceName);
                row.Add(BusinessReportsConstants.UserDetails.EDIR_GUID, string.IsNullOrEmpty(userReportsResponse.EdirGuid) ? string.Empty : userReportsResponse.EdirGuid);
                row.Add(BusinessReportsConstants.UserDetails.FIRST_NAME, string.IsNullOrEmpty(userReportsResponse.FirstName) ? string.Empty : userReportsResponse.FirstName);
                row.Add(BusinessReportsConstants.UserDetails.LAST_LOGON_LCL_DATE, (userReportsResponse.LastLogonLclDate == null) ? string.Empty : userReportsResponse.LastLogonLclDate.ToString("yyyy MMM dd"));
                row.Add(BusinessReportsConstants.UserDetails.LAST_NAME, string.IsNullOrEmpty(userReportsResponse.LastName) ? string.Empty : userReportsResponse.LastName);
                row.Add(BusinessReportsConstants.UserDetails.LDAP_USER_ID, string.IsNullOrEmpty(userReportsResponse.LdapUserId) ? string.Empty : userReportsResponse.LdapUserId);
                row.Add(BusinessReportsConstants.UserDetails.POS_NUMBER, userReportsResponse.PosNumber.ToString());
                userReport.Rows.Add(row);
            }
            reportContainer.Reports.Add(userReport);

            return(reportContainer);
        }
        public static ReportContainerVm GetContainer(ReportRequestVm _reportRequestVm, IPartnerServiceIntegration _partnerIntegration, IDlsIntegration _dlsIntegration)
        {
            var reportContainer = ReportContainerHelper.GetStagedContainer(ReportType.DailyTranDetail, _partnerIntegration, _reportRequestVm);

            //DomainTranformation
            var tranExceedRequest = _reportRequestVm.ToTransactionExceedRequestModel();

            var transactionExceedReport = new ReportVm(BusinessReportsConstants.Common.TRANEXCEED_REPORT_NAME);

            //Call repo
            var transactionExceedInfoResponse = _partnerIntegration.GetTransactionExceedInfo(tranExceedRequest);

            foreach (TransactionExceedReportsInfo item in transactionExceedInfoResponse.transactionExceedReportsInfoList)
            {
                var row = new Dictionary <string, string>();
                row.Add(BusinessReportsConstants.TransactionExceedDetails.AGENT_ID, Convert.ToString(item.AgentId));
                row.Add(BusinessReportsConstants.TransactionExceedDetails.AGENT_NAME, string.IsNullOrEmpty(item.AgentName) ? string.Empty : item.AgentName);

                row.Add(BusinessReportsConstants.TransactionExceedDetails.CITY, string.IsNullOrEmpty(item.City) ? string.Empty : item.City);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.POS_ID, string.IsNullOrEmpty(item.PosId) ? string.Empty : item.PosId);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.FIRST_NAME, string.IsNullOrEmpty(item.FirstName) ? string.Empty : item.FirstName);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.LAST_NAME, string.IsNullOrEmpty(item.LastName) ? string.Empty : item.LastName);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.LDAP_USER_ID, string.IsNullOrEmpty(item.LdapUserId) ? string.Empty : item.LdapUserId);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.EVENT_TRAN_CODE, string.IsNullOrEmpty(item.EventTranCode) ? string.Empty : item.EventTranCode);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.EVENT_TRAN_NAME, string.IsNullOrEmpty(item.EventTranName) ? string.Empty : item.EventTranName);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.TRAN_REF_ID, string.IsNullOrEmpty(item.TranRefId) ? string.Empty : item.TranRefId);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.TRAN_LIM_CODE, Convert.ToString(item.TranLimCode));
                row.Add(BusinessReportsConstants.TransactionExceedDetails.TRAN_LIM_BSNS_DESC, string.IsNullOrEmpty(item.TranLimBsnsDesc) ? string.Empty : item.TranLimBsnsDesc);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.EVENT_FACE_TRAN_AMT, Convert.ToString(item.EventFaceTranAmt));
                row.Add(BusinessReportsConstants.TransactionExceedDetails.TRAN_LIM_USD_AMT, Convert.ToString(item.TranLimUsdAmt));
                row.Add(BusinessReportsConstants.TransactionExceedDetails.MGR_FIRST_NAME, string.IsNullOrEmpty(item.MgrFirstName) ? string.Empty : item.MgrFirstName);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.MGR_LAST_NAME, string.IsNullOrEmpty(item.MgrLastName) ? string.Empty : item.MgrLastName);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.MGR_LDAP_USER_ID, string.IsNullOrEmpty(item.MgrLdapUserId) ? string.Empty : item.MgrLdapUserId);
                row.Add(BusinessReportsConstants.TransactionExceedDetails.EVENT_TRAN_EVENT_DATE, (item.EventTranEvntDate == null) ? string.Empty : item.EventTranEvntDate.ToString("yyyy MMM dd"));
                row.Add(BusinessReportsConstants.TransactionExceedDetails.EVENT_TRAN_EVENT_LCL_DATE_FIELD, (item.EventTranEvntLclDateField == null) ? string.Empty : item.EventTranEvntLclDateField.ToString("yyyy MMM dd"));

                transactionExceedReport.Rows.Add(row);
            }
            reportContainer.Reports.Add(transactionExceedReport);
            return(reportContainer);
        }
        public static ReportContainerVm GetContainer(ReportRequestVm _reportRequestVm, IPartnerServiceIntegration _partnerIntegration, IDlsIntegration _dlsIntegration, string[] strPosIds)
        {
            var reportContainer = ReportContainerHelper.GetStagedContainer(ReportType.DailyTranSummary, _partnerIntegration, _reportRequestVm);

            //Domainmodel Transformation
            var bpTranLookupReq = _reportRequestVm.ToBPTranDetailLookupModel();

            //Call required Repos
            var bPSummary          = DailyActivitySummaryViewModel.GetBPDailyActivitySummary(bpTranLookupReq, _reportRequestVm.IsDetailed, _dlsIntegration, strPosIds);
            var mtTranLookupReq    = _reportRequestVm.ToMTTranDetailLookupModel();
            var sendReceiveReport  = DailyTranDetailViewModel.GetSendReceiveDailyTranDetail(mtTranLookupReq, _dlsIntegration, _partnerIntegration, strPosIds);
            var sendTranSummary    = ReportVmHelper.GetSendSummaryReport(sendReceiveReport.Find(fitem => fitem.Name == BusinessReportsConstants.Common.SSR_NAME));
            var receiveTranSummary = ReportVmHelper.GetReceiveSummaryReport(sendReceiveReport.Find(fitem => fitem.Name == BusinessReportsConstants.Common.RSR_NAME));

            //Add all the report(s)
            reportContainer.Reports.Add(sendTranSummary);
            reportContainer.Reports.Add(receiveTranSummary);
            reportContainer.Reports.Add(bPSummary);

            return(reportContainer);
        }
Beispiel #4
0
        public static ReportContainerVm GetContainer(ReportRequestVm _reportRequestVm, IPartnerServiceIntegration _partnerIntegration, IDlsIntegration _dlsIntegration, string[] strPosIdList)
        {
            var reportContainer = ReportContainerHelper.GetStagedContainer(ReportType.DailyTranSales, _partnerIntegration, _reportRequestVm);

            //Domain Tranformation
            var dailyTranLookupReq = _reportRequestVm.ToDailyTranDetailLookupModel();
            var tranType           = string.Empty;

            //Add all the report(s)
            ReportVm rpt = new ReportVm(BusinessReportsConstants.Common.SR_NAME);

            // Map from ViewModel->Domain
            var tranDetailLookupResp = _dlsIntegration.DailyTransactionDetailLookup(dailyTranLookupReq);

            if (tranDetailLookupResp == null || tranDetailLookupResp.GetDailyTransactionDetailLookupResultList == null)
            {
                return(reportContainer);
            }

            foreach (TransactionDetailLookupResult item in tranDetailLookupResp.GetDailyTransactionDetailLookupResultList)
            {
                Dictionary <string, string> DataInfo = new Dictionary <string, string>();

                DataInfo.Add(BusinessReportsConstants.DailyTranSales.AGENT_ID, dailyTranLookupReq.AgentId);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.ISO_CURRENCY_CODE, (string.IsNullOrEmpty(item.IsoCurrencyCode)) ? "-" : item.IsoCurrencyCode);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.AGENT_LOCAL_TIME, (string.IsNullOrEmpty(item.AgentLocalTime)) ? "" : Convert.ToDateTime(item.AgentLocalTime).ToString("HH:mm"));
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.EMPLOYEE_NUMBER, string.Empty);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.RECEIVER_NAME, (string.IsNullOrEmpty(item.ReceiverName)) ? "-" : item.ReceiverName);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.REFERENCE_ID, (string.IsNullOrEmpty(item.ReferenceId)) ? "-" : item.ReferenceId);

                var serialNumber = "";
                foreach (string sItem in item.SerialNumberArray)
                {
                    serialNumber += sItem + "-";
                }
                if (!string.IsNullOrEmpty(serialNumber))
                {
                    serialNumber = serialNumber.Substring(0, serialNumber.Length - 1);
                }
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.SERIAL_NUMBER, serialNumber);

                tranType = string.Empty;

                if (item.ProductId.Equals(BusinessReportsConstants.Common.UTILITY_BILL_PAYMENT_PRODUCT_ID))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_UP;
                }
                else if (item.ProductId.Equals(BusinessReportsConstants.Common.EXPRESS_PAYMENT_PRODUCT_ID))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_EP;
                }
                else if (item.ProductId.Equals(BusinessReportsConstants.Common.MT_PRODUCT_ID) && item.EventCode.Equals(DLSActivityTypeCode.SEN.ToString()))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_SEND;
                }
                else if (item.ProductId.Equals(BusinessReportsConstants.Common.MT_PRODUCT_ID) && item.EventCode.Equals(DLSActivityTypeCode.REC.ToString()))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_RECEIVE;
                }
                else if (item.EventCode.Equals(DLSActivityTypeCode.RSN.ToString()))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_CANCEL;
                }
                else if (item.EventCode.Equals(DLSActivityTypeCode.RRC.ToString()))
                {
                    tranType = BusinessReportsConstants.Common.TRAN_TYPE_REVERSAL;
                }

                DataInfo.Add(BusinessReportsConstants.DailyTranSales.TRANSACTION_TYPE, tranType);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.AMOUNT, (string.IsNullOrEmpty(item.FaceAmount)) ? "-" : string.Format(BusinessReportsConstants.Common.AMT_FORMAT, double.Parse(item.FaceAmount)));
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.EXCHANGE_RATE, (string.IsNullOrEmpty(item.FxConsumerRate)) ? "-" : item.FxConsumerRate);
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.FEE, (string.IsNullOrEmpty(item.FeeAmount)) ? "-" : string.Format(BusinessReportsConstants.Common.AMT_FORMAT, double.Parse(item.FeeAmount)));
                DataInfo.Add(BusinessReportsConstants.DailyTranSales.SENDER, (string.IsNullOrEmpty(item.SenderName)) ? "-" : item.SenderName);

                //Get user based on mainofficeid and operatorid
                var    operatorId = (string.IsNullOrEmpty(item.OperatorId)) ? "" : item.OperatorId.ToLower();
                string userId     = null;

                userId = SupplementalValuesHelper.GetUserId(operatorId, _partnerIntegration);

                DataInfo.Add(BusinessReportsConstants.DailyTranSales.USERNAME, (userId == null) ? "-" : userId);

                if (item.FeeAmount != null)
                {
                    var faceAmount = double.Parse(item.FaceAmount);
                    var fee        = double.Parse(item.FeeAmount);
                    var total      = faceAmount + fee;
                    DataInfo.Add(BusinessReportsConstants.DailyTranSales.TOTAL, string.Format(BusinessReportsConstants.Common.AMT_FORMAT, total));
                }
                else
                {
                    DataInfo.Add(BusinessReportsConstants.DailyTranSales.TOTAL, string.Format(BusinessReportsConstants.Common.AMT_FORMAT, double.Parse(item.FaceAmount)));
                }

                if (item.PosId == null || !item.PosId.Equals("0"))
                {
                    DataInfo.Add(BusinessReportsConstants.DailyTranSales.POS_ID, (item.PosId == null) ? "-" : item.PosId);
                }
                else
                {
                    DataInfo.Add(BusinessReportsConstants.DailyTranSales.POS_ID, BusinessReportsConstants.Common.SUPER_AGENT);
                }

                //Filter by Pos ID
                foreach (string posid in strPosIdList)
                {
                    if (item.PosId == posid)
                    {
                        rpt.Rows.Add(DataInfo);
                    }
                }
            }

            reportContainer.Reports.Add(rpt);

            return(reportContainer);
        }