public Policy Delete(int Id) { Policy employee = _context.Policies.Find(Id); if (employee != null) { _context.Policies.Remove(employee); _context.SaveChanges(); } return(employee); }
public T Create(T entity) { try { _insuranceDBContext.Set <T>().Add(entity); _insuranceDBContext.SaveChanges(); return(entity); } catch (Exception) { throw; } }
public ActionResult DeleteParticipants(int participantno) { InsuranceDBContext db = new InsuranceDBContext(); db.USP_DeleteParticipants(participantno); db.SaveChanges(); return(View()); }
public ActionResult UpdateParticipants(Participant participant) { InsuranceDBContext db = new InsuranceDBContext(); db.USP_UpdateParticipants(participant.ParticipantNo, participant.FirtsName, participant.LastName, participant.MiddleName, participant.DOB, participant.ParticipantTypeNo); db.SaveChanges(); return(View()); }
public ActionResult DeletePolicy(int policyno) { InsuranceDBContext db = new InsuranceDBContext(); db.USP_DeletePolicies(policyno); db.SaveChanges(); return(View()); }
public ActionResult UpdatePolicy(Policy policy) { InsuranceDBContext db = new InsuranceDBContext(); db.USP_UpdatePolicies(policy.PlanNumber, policy.InstallmentPremium, policy.Insured, policy.SumAssured, policy.PolicyStatus, policy.PremiumMode, policy.PremiumDueDate, policy.Beneficiary, policy.Owner, policy.PolicyTerm); db.SaveChanges(); return(View()); }