Ejemplo n.º 1
0
        private void SetViewBagEditIndicator(EditIndicatorPageViewModel <FundBasicDataViewModel> model)
        {
            ViewBag.UnitOfMeasureList = new List <SelectListItem>();
            ViewBag.FundList          = new List <SelectListItem>();
            ViewBag.ThemeList         = new List <MultiDropDownItem>();

            this.SetViewBagListFromCatalog(_catalogService,
                                           new Dictionary <ConvergenceMasterDataTypeEnum, string>
            {
                { ConvergenceMasterDataTypeEnum.UnitMeasureCGM, "UnitOfMeasureList" },
            });

            var responseThemes = _catalogService.GetMasterDataListByTypeCode(false, ConvergenceMasterDataTypeEnum.IndicatorTheme.GetEnumDescription());

            if (responseThemes.MasterDataCollection == null)
            {
                responseThemes.MasterDataCollection = new List <MasterDataViewModel>();
            }

            ViewBag.ThemeList = responseThemes.MasterDataCollection.ConvertToMultiDropDownItems();

            var responseFund = _fundService.GetFunds();

            if (responseFund.IsValid)
            {
                ViewBag.FundList = responseFund.Funds;
            }

            ViewBag.indicatorTemplateList = base.GetTemplatesCombo(_fundService);
        }
Ejemplo n.º 2
0
        public IActionResult List(int pageSize = 0, int pageIndex = 0)
        {
            try
            {
                FundsModel model = new FundsModel();
                //pageSize = pageSize == 0 ? _configuration.GetValue<int>("PagingConfig:PageSize") : pageSize;
                //pageIndex = pageIndex == 0 ? 1 : pageIndex;

                ViewBag.SearchFundsModel = new SearchFund();

                model.Funds = _fundService.GetFunds(pageSize, pageIndex)?.ToList();

                return(View(model));
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public IHttpActionResult GetAllFunds()
        {
            try
            {
                IList <FundViewModels> fundList = new List <FundViewModels>();
                IEnumerable <Fund>     fundlst;

                fundlst = _fund.GetFunds();

                foreach (Fund fund in fundlst)
                {
                    FundViewModels fundVM = new FundViewModels();

                    fundVM.accountNumber = fund.AccountNumber;
                    fundVM.bank          = fund.Bank;
                    fundVM.bankId        = fund.BankId;
                    fundVM.branch        = fund.Branch;
                    fundVM.code          = fund.Code;
                    fundVM.description   = fund.Description;
                    fundVM.name          = fund.Name;
                    fundVM.id            = fund.Id;

                    fundList.Add(fundVM);
                }
                var messageData  = new { code = ReadOnlyValue.SuccessMessageCode, message = ReadOnlyValue.MessageSuccess };
                var returnObject = new { fundList = fundList, messageCode = messageData };
                return(Ok(returnObject));
            }

            catch (Exception ex)
            {
                string errorLogId   = _eventLogService.WriteLogs(User.Identity.Name, ex, MethodBase.GetCurrentMethod().Name);
                var    messageData  = new { code = ReadOnlyValue.ErrorMessageCode, message = String.Format(ReadOnlyValue.MessageTaskmateError, errorLogId) };
                var    returnObject = new { messageCode = messageData };
                return(Ok(returnObject));
            }
        }
Ejemplo n.º 4
0
 public IEnumerable <Fund> GetFunds()
 {
     return(_fundService.GetFunds());
 }