Esempio n. 1
0
 /// <summary>
 /// Builds the simulation using the connected references from the db pick-up
 /// </summary>
 /// <returns>Returns the initial build of the simulation</returns>
 public Simulation BuildSimulation(SimulationAssumptions assumptions)
 {
     this.SimulationAssumptions = assumptions;
     this.Build();
     this.Collections.Accounts             = null;
     this.SimulationAssumptions.Simulation = null;
     return(this);
 }
Esempio n. 2
0
 /// <summary>
 /// Instantiates a Simulation object and saves it
 /// </summary>
 /// <param name="assumptions">The asumtpions object that underpins the Simulation</param>
 /// <param name="collectionsId">The collection that the simulation is being conducted under</param>
 public Simulation(SimulationAssumptions assumptions, string collectionsId)
 {
     assumptions.SimulationAssumptionsId = Guid.NewGuid().ToString();
     SimulationAssumptions = assumptions;
     SimulationName        = assumptions.SimualtionName;
     SimulationId          = "temp";
     CollectionsId         = collectionsId;
     SimulationId          = Save();
 }
 /// <summary>
 /// Return a specific instance of the object
 /// </summary>
 /// <param name="Id">Id of the instance</param>
 public SimulationAssumptions(string Id)
 {
     using (FinPlannerContext _context = new FinPlannerContext())
     {
         SimulationAssumptions a = _context.SimulationAssumptions.Find(Id);
         SimulationAssumptionsId = a.SimulationAssumptionsId;
         NumberOfMonths          = a.NumberOfMonths;
         Bonus              = a.Bonus;
         BonusMonth         = a.BonusMonth;
         BonusAmount        = a.BonusAmount;
         Increase           = a.Increase;
         IncreaseMonth      = a.IncreaseMonth;
         IncreasePercentage = a.IncreasePercentage;
         Recurring          = a.Recurring;
         ChangeDate         = a.ChangeDate;
         CFClassification   = new CFClassification(a.CFClassificationId);
         CFClassificationId = a.CFClassificationId;
         CFType             = new CFType(a.CFTypeId);
         CFTypeId           = a.CFTypeId;
         Type           = a.Type;
         SimualtionName = a.SimualtionName;
     }
 }