Пример #1
0
        public ActionResult FilterAuthorizeCardChargesScreen(FilterAccountTypeVM request, string RequestType)
        {
            if (RequestType == "Add")
            {
                List <CardChargesVM> viewModel = ReviewMethods.FilterCardChargesRequestDetails(request, "R");
                return(PartialView("_partialReviewAuthorizeCardChargesAddView", viewModel));
            }
            else
            {
                //fetch from system requests
                List <tbl_System_Requests> lst = new SystemRequestDataAccess().GetAllSystemRequests("R", Constants.RequestTypes.CardCharges_SystemRequest);

                List <CardChargesVM> lstData = new List <CardChargesVM>();
                for (int i = 0; i < lst.Count; i++)
                {
                    CardChargesVM item = new CardChargesVM();
                    item = CustomHelper.ParseJson <CardChargesVM>(lst[i].UpdatedData);
                    var cardChargesData = new CardChargesDataAccess().GetCardChargeDetailsById(item.ID);
                    item.Title                 = lst[i].ID.ToString();//setting title as ID so it could be used at hyperlink
                    item.AccountTypeName       = cardChargesData.tbl_Account_Types.Name;
                    item.CardTypeName          = cardChargesData.tbl_Card_Types.Title;
                    item.AuthorizationComments = lst[i].AuthorizationComments;
                    lstData.Add(item);
                }

                return(PartialView("_partialReviewAuthorizeCardChargesUpdateView", lstData));
            }
        }
Пример #2
0
        public static CardChargesVM GetCardChargeDetail(int cardTypeId, int accountTypeId, string authorizeStatus = default(string))
        {
            var data = new CardChargesDataAccess().GetCardChargesByCardNAccount(accountTypeId, cardTypeId).FirstOrDefault();

            if (!string.IsNullOrEmpty(authorizeStatus))
            {
                data = (data?.AuthorizationStatus ?? string.Empty) == authorizeStatus ? data : null;
            }
            if (data == null)
            {
                return(null);
            }

            return(new CardChargesVM
            {
                ID = data.ID,
                AccountTypeID = data.AccountTypeID,
                Amount = data.Amount,
                CardTypeID = data.CardTypeID,
                Frequency = data.Frequency,
                IsActive = data.IsActive,
                Title = data.Title,
                IsFED = data.IsFED,
                IsReplacement = data.IsReplacement
            });
        }
Пример #3
0
        public static List <CardChargesVM> GetCardChargeByCardTypeAccount(int cardTypeId, int accountTypeId)
        {
            var data = new CardChargesDataAccess().GetCardChargeByCardTypeAccount(cardTypeId, accountTypeId);

            return(data.Select(e => new CardChargesVM
            {
                ID = e.ID,
                Title = e.Title
            }).ToList());
        }
Пример #4
0
        public static RegionalChargesVM GetRegionalChargesDetail(int cardChargeID, int regionID)
        {
            var data = new CardChargesDataAccess().GetRegionalCharges(cardChargeID, regionID);

            if (data == null)
            {
                return(null);
            }

            return(new RegionalChargesVM
            {
                PercentageAmount = data.PercentageAmount
            });
        }