// GET: Create A Single ClientFee
        public ActionResult Create()
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            ClientFeeVM clientFeeVM = new ClientFeeVM();
            ClientFee   clientFee   = new ClientFee();

            FeeType feeType = new FeeType();

            clientFee.FeeType     = feeType;
            clientFeeVM.ClientFee = clientFee;

            FeeTypeRepository feeTypeRepository = new FeeTypeRepository();

            clientFeeVM.FeeTypes = feeTypeRepository.GetAllFeeTypes().ToList();

            GDSRepository gdsRepository = new GDSRepository();

            clientFeeVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName");

            ContextRepository contextRepository = new ContextRepository();

            clientFeeVM.Contexts = new SelectList(contextRepository.GetAllContexts().ToList(), "ContextId", "ContextName");

            return(View(clientFeeVM));
        }
Esempio n. 2
0
        public void FeeTypeRepository_GetAllValues()
        {
            var repo = new FeeTypeRepository();

            var values = repo.GetAllValues <List <FeeType> >();

            Assert.IsNotNull(values);
            Assert.IsTrue(values.Count > 0);
        }
Esempio n. 3
0
        public void FeeTypeRepository_GetValue()
        {
            var repo = new FeeTypeRepository();

            var value = repo.GetValue <FeeType>("AmountExcludingFee");

            Assert.IsNotNull(value);
            Assert.AreEqual("Amount Excluding Fee", value.Display);
        }
Esempio n. 4
0
        public void FeeTypeRepository_RemoveValue()
        {
            var repo = new FeeTypeRepository();

            var key = "AmountExcludingFee";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }
Esempio n. 5
0
 /// <summary>
 ///     Instantiates a new Send Reversal Parameters View Model.
 /// </summary>
 /// <param name="settingsSvc"></param>
 /// <param name="messageBus"></param>
 public SendReversalParametersViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _messageBus                   = messageBus;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _refundReasonRepository       = new RefundReasonRepository();
 }
Esempio n. 6
0
 /// <summary>
 ///     Create this viewmodel with settings provided by given settingsSvc
 /// </summary>
 /// <param name="settingsSvc">Settings service</param>
 /// <param name="messageBus"></param>
 public ReceiveViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _messageBus = messageBus;
     _messageBus.Subscribe <ProductChangeEvent>(ProductChanged);
     _messageBus.Subscribe <AgentLocationChangedEvent>(AgentLocationChanged);
 }
 /// <summary>
 ///     Create this viewmodel with settings provided by given settingsSvc
 /// </summary>
 /// <param name="settingsSvc">Settings service</param>
 /// <param name="messageBus"></param>
 /// <param name="transactionName"></param>
 public SendParametersViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus, string transactionName)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _messageBus      = messageBus;
     _transactionName = transactionName;
     _messageBus.Subscribe <ProductChangeEvent>(ProductChanged);
 }
        public ActionResult Delete(int id)
        {
            //Get Item From Database
            ClientFeeItem clientFeeItem = new ClientFeeItem();

            clientFeeItem = clientFeeItemRepository.GetItem(id);

            //Check Exists
            if (clientFeeItem == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientFeeGroup(clientFeeItem.ClientFeeGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            ClientFeeItemVM clientFeeItemVM = new ClientFeeItemVM();

            clientFeeItemVM.ClientFeeItem = clientFeeItem;

            FeeTypeRepository feeTypeRepository = new FeeTypeRepository();
            FeeType           feeType           = new FeeType();

            feeType = feeTypeRepository.GetFeeType(clientFeeItem.ClientFee.FeeTypeId);
            if (feeType.FeeTypeDescription == "Client Fee")
            {
                feeType.FeeTypeDescription = "Transaction Fee";
            }
            clientFeeItemVM.FeeType = feeType;

            SelectList clientFees = new SelectList(clientFeeRepository.GetClientFeesByType(clientFeeItem.ClientFee.FeeTypeId).ToList(), "ClientFeeId", "ClientFeeDescription");

            clientFeeItemVM.ClientFees = clientFees;

            return(View(clientFeeItemVM));
        }
Esempio n. 9
0
        public void FeeTypeRepository_UpdateValue()
        {
            var repo = new FeeTypeRepository();

            var key     = "AmountExcludingFee";
            var feeType = new FeeType
            {
                Code    = "AmountExcludingFee",
                Display = "Amount Excluding Fee"
            };

            repo.UpdateValue(key, feeType);
            var containsKey = repo.ContainsKey(key);

            var value = repo.GetValue <FeeType>(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("Amount Excluding Fee", value.Display);
        }
Esempio n. 10
0
        public void FeeTypeRepository_AddValue()
        {
            var repo = new FeeTypeRepository();

            var key     = "Fake";
            var feeType = new FeeType
            {
                Code    = "Fake",
                Display = "Fake"
            };

            repo.AddValue(key, feeType);

            var value       = repo.GetValue <FeeType>(key);
            var containsKey = repo.ContainsKey(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("Fake", value.Code);
        }
        // GET: /View
        public ActionResult View(int id)
        {
            //Check Exists
            ClientFeeItem clientFeeItem = new ClientFeeItem();

            clientFeeItem = clientFeeItemRepository.GetItem(id);
            if (clientFeeItem == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }


            FeeTypeRepository feeTypeRepository = new FeeTypeRepository();
            FeeType           feeType           = new FeeType();

            feeType = feeTypeRepository.GetFeeType(clientFeeItem.ClientFee.FeeTypeId);

            ViewData["FeeTypeDescription"] = feeType.FeeTypeDescription;
            ViewData["ClientFeeGroupName"] = clientFeeItem.ClientFeeGroup.ClientFeeGroupName;
            ViewData["ClientFeeGroupId"]   = clientFeeItem.ClientFeeGroup.ClientFeeGroupId;

            return(View(clientFeeItem));
        }
        public ActionResult List(int id, string filter, int?page, string sortField, int?sortOrder)
        {
            //Get Item From Database
            ClientFeeGroup clientFeeGroup = new ClientFeeGroup();

            clientFeeGroup = clientFeeGroupRepository.GetGroup(id);

            //Check Exists
            if (clientFeeGroup == null)
            {
                ViewData["ActionMethod"] = "ListGet";
                return(View("RecordDoesNotExistError"));
            }
            //SortField
            if (sortField != "OutputFormat" && sortField != "OutputDescription")
            {
                sortField = "ClientFeeDescription";
            }
            ViewData["CurrentSortField"] = sortField;

            //SortOrder
            if (sortOrder == 1)
            {
                ViewData["NewSortOrder"]     = 0;
                ViewData["CurrentSortOrder"] = 1;
            }
            else
            {
                ViewData["NewSortOrder"]     = 1;
                ViewData["CurrentSortOrder"] = 0;
                sortOrder = 0;
            }
            ClientFeeItemsVM clientFeeItemsVM = new ClientFeeItemsVM();

            clientFeeItemsVM.ClientFeeGroup = clientFeeGroup;

            if (clientFeeGroup.FeeTypeId == 1)
            {
                clientFeeItemsVM.FeeTypeDisplayName = "Supplemental Fee Group";
            }
            else
            {
                clientFeeItemsVM.FeeTypeDisplayName = "Transaction Fee Group";
            }

            FeeTypeRepository feeTypeRepository = new FeeTypeRepository();
            FeeType           feeType           = new FeeType();

            feeType = feeTypeRepository.GetFeeType((int)clientFeeGroup.FeeTypeId);
            clientFeeItemsVM.FeeType = feeType;

            clientFeeItemsVM.ClientFeeItems = clientFeeItemRepository.PageClientFeeItems(id, page ?? 1, sortField, sortOrder ?? 0);

            //Check Access Rights
            RolesRepository rolesRepository = new RolesRepository();

            if (rolesRepository.HasWriteAccessToClientFeeGroup(clientFeeGroup.ClientFeeGroupId))
            {
                clientFeeItemsVM.HasWriteAccess = true;
            }

            return(View(clientFeeItemsVM));
        }