Example #1
0
        public JsonResult DepOtherInsuranceNew(int Employee_id, int FamilyMember_id, string depInsuranceCoverage, string depInsCarrier, string depInsPolicyNumber,
                                               string depInsPhoneNumber)
        {
            Other_Insurance other = new Other_Insurance();

            other.Employee_id             = Employee_id;
            other.FamilyMember_id         = FamilyMember_id;
            other.CoveredByOtherInsurance = depInsuranceCoverage;
            other.InsuranceCarrier        = depInsCarrier;
            other.PolicyNumber            = depInsPolicyNumber;
            other.PhoneNumber             = depInsPhoneNumber;

            db.Other_Insurance.Add(other);
            db.SaveChanges();

            int result = other.OtherInsurance_id;

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public JsonResult SpOtherInsuranceNew(int Employee_id, int FamilyMember_id, string spInsuranceCoverage, string spInsCarrier, string spInsMailingAddress,
                                              string spInsCity, string spInsState, string spInsZipCode, string spInsPhoneNumber, string spInsPolicyNumber)
        {
            Other_Insurance other = new Other_Insurance();

            other.Employee_id             = Employee_id;
            other.FamilyMember_id         = FamilyMember_id;
            other.CoveredByOtherInsurance = spInsuranceCoverage;
            other.InsuranceCarrier        = spInsCarrier;
            other.MailingAddress          = spInsMailingAddress;
            other.City         = spInsCity;
            other.State        = spInsState;
            other.ZipCode      = spInsZipCode;
            other.PhoneNumber  = spInsPhoneNumber;
            other.PolicyNumber = spInsPolicyNumber;

            db.Other_Insurance.Add(other);
            db.SaveChanges();

            int result = other.OtherInsurance_id;

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        //EditUpdate-DepEdit
        public JsonResult DepEditUpdate(int?Employee_id, int?FamilyMember_id, string RelationshipToInsured, string SSN, string DepFirstName, string DepLastName,
                                        DateTime DateOfBirth, string Gender, string EmpNumber, string MailingAddress, string City, string State, string ZipCode, string County, string Student,
                                        string Disabled, string NonStandardDependent, string AddDropDepLifeIns, string depInsuranceCoverage, string depInsCarrier, string depInsPolicyNumber,
                                        string depInsPhoneNumber)
        {
            Family_Info dep = db.Family_Info
                              .Where(i => i.FamilyMember_id == FamilyMember_id)
                              .Where(i => i.RelationshipToInsured == "Dependent")
                              .Single();

            dep.RelationshipToInsured = RelationshipToInsured;
            dep.SSN                  = SSN;
            dep.FirstName            = DepFirstName;
            dep.LastName             = DepLastName;
            dep.DateOfBirth          = DateOfBirth;
            dep.Gender               = Gender;
            dep.MailingAddress       = MailingAddress;
            dep.City                 = City;
            dep.State                = State;
            dep.ZipCode              = ZipCode;
            dep.County               = County;
            dep.Student              = Student;
            dep.Disabled             = Disabled;
            dep.NonStandardDependent = NonStandardDependent;
            dep.AddDropDepLifeIns    = AddDropDepLifeIns;

            var emp = new Employee()
            {
                SSN = EmpNumber
            };

            ViewBag.EmpNumber = emp;

            Other_Insurance depOtherIns = db.Other_Insurance
                                          .Where(i => i.FamilyMember_id == FamilyMember_id)
                                          .Single();

            depOtherIns.CoveredByOtherInsurance = depInsuranceCoverage;
            depOtherIns.InsuranceCarrier        = depInsCarrier;
            depOtherIns.PolicyNumber            = depInsPolicyNumber;
            depOtherIns.PhoneNumber             = depInsPhoneNumber;


            int result = dep.Employee_id;

            if (ModelState.IsValid)
            {
                db.Entry(dep).State         = System.Data.Entity.EntityState.Modified;
                db.Entry(depOtherIns).State = System.Data.Entity.EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (Exception error)
                {
                    Console.WriteLine(error);
                }

                RedirectToAction("FamilyOverview", new { dep.Employee_id });
            }

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        //EditUpdate-Spouse
        public JsonResult SpEditUpdate(int?Employee_id, int?FamilyMember_id, string RelationshipToInsured, string MaritalStatus, string SSN,
                                       string FirstName, string LastName, DateTime DateOfBirth, string Gender, string MailingAddress, string PObox, string City, string State,
                                       string ZipCode, string County, string PhysicalAddress, string City2, string State2, string ZipCode2, string EmailAddress, string PhoneNumber,
                                       string CellPhone, string Employer, string EmployerAddress, string EmployerPObox, string EmployerCity, string EmployerState, string EmployerZipCode,
                                       string EmployerPhoneNumber, string spOtherInsurance, string spOtherMedicalCoverage, string spOtherDentalCoverage, string spOtherVisionCoverage,
                                       string spIndemnityCoverage, string spInsuranceCoverage, string spInsCarrier, string spInsMailingAddress, string spInsCity, string spInsState,
                                       string spInsZipCode, string spInsPhoneNumber, string spInsPolicyNumber)
        {
            var sp = db.Family_Info
                     .Where(i => i.FamilyMember_id == FamilyMember_id)
                     .Where(i => i.RelationshipToInsured == "Spouse")
                     .Single();

            ViewBag.FamilyMember_id       = sp.FamilyMember_id;
            ViewBag.RelationshipToInsured = "Spouse";
            ViewBag.MaritalStatus         = sp.MaritalStatus;

            sp.RelationshipToInsured = RelationshipToInsured;
            sp.MaritalStatus         = MaritalStatus;
            sp.SSN                    = SSN;
            sp.FirstName              = FirstName;
            sp.LastName               = LastName;
            sp.DateOfBirth            = DateOfBirth;
            sp.Gender                 = Gender;
            sp.MailingAddress         = MailingAddress;
            sp.PObox                  = PObox;
            sp.City                   = City;
            sp.State                  = State;
            sp.ZipCode                = ZipCode;
            sp.County                 = County;
            sp.PhysicalAddress        = PhysicalAddress;
            sp.CityTwo                = City2;
            sp.StateTwo               = State2;
            sp.ZipCodeTwo             = ZipCode2;
            sp.EmailAddress           = EmailAddress;
            sp.PhoneNumber            = PhoneNumber;
            sp.CellPhone              = CellPhone;
            sp.Employer               = Employer;
            sp.EmployerMailingAddress = EmployerAddress;
            sp.EmployerPObox          = EmployerPObox;
            sp.EmployerCity           = EmployerCity;
            sp.EmployerState          = EmployerState;
            sp.EmployerZipCode        = EmployerZipCode;
            sp.EmployerPhoneNumber    = EmployerPhoneNumber;

            sp.OtherInsuranceCoverage = spOtherInsurance;
            sp.Medical   = spOtherMedicalCoverage;
            sp.Dental    = spOtherDentalCoverage;
            sp.Vision    = spOtherVisionCoverage;
            sp.Indemnity = spIndemnityCoverage;

            Other_Insurance spOtherIns = db.Other_Insurance
                                         .Where(i => i.FamilyMember_id == FamilyMember_id)
                                         .Single();

            spOtherIns.CoveredByOtherInsurance = spInsuranceCoverage;
            spOtherIns.InsuranceCarrier        = spInsCarrier;
            spOtherIns.MailingAddress          = spInsMailingAddress;
            spOtherIns.City         = spInsCity;
            spOtherIns.State        = spInsState;
            spOtherIns.ZipCode      = spInsZipCode;
            spOtherIns.PhoneNumber  = spInsPhoneNumber;
            spOtherIns.PolicyNumber = spInsPolicyNumber;


            if (ModelState.IsValid)
            {
                db.Entry(sp).State         = System.Data.Entity.EntityState.Modified;
                db.Entry(spOtherIns).State = System.Data.Entity.EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (Exception err)
                {
                    Console.WriteLine(err);
                }
            }

            int result = sp.Employee_id;

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }