コード例 #1
0
        //Create-AuthorizationForm
        public JsonResult AuthorizationFormNew(int?GroupHealthInsurance_id, int Employee_id, string PersonOneReleaseInfoTo, string PersonOneRelationship,
                                               string PersonTwoReleaseInfoTo, string PersonTwoRelationship, string PolicyHolderSignature, DateTime?PolicyHolderSignatureDate,
                                               string PersonOneSignature, DateTime?PersonOneSignatureDate, string PersonTwoSignature, DateTime?PersonTwoSignatureDate)
        {
            Group_Health g = db.Group_Health
                             .Where(i => i.GroupHealthInsurance_id == GroupHealthInsurance_id)
                             .SingleOrDefault();

            g.Employee_id = Employee_id;
            g.NameOfPersonOneReleaseInfoTo               = PersonOneReleaseInfoTo;
            g.PersonOneRelationship                      = PersonOneRelationship;
            g.NameOfPersonTwoReleaseInfoTo               = PersonTwoReleaseInfoTo;
            g.PersonTwoRelationship                      = PersonTwoRelationship;
            g.AuthorizationFormPolicyHolderSignature     = PolicyHolderSignature;
            g.AuthorizationFormPolicyHolderSignatureDate = PolicyHolderSignatureDate;
            g.PersonOneSignature     = PersonOneSignature;
            g.PersonOneSignatureDate = PersonOneSignatureDate;
            g.PersonTwoSignature     = PersonTwoSignature;
            g.PersonTwoSignatureDate = PersonTwoSignatureDate;

            db.SaveChanges();

            int result = g.GroupHealthInsurance_id;

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        //====================================
        // Post: Create EmploymentInfoGrpH
        //====================================
        public JsonResult EmploymentInfoGrpHealthEnrollment(int?Employee_id, string GroupName, string IMSGroupNumber, string Department, string EnrollmentType,
                                                            string Payroll_id, string Class, string AnnualSalary, string JobTitle, DateTime HireDate, DateTime EffectiveDate, string HoursWorkedPerWeek)
        {
            //Employee emp = new Employee();
            Employee emp = db.Employees
                           .Where(i => i.Employee_id == Employee_id)
                           .Single();

            emp.Department         = Department;
            emp.EnrollmentType     = EnrollmentType;
            emp.Payroll_id         = Payroll_id;
            emp.Class              = Class;
            emp.AnnualSalary       = AnnualSalary;
            emp.JobTitle           = JobTitle;
            emp.HireDate           = HireDate;
            emp.EffectiveDate      = EffectiveDate;
            emp.HoursWorkedPerWeek = HoursWorkedPerWeek;

            Group_Health g = db.Group_Health
                             .Where(i => i.Employee_id == Employee_id)
                             .Single();

            g.GroupName      = GroupName;
            g.IMSGroupNumber = IMSGroupNumber;

            db.SaveChanges();

            int result = g.Employee_id;

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public JsonResult GrpHealthInsEditUpdate(int?Employee_id, int?InsurancePlan_id, /*DateTime? CafeteriaPlanYear,*/ string NoMedical, string MECPlan,
                                                 string StandardPlan, string BuyUpPlan, string GrpHEnrollmentEmpSignature, DateTime?GrpHEnrollmentEmpSignatureDate, string Myself, string Spouse,
                                                 string Dependent, string OtherCoverageSelection, string OtherReasonSelection, string ReasonForGrpCoverageRefusal, string GrpHRefusalEmpSignature,
                                                 DateTime?GrpHRefusalEmpSignatureDate, FormCollection collection)
        {
            Group_Health g = db.Group_Health
                             .Where(i => i.Employee_id == Employee_id)
                             .Single();

            //g.CafeteriaPlanYear = CafeteriaPlanYear;
            g.NoMedicalPlan = NoMedical;
            g.MECPlan       = MECPlan;
            g.StandardPlan  = StandardPlan;
            g.BuyUpPlan     = BuyUpPlan;

            g.GrpHEnrollmentEmpSignature     = GrpHEnrollmentEmpSignature;
            g.GrpHEnrollmentEmpSignatureDate = GrpHEnrollmentEmpSignatureDate;
            g.Myself        = Myself;
            g.Spouse        = Spouse;
            g.Dependent     = Dependent;
            g.OtherCoverage = OtherCoverageSelection;
            g.OtherReason   = OtherReasonSelection;
            g.ReasonForGrpCoverageRefusal = ReasonForGrpCoverageRefusal;
            g.GrpHRefusalEmpSignature     = GrpHRefusalEmpSignature;
            g.GrpHRefusalEmpSignatureDate = GrpHRefusalEmpSignatureDate;

            //InsurancePlan insPlan = db.InsurancePlans
            //  .Where(i => i.InsurancePlan_id == InsurancePlan_id)
            //  .Single();

            //insPlan.MECPlan = InsMECPlan;
            //insPlan.StandardPlan = InsStndPlan;
            //insPlan.BuyUpPlan = InsBuyUpPlan;

            //ViewBag.insPlan = insPlan;

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

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

            int result = g.Employee_id;

            CreateGrpHealthPDF(g.Employee_id);

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public ActionResult DeleteGroupHealth(int id)
        {
            Group_Health groupHealth = db.Group_Health.Find(id);

            db.Group_Health.Remove(groupHealth);
            db.SaveChanges();

            db.DeleteEmployeeAndDependents(id);

            return(RedirectToAction("GrpHealthEnrollment"));
        }
コード例 #5
0
        //====================================
        //Post-GrpHealthEnrollment
        //====================================

        //DEMO LICENSE KEY for Selectpdf Html to PDF API:
        //"7df5f5a6-4672-4cd7-9277-3de3615ffdfc";

        public JsonResult GrpHealthEnrollmentNew(int Employee_id, /*DateTime? CafeteriaPlanYear,*/ string empCoveredByOtherIns,
                                                 string empInsCarrier, string empInsPolicyNumber, string empInsPhoneNumber, string NoMedical, string MECPlan,
                                                 string StandardPlan, string BuyUpPlan, string GrpHEnrollmentEmpSignature, DateTime?GrpHEnrollmentEmpSignatureDate, string Myself, string Spouse,
                                                 string Dependent, string OtherCoverageSelection, string OtherReasonSelection, string ReasonForGrpCoverageRefusal, string GrpHRefusalEmpSignature,
                                                 DateTime?GrpHRefusalEmpSignatureDate, FormCollection collection)
        {
            string response = "";

            int record = (from grpH in db.Group_Health
                          where grpH.Employee_id == Employee_id
                          select grpH).Count();

            if (record > 0)
            {
                response = "Record already exists.";
            }
            else
            {
                Group_Health g = db.Group_Health
                                 .Where(i => i.Employee_id == Employee_id)
                                 .Single();

                //Group_Health g = new Group_Health();

                g.Employee_id = Employee_id;
                //g.OtherInsuranceCoverage = empCoveredByOtherIns;
                //g.InsuranceCarrier = empInsCarrier;
                //g.PolicyNumber = empInsPolicyNumber;
                //g.PhoneNumber = empInsPhoneNumber;

                //g.CafeteriaPlanYear = CafeteriaPlanYear;
                g.NoMedicalPlan = NoMedical;
                g.MECPlan       = MECPlan;
                g.StandardPlan  = StandardPlan;
                g.BuyUpPlan     = BuyUpPlan;

                g.GrpHEnrollmentEmpSignature     = GrpHEnrollmentEmpSignature;
                g.GrpHEnrollmentEmpSignatureDate = GrpHEnrollmentEmpSignatureDate;
                g.Myself        = Myself;
                g.Spouse        = Spouse;
                g.Dependent     = Dependent;
                g.OtherCoverage = OtherCoverageSelection;
                g.OtherReason   = OtherReasonSelection;
                g.ReasonForGrpCoverageRefusal = ReasonForGrpCoverageRefusal;
                g.GrpHRefusalEmpSignature     = GrpHRefusalEmpSignature;
                g.GrpHRefusalEmpSignatureDate = GrpHRefusalEmpSignatureDate;

                db.SaveChanges();
            }

            int result = Employee_id;

            return(Json(new { data = result, error = response }, JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
        public ActionResult DeleteGrpHealthIns(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Group_Health groupHealth = db.Group_Health.Find(id);

            if (groupHealth == null)
            {
                return(HttpNotFound());
            }

            return(View(groupHealth));
        }
コード例 #7
0
        public JsonResult OtherInsuranceNew(int Employee_id, int?GroupHealthInsurance_id, string empOtherGrpHinsCoverage, string empInsCarrier,
                                            string empInsPolicyNumber, string empInsPhoneNumber)
        {
            Group_Health grp = new Group_Health();

            grp.Employee_id            = Employee_id;
            grp.OtherInsuranceCoverage = empOtherGrpHinsCoverage;
            grp.InsuranceCarrier       = empInsCarrier;
            grp.PolicyNumber           = empInsPolicyNumber;
            grp.PhoneNumber            = empInsPhoneNumber;

            ViewBag.GroupHealthInsurance_id = grp.GroupHealthInsurance_id;

            int result = grp.GroupHealthInsurance_id;

            db.Group_Health.Add(grp);
            db.SaveChanges();

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }
コード例 #8
0
        //EditUpdate-AuthorizationForm
        public JsonResult AuthorizationFormEditUpdate(int?Employee_id, int?GroupHealthInsurance_id, string PersonOneReleaseInfoTo, string PersonOneRelationship,
                                                      string PersonTwoReleaseInfoTo, string PersonTwoRelationship, string PolicyHolderSignature, DateTime PolicyHolderSignatureDate,
                                                      string PersonOneSignature, DateTime PersonOneSignatureDate, string PersonTwoSignature, DateTime PersonTwoSignatureDate)
        {
            Group_Health g = db.Group_Health
                             .Where(i => i.GroupHealthInsurance_id == GroupHealthInsurance_id)
                             .Single();

            g.NameOfPersonOneReleaseInfoTo               = PersonOneReleaseInfoTo;
            g.PersonOneRelationship                      = PersonOneRelationship;
            g.NameOfPersonTwoReleaseInfoTo               = PersonTwoReleaseInfoTo;
            g.PersonTwoRelationship                      = PersonTwoRelationship;
            g.AuthorizationFormPolicyHolderSignature     = PolicyHolderSignature;
            g.AuthorizationFormPolicyHolderSignatureDate = PolicyHolderSignatureDate;
            g.PersonOneSignature     = PersonOneSignature;
            g.PersonOneSignatureDate = PersonOneSignatureDate;
            g.PersonTwoSignature     = PersonTwoSignature;
            g.PersonTwoSignatureDate = PersonTwoSignatureDate;

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

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

                RedirectToAction("EmpOverview", new { g.Employee_id });
            }

            int result = g.Employee_id;

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