public LearnAimFunding LearnAimFundingWithValidity(FundModel fm, LearnDelFAMCode sofCode, DateTime learnStartDate) { switch (fm) { case FundModel.NonFunded: switch (sofCode) { case LearnDelFAMCode.SOF_HEFCE: return(new LearnAimFunding() { LearnAimRef = "40005240", FundModel = fm }); default: throw new NotImplementedException($"LearnAimFundingWithValidity asked for FundingModel {fm} but with not implemented Source of Funding (SOF) {sofCode}"); } case FundModel.Adult: return(new LearnAimFunding() { LearnAimRef = "60039309", FundModel = fm }); default: throw new NotImplementedException($"LearnAimFundingWithValidity asked for not implemented FundingModel {fm} also Source of Funding (SOF) {sofCode}"); } }
public LearnAimFunding LearnAimWithLevel(FullLevel level, FundModel fm) { switch (fm) { case FundModel.Adult: { switch (level) { case FullLevel.Level2: return(new LearnAimFunding() { LearnAimRef = "60145286", FundModel = FundModel.Adult }); case FullLevel.Level3: return(new LearnAimFunding() { LearnAimRef = "60061133", FundModel = FundModel.Adult }); default: throw new NotImplementedException($"LearnAimWithLevel asked for not implemented level {level}"); } } default: throw new NotImplementedException($"LearnAimWithLevel asked for not implemented FundModel {fm} (level) {level}"); } }
public async Task <IActionResult> New(FundModel fund) { try { if (fund == null) { return(Json(false, new JsonSerializerSettings())); } if (!ModelState.IsValid) { return(View(fund)); } if (fund.NAV <= 0) { ModelState.AddModelError("NAV", Model.Resources.ValidationMessages.MinNAV); return(View(fund)); } var result = await _fundService.Save(fund); } catch (System.Exception ex) { throw ex; } return(RedirectToAction("List")); }
//------------------------------------------------------------------------------------------------ //Fund Tab //------------------------------------------------------------------------------------------------ public ActionResult GetFundDTable() { FundModel model = new FundModel(); List <FundList> getFundList = new List <FundList>(); var SQLQuery = "SELECT * FROM [Tbl_FMFund_Fund]"; using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString())) { Connection.Open(); using (SqlCommand command = new SqlCommand("[dbo].[SP_Fund]", Connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery)); SqlDataReader dr = command.ExecuteReader(); while (dr.Read()) { getFundList.Add(new FundList() { FundID = GlobalFunction.ReturnEmptyInt(dr[0]), FundTitle = GlobalFunction.ReturnEmptyString(dr[1]), FundCode = GlobalFunction.ReturnEmptyString(dr[2]) }); } } Connection.Close(); } model.getFundList = getFundList.ToList(); return(PartialView("FundTab/_TableFund", model.getFundList)); }
public void LoadFund() { ImusCityHallEntities db = new ImusCityHallEntities(); List <FundModel> fundList = new List <FundModel>(); foreach (var item in db.FundBanks) { var fund = new FundModel() { id = item.FundBankID, FundBankName = string.Join("-", item.Fund.FundPrefix, item.AccountNumber, item.Fund.FundName, item.Bank.BankCode), FundName = item.Fund.FundName, BankName = item.Bank.BankCode, Prefix = item.Fund.FundPrefix, AccountNumber = item.AccountNumber, CurrentBalance = item.CurrentBalance.HasValue ? item.CurrentBalance.Value : 0 }; fundList.Add(fund); } fundcb.ItemsSource = fundList; fundcb.SelectedValuePath = "id"; fundcb.DisplayMemberPath = "FundBankName"; }
private void btnSearch_Click(object sender, RoutedEventArgs e) { if (tbxSrhContent.Text == "") { return; } fdModle = (FundModel)getuTrade.GetFundByName(tbxSrhContent.Text); lvFundName.ItemsSource = fdModle.Datas; }
async private void GetAllStocksMethod() { FundModel fund = new FundModel(new List <StockModel>(await _stockRepository.GetAllStocks())); Items = new ObservableCollection <StockModel>(fund.Stocks); Fund = fund; Details = new DetailsViewModel(Fund); }
public async Task <Fund> Update(FundModel fund) { try { var fundDto = _mapper.Map <FundModel, Fund>(fund); return(await _fundManager.Update(fundDto)); } catch (Exception ex) { throw ex; } }
public async Task UpdateFund(FundModel fund) { var entity = await _fundRepository.GetById(fund.Id).Result(); entity.Amount = fund.Amount; entity.UpdatedBy = fund.UpdatedBy; entity.UpdatedOn = DateTime.UtcNow; entity.ApprovedBy = fund.ApprovedBy; entity.ApprovedOn = entity.ApprovedBy.HasValue ? (DateTime?)DateTime.UtcNow : null; entity.StatusId = fund.StatusId; await _fundRepository.EditAsync(entity); }
public ActionResult GetFundForm(int ActionID, int PrimaryID) { FundModel model = new FundModel(); if (ActionID == 2) { var fund = (from a in BOSSDB.Tbl_FMFund_Fund where a.FundID == PrimaryID select a).FirstOrDefault(); model.FundList.FundTitle = fund.FundTitle; model.FundList.FundCode = fund.FundCode; model.FundList.FundID = fund.FundID; } model.ActionID = ActionID; return(PartialView("FundTab/_FundForm", model)); }
private FundModel SerializeFund(Fund fund) { if (fund != null) { var result = new FundModel( fund.Id, fund.Name, fund.ShortName, fund.Ticker, fund.IssuerId, fund.SecurityType ); return(result); } else { return(null); } }
public async Task <IActionResult> EditFund(FundModel fund) { try { if (fund == null) { return(Json(false, new JsonSerializerSettings())); } if (!ModelState.IsValid) { return(View("Edit", fund)); } var result = await _fundService.Update(fund); } catch (System.Exception ex) { throw ex; } return(RedirectToAction("List")); }
public void TestMigrationProbabalistic() { var parameterDefinition = new Parameters(); parameterDefinition.ReadExcelFile("Parameter - Base.xlsm"); var p = parameterDefinition.GetBestGuess(); var m = FundModel.GetModel(); var res = m.Run(p); var c = new Clock(Timestep.FromYear(1951), Timestep.FromYear(2999)); while (!c.IsLastTimestep) { var regions = res.Dimensions.GetValues <Region>(); double totalLeave = (from r in regions select(double) res["ImpactSeaLevelRise", "leave"][c.Current, r]).Sum(); double totalEnter = (from r in regions select(double) res["ImpactSeaLevelRise", "enter"][c.Current, r]).Sum(); Assert.IsTrue(Math.Abs(totalLeave - totalEnter) < 1.0, "Migration doesn't even out"); c.Advance(); } }
public async Task <Guid> Add(FundModel fund) { var fundDTO = _mapper.Map <FundDTO>(fund); return(await _fundService.Add(fundDTO)); }
public DetailsViewModel(FundModel fund) { this.fund = fund; }
public async Task Update(FundModel fund) { var fundDTO = _mapper.Map <FundDTO>(fund); await _fundService.Update(fundDTO); }
public ActionResult SaveFund(FundModel model) { var isExist = ""; if (ModelState.IsValid) { var fundTitle = model.FundList.FundTitle; fundTitle = new CultureInfo("en-US").TextInfo.ToTitleCase(fundTitle); Tbl_FMFund_Fund checkFund = (from a in BOSSDB.Tbl_FMFund_Fund where (a.FundTitle == fundTitle || a.FundCode == model.FundList.FundCode) select a).FirstOrDefault(); if (model.ActionID == 1) { if (checkFund == null) { Tbl_FMFund_Fund fund = new Tbl_FMFund_Fund(); fund.FundTitle = fundTitle; fund.FundCode = model.FundList.FundCode; BOSSDB.Tbl_FMFund_Fund.Add(fund); BOSSDB.SaveChanges(); isExist = "false"; } else if (checkFund != null) { isExist = "true"; } } else if (model.ActionID == 2) { Tbl_FMFund_Fund fund = (from a in BOSSDB.Tbl_FMFund_Fund where a.FundID == model.FundList.FundID select a).FirstOrDefault(); List <Tbl_FMFund_Fund> fundTitlelist = (from e in BOSSDB.Tbl_FMFund_Fund where e.FundTitle == fundTitle select e).ToList(); List <Tbl_FMFund_Fund> fundCode = (from e in BOSSDB.Tbl_FMFund_Fund where e.FundCode == model.FundList.FundCode select e).ToList(); if (checkFund != null) { if (fund.FundTitle == fundTitle && fund.FundCode == model.FundList.FundCode) { fund.FundTitle = fundTitle; fund.FundCode = model.FundList.FundCode; BOSSDB.Entry(fund); BOSSDB.SaveChanges(); isExist = "justUpdate"; } else { if (fund.FundTitle != fundTitle && fundTitlelist.Count >= 1 || fund.FundCode != model.FundList.FundCode && fundCode.Count >= 1) { isExist = "true"; } else { fund.FundTitle = fundTitle; fund.FundCode = model.FundList.FundCode; BOSSDB.Entry(fund); BOSSDB.SaveChanges(); isExist = "justUpdate"; } } } else if (checkFund == null) { fund.FundTitle = fundTitle; fund.FundCode = model.FundList.FundCode; BOSSDB.Entry(fund); BOSSDB.SaveChanges(); isExist = "justUpdate"; } } } return(new JsonResult() { JsonRequestBehavior = JsonRequestBehavior.AllowGet, Data = new { isExist = isExist } }); }
public async Task AddFund(FundModel fund) { await _fundRepository.AddAsync(_mapper.Map <Fund>(fund)); }
// GET: FileMaintenanceFund public ActionResult FileFund() { FundModel model = new FundModel(); return(View()); }
//Fund Tab public ActionResult GetFundTab() { FundModel model = new FundModel(); return(PartialView("FundTab/IndexFundTab", model)); }