public static PayCycle CreatePayCycle(string payCycleId) { PayCycle payCycle = new PayCycle(); payCycle.PayCycleId = payCycleId; return(payCycle); }
public ActionResult DeleteConfirmed(int id) { PayCycle payCycle = db.PayCycles.Find(id); db.PayCycles.Remove(payCycle); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] PayCycle payCycle) { if (ModelState.IsValid) { db.Entry(payCycle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payCycle)); }
public ActionResult Create([Bind(Include = "Id,Name,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] PayCycle payCycle) { if (ModelState.IsValid) { db.PayCycles.Add(payCycle); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payCycle)); }
// GET: PayCycles/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PayCycle payCycle = db.PayCycles.Find(id); if (payCycle == null) { return(HttpNotFound()); } return(View(payCycle)); }
private void SeedEmployees() { BenefitPlan plan = _context.BenefitPlans.First(); PayCycle cycle = _context.PayCycles.First(); _context.Employees.Add( new Employee { FirstName = "John", LastName = "Smith", BenefitPlan = plan, PayCycle = cycle, MonthlyGross = 2000 }); _context.Employees.Add( new Employee { FirstName = "Jill", LastName = "Werner", BenefitPlan = plan, PayCycle = cycle, MonthlyGross = 2000 }); _context.Employees.Add( new Employee { FirstName = "Derek", LastName = "Jeter", BenefitPlan = plan, PayCycle = cycle, MonthlyGross = 2000 }); _context.Employees.Add( new Employee { FirstName = "Robert", LastName = "Barone", BenefitPlan = plan, PayCycle = cycle, MonthlyGross = 2000 }); _context.SaveChanges(); }
public BenefitCalculator(BenefitPlan plan, PayCycle cycle, IDiscount discount) { _plan = plan; _cycle = cycle; _discount = discount; }