/// <summary> /// creat form common /// </summary> /// <param name="indicator"></param> /// <param name="unit"></param> private void FormCreateCommon(int indicator, int unit) { ViewBag.Indicator = _dFIndicatorRepository.GetByID(indicator).NameEn; ViewBag.Source = _dFSourceRepository.GetByID((int)DFSourceEnum.MinistryOfPlanning).NameEn; ViewBag.Unit = _dFUnitRepository.GetByID(unit).NameEn; ViewBag.DFYearFiscalId = new SelectList(_dFYearsRepository.GetAll(), "Id", "NameEn"); ViewBag.DFQuarterId = new SelectList(_dFQuartersRepository.GetAll(), "Id", "NameEn"); }
public IActionResult Edit(int id, [FromQuery] bool isVersion) { InvestmentFormViewModel investmentViewModel; var investmentVerModel = _investmentRepository.GetVerById(id); if (investmentVerModel != null && isVersion) { investmentViewModel = investmentVerModel.MapToInvestmentFormViewModelVer(); } else { var componentRGDPModel = _investmentRepository.GetById(id); investmentViewModel = componentRGDPModel.MapToInvestmentFormViewModel(); } ViewBag.Indicator = _dFIndicatorRepository.GetByID((int)DFIndicatorEnum.PublicInvestments).NameEn; ViewBag.Source = _dFSourceRepository.GetByID((int)DFSourceEnum.MinistryOfPlanning).NameEn; ViewBag.Unit = _dFUnitRepository.GetByID((int)DFUnitEnum.MillionEGP).NameEn; ViewBag.DFYearId = new SelectList(_dFYearsRepository.GetAll(), "Id", "NameEn", investmentViewModel.DFYearId); ViewBag.DFQuarterId = new SelectList(_dFQuartersRepository.GetAll(), "Id", "NameEn", investmentViewModel.DFQuarterId); return(View(investmentViewModel)); }