/// <summary> /// 增加定期存款记录,并向FixBalance表添加存款数据,分别向fixbalanceService,recordsService提出需求。 /// </summary> /// <param name="depositorAndCard">传入从cooike中获取的储户和储户银行卡信息。其对象为DepositorAndCard</param> /// <param name="fix">Fyear,FfixBalanceRate,FfixBalance,FfixBalance</param> /// <param name="mid">传入业务办理员账号Mid</param> public void AddFixBalanceService(DepositorAndCard depositorAndCard, Fixbalances fix, int mid) { fix.Fcid = (int)depositorAndCard.Dcid; fix.Fmid = mid; fixbalanceService.AddFixBalanceService(fix); recordsService.AddRecordsService(depositorAndCard, 0, 3, (double)fix.FfixBalance, mid); //此处的0没有意义 }
/// <summary> /// 增加定期存款 /// </summary> /// <param name="fix">Fyear,FfixBalanceRate,FfixBalance,FfixBalance</param> public void AddData(Fixbalances fix) { using (var dbContext = new bankContext()) { //修改数据库信息最好有一些事务操作 using (var transaction = dbContext.Database.BeginTransaction()) { try { dbContext.Add(fix); dbContext.SaveChanges(); transaction.Commit(); } catch (Exception e) { Console.WriteLine(e.Message); transaction.Rollback(); } } } }
/// <summary> /// internal代表内部的意思 /// </summary> /// <param name="fix">Fyear,FfixBalanceRate,FfixBalance,FfixBalance</param> internal void AddFixBalanceService(Fixbalances fix) { accessFixbalance.AddData(fix); }
/// <summary> /// 定期存款表增加记录。 /// </summary> /// <param name="fix">Fyear,FfixBalanceRate,FfixBalance,FfixBalance</param> /// <returns></returns> public IActionResult AddFixBalance(Fixbalances fix) { managerServive.AddFixBalanceService(DAndC(), fix, ManagerRequestCookie().Mid); return(RedirectToAction("Success", "Managers")); }