示例#1
0
        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;
     }
 }
示例#3
0
        public ActionResult DeleteParticipants(int participantno)
        {
            InsuranceDBContext db = new InsuranceDBContext();

            db.USP_DeleteParticipants(participantno);
            db.SaveChanges();

            return(View());
        }
示例#4
0
        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());
        }
示例#5
0
        public ActionResult DeletePolicy(int policyno)
        {
            InsuranceDBContext db = new InsuranceDBContext();

            db.USP_DeletePolicies(policyno);
            db.SaveChanges();

            return(View());
        }
示例#6
0
        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());
        }