コード例 #1
0
 public RuleDependencyAttribute(Type recognizer, int rule, int version, Dependents dependents)
 {
     this._recognizer = recognizer;
     this._rule = rule;
     this._version = version;
     this._dependents = dependents | Dependents.Self;
 }
コード例 #2
0
ファイル: MarkdownPage.cs プロジェクト: KennyBu/ServiceStack
        private void AddDependentPages(IEnumerable <TemplateBlock> blocks)
        {
            foreach (var block in blocks)
            {
                var exprBlock = block as MethodStatementExprBlock;
                if (exprBlock == null || exprBlock.DependentPageName == null)
                {
                    continue;
                }
                var page = Markdown.GetViewPage(exprBlock.DependentPageName);
                if (page != null)
                {
                    Dependents.Add(page);
                }
            }

            MarkdownTemplate template;

            if (this.DirectiveTemplate != null &&
                Markdown.MasterPageTemplates.TryGetValue(this.DirectiveTemplate, out template))
            {
                this.Dependents.Add(template);
            }
            if (this.Template != null &&
                Markdown.MasterPageTemplates.TryGetValue(this.Template, out template))
            {
                this.Dependents.Add(template);
            }
        }
コード例 #3
0
ファイル: DependentDto.cs プロジェクト: ricar-torres/cyp
 public DependentDto(Dependents dependent) : base()
 {
     this.Id             = dependent.Id;
     this.Name           = dependent.Name;
     this.Initial        = dependent.Initial;
     this.LastName1      = dependent.LastName1;
     this.LastName2      = dependent.LastName2;
     this.Phone1         = dependent.Phone1;
     this.Phone2         = dependent.Phone2;
     this.Ssn            = dependent.Ssn;
     this.UpdatedAt      = dependent.UpdatedAt;
     this.Agency         = dependent.Agency;
     this.AgencyId       = dependent.AgencyId;
     this.BirthDate      = dependent.BirthDate;
     this.City           = dependent.City;
     this.CityId         = dependent.CityId;
     this.Client         = dependent.Client;
     this.ClientId       = dependent.ClientId;
     this.ContractNumber = dependent.ContractNumber;
     this.Cover          = dependent.Cover;
     this.CoverId        = dependent.CoverId;
     this.CreatedAt      = dependent.CreatedAt;
     this.DeletedAt      = dependent.DeletedAt;
     this.EffectiveDate  = dependent.EffectiveDate;
     this.Email          = dependent.Email;
     this.Gender         = dependent.Gender;
 }
コード例 #4
0
 public RuleDependencyAttribute(Type recognizer, int rule, int version, Dependents dependents)
 {
     this._recognizer = recognizer;
     this._rule       = rule;
     this._version    = version;
     this._dependents = dependents | Dependents.Self;
 }
コード例 #5
0
        public async Task <ActionResult <Dependents> > PostDependents(Dependents dependents)
        {
            _context.Dependents.Add(dependents);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDependents", new { id = dependents.dependent_id }, dependents));
        }
コード例 #6
0
        public async Task <IActionResult> PutDependents(int id, Dependents dependents)
        {
            if (id != dependents.dependent_id)
            {
                return(BadRequest());
            }

            _context.Entry(dependents).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DependentsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #7
0
        /// <summary>
        /// The object factory for a particular data collection instance.
        /// </summary>
        public virtual void CreateObjectsFromData(Dependents dependents, System.Data.DataSet data)
        {
            // Do nothing if we have nothing
            if (data == null || data.Tables.Count == 0 || data.Tables[0].Rows.Count == 0)
            {
                return;
            }


            // Create a local variable for the new instance.
            Dependent newobj = null;

            // Create a local variable for the data row instance.
            System.Data.DataRow dr = null;


            // Iterate through the table rows
            for (int i = 0; i < data.Tables[0].Rows.Count; i++)
            {
                // Get a reference to the data row
                dr = data.Tables[0].Rows[i];
                // Create a new object instance
                newobj = System.Activator.CreateInstance(dependents.ContainsType[0]) as Dependent;
                // Let the instance set its own members
                newobj.SetMembers(ref dr);
                // Add the new object to the collection instance
                dependents.Add(newobj);
            }
        }
コード例 #8
0
            private void PopulateDependencies(IEnumerable <PropertyInfo> properties)
            {
                foreach (var property in properties.Where(p => !PropertiesToIgnore.Contains(p.Name.ToLower())))
                {
                    if (property.PropertyType == typeof(EntityReference))
                    {
                        var attribute = property.GetCustomAttribute(typeof(AttributeLogicalNameAttribute)) as AttributeLogicalNameAttribute;
                        if (attribute == null)
                        {
                            continue;
                        }
                        Dependencies.Add(attribute.LogicalName);
                        continue;
                    }

                    if (!property.PropertyType.IsGenericType || property.PropertyType.GetGenericTypeDefinition() != typeof(IEnumerable <>))
                    {
                        continue;
                    }

                    var genericTypes = property.PropertyType.GetGenericArguments();
                    if (genericTypes.Length != 1)
                    {
                        continue;
                    }
                    var genericType = genericTypes[0];
                    if (!typeof(Entity).IsAssignableFrom(genericType))
                    {
                        continue;
                    }

                    Dependents.Add(EntityHelper.GetEntityLogicalName(genericType));
                }
            }
コード例 #9
0
        /// <summary>
        /// Fill method for populating an entire collection of Dependents
        /// </summary>
        public virtual void Fill(Dependents dependents)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Dependent.GetConnectionString());


            try
            {
                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectDependents");


                    // Send the collection and data to the object factory
                    CreateObjectsFromData(dependents, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
コード例 #10
0
        public IActionResult Upsert(Dependents dependents)
        {
            var parameter = new DynamicParameters();

            parameter.Add("@Name", dependents.Name);
            parameter.Add("@Birth", dependents.Birth);
            parameter.Add("@Gender", dependents.Gender);
            parameter.Add("@Phone", dependents.Phone);
            parameter.Add("@Relationship", dependents.Relationship);
            parameter.Add("@EmployeeId", dependents.EmployeeId);
            try
            {
                if (dependents.Id.ToString() == "00000000-0000-0000-0000-000000000000") // Do là dạng Guid nên nó sẽ như vậy
                {
                    _unitOfWork.SP_Call.Excute("SP_Create_Dependents", parameter);
                    return(RedirectToAction("Upsert", "Employee", new { id = dependents.EmployeeId.ToString() }));
                }
                else
                {
                    parameter.Add("@Id", dependents.Id);
                    _unitOfWork.SP_Call.Excute("SP_Update_Dependents", parameter);
                    return(View(dependents));
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);
                return(View(dependents));
            }
        }
コード例 #11
0
        public JsonResult Edit(Dependents dependents)
        {
            MTSHRDataLayer.EmployeeDependents data_relationship = new MTSHRDataLayer.EmployeeDependents();
            var result = data_relationship.UpdateDependents(dependents.Employee_Id, dependents.DependentName, dependents.Relation, dependents.DateofBirth);

            return(Json(new { success = result }, JsonRequestBehavior.AllowGet));
        }
コード例 #12
0
ファイル: PipDetails.cs プロジェクト: kittinap/kunnjae
 public PipDetails(CachedGraph graph, Pip pip)
     : base(graph.Context, pip)
 {
     LongDescription = pip.GetDescription(graph.Context);
     Tags.AddRange(pip.Tags.Select(tag => new TagRef(graph.Context, tag)));
     Dependencies.AddRange(GetPipRefs(graph.Context, graph.PipGraph.RetrievePipImmediateDependencies(pip)));
     Dependents.AddRange(GetPipRefs(graph.Context, graph.PipGraph.RetrievePipImmediateDependents(pip)));
 }
コード例 #13
0
 public void AddDependent(Dependent dependent)
 {
     if (Dependents == null)
     {
         Dependents = new List <Dependent>();
     }
     Dependents.Add(dependent);
 }
コード例 #14
0
        public IActionResult Insert(string?id)
        {
            Dependents dependents = new Dependents()
            {
                EmployeeId = Guid.Parse(id)
            };

            return(View("Upsert", dependents));
        }
コード例 #15
0
 public void RemoveDependent(Dependent dependent)
 {
     try {
         Dependents.Remove(dependent);
     }
     catch
     {
     }
 }
コード例 #16
0
        public IActionResult Update(string?id)
        {
            Dependents dependents = new Dependents();
            var        parameters = new DynamicParameters();

            parameters.Add("@Id", id);
            dependents = _unitOfWork.SP_Call.OneRecord <Dependents>("SP_Get_Dependents", parameters);
            return(View("Upsert", dependents));
        }
コード例 #17
0
        private static void ReportUnimplementedDependents(StringBuilder errors, Tuple <RuleDependencyAttribute, ICustomAttributeProvider> dependency, Dependents dependents)
        {
            Dependents unimplemented = dependents;

            unimplemented &= ~ImplementedDependents;
            if (unimplemented != Dependents.None)
            {
                string message = string.Format("Cannot validate the following dependents of rule {0}: {1}", dependency.Item1.Rule, unimplemented);
                errors.AppendLine(message);
            }
        }
コード例 #18
0
        async void setData()
        {
            dependentsList.Clear();
            for (int i = 0; i < groupNum; i++)
            {
                dependents = new Dependents();
                if (plans.type == "Familia")
                {
                    if (i > 5)
                    {
                        dependents.aditional = true;
                    }
                    else
                    {
                        dependents.aditional = false;
                    }
                }
                else
                {
                    dependents.aditional = true;
                }

                dependents.name     = textBoxes[i].Text;
                dependents.dtn      = maskedTextBoxes[i].Text;
                dependents.relation = comboBoxes[i].Text;
                dependentsList.Add(dependents);
            }


            Dictionary <string, object> data = new Dictionary <string, object>()
            {
                { "dependents", dependentsList },
                { "dueDate", int.Parse(txtDueDate.Text) },
                { "paymentMethod", cboPaymentMethod.Text }
            };


            Dictionary <string, object> invoiceData = new Dictionary <string, object>()
            {
                { "aditional", double.Parse(txtAditional.Text.Replace("R$ ", "")) },
                { "dueDate", int.Parse(txtDueDate.Text) },
                { "holder", txtHolder.Text },
                { "month", DateTime.Now.Month.ToString() },
                { "paymentMethod", cboPaymentMethod.Text },
                { "planName", txtPlanName.Text },
                { "status", "Pendente" },
                { "totalValue", double.Parse(txtTotalValue.Text.Replace("R$ ", "")) },
                { "value", txtPlanValue.Text },
            };

            await userReference.UpdateAsync(data);

            await invoiceReference.SetAsync(invoiceData);
        }
コード例 #19
0
ファイル: DependantService.cs プロジェクト: ricar-torres/cyp
        public Dependents Create(Dependents payload)
        {
            try {
                payload.CreatedAt = DateTime.Now;
                this._context.Dependents.Add(payload);
                this._context.SaveChanges();
            } catch (System.Exception ex) {
                throw ex;
            }

            return(payload);
        }
コード例 #20
0
        /// <summary>
        /// 不包含parse field
        /// </summary>
        internal void Parse()
        {
            Dependents.Clear();
            Summarys.Clear();
            Fields.Clear();
            List <List <Line> > fields = ParseFieldLine(ParseMsgElement());

            foreach (List <Line> list in fields)
            {
                ProtoBufferField field = new ProtoBufferField(this, list);
                Fields.Add(field);
            }
        }
コード例 #21
0
        /// <summary>
        /// Gets all the available objects.
        /// </summary>
        public virtual Dependents GetAll()
        {
            // create a new instance of the return object
            Dependents objects = new Dependents();


            // fill the objects
            this.Fill(objects);


            // return the filled object from the service
            return(objects);
        }
コード例 #22
0
        public IActionResult Put(Dependents dependent)
        {
            Dependents updatedDependent;

            try {
                updatedDependent = _service.Update(dependent);

                return(Ok(updatedDependent));
            } catch (AppException ex) {
                // return error message if there was an exception
                return(DefaultError(ex));
            }
        }
コード例 #23
0
        public void RemoveDependent(Guid id)
        {
            if (Dependents.Any(preexistingDependent => preexistingDependent.Id == id))
            {
                Dependents = Dependents.Where(d => d.Id != id);

                PublishDomainEvent(new RemoveEmployeeDependent
                {
                    Employee  = Id,
                    Dependent = id
                });
            }
        }
コード例 #24
0
 public IActionResult Create([FromBody] Dependents payload)
 {
     try {
         //payload.Cover = null;
         // (payload as Dependents).Relationship = payload.Relationship.Id;
         //payload.Relationship = null;
         var res = _service.Create(payload);
         return(Ok(res));
     } catch (AppException ex) {
         // return error message if there was an exception
         return(DefaultError(ex));
     }
 }
コード例 #25
0
        public void AddDependent(Person person)
        {
            if (Dependents.All(preexistingDependent => preexistingDependent.Person.Id != person.Id))
            {
                var dependent = new Dependent(Guid.NewGuid(), person);
                Dependents.Append(dependent);

                PublishDomainEvent(new AddEmployeeDependent
                {
                    Employee  = Id,
                    Dependent = dependent
                });
            }
        }
コード例 #26
0
ファイル: DependantService.cs プロジェクト: ricar-torres/cyp
 public Dependents Update(Dependents dependents)
 {
     try {
         dependents.UpdatedAt = DateTime.Now;
         if (_context.Dependents.FirstOrDefault(x => x.Id == dependents.Id) is Dependents d)
         {
             _context.Entry(d).CurrentValues.SetValues(dependents);
             _context.SaveChanges();
             return(d);
         }
         else
         {
             throw new AppException("Dependant not found");
         }
     } catch (Exception ex) {
         throw ex;
     }
 }
コード例 #27
0
        /// <summary>
        /// Fill method for populating a collection by BORROWER
        /// </summary>
        public void FillByBorrower(Dependents dependents, System.Int64 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Dependent.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(Dependent.GetConnectionString(), "gsp_SelectDependentsByBorrower");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@borrowerId"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectDependentsByBorrower", sqlparams);


                    // Send the collection and data to the object factory.
                    CreateObjectsFromData(dependents, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
コード例 #28
0
ファイル: EmployeeController.cs プロジェクト: jhone18/Payroll
        public JsonResult CreateDependents(string dependents)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Dependents dependentsObj = JsonConvert.DeserializeObject <Dependents>(dependents);
                    dependentsObj.CompanyId = HttpContext.Session.GetString("CompanyId");
                    _context.Add(dependentsObj);
                    _context.SaveChanges();
                }

                return(Json(new { Success = true }));
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #29
0
        public async Task <ActionResult <IEnumerable <Dependents> > > GetDependents([FromQuery] Dependents depend)
        {
            IQueryable <Dependents> dependents = _context.Dependents;

            //if (!string.IsNullOrEmpty(depend.DependentsNum))

            if (depend.DependentsNum > 0 && depend.DependentsNum <= 6)


            {
                dependents = dependents.Where(
                    d => d.DependentsNum.Equals(depend.DependentsNum));
            }



            return(await dependents.ToListAsync());

            // return await _context.Dependents.ToListAsync();
        }
コード例 #30
0
        public async Task <ActionResult <Dependents> > PostDependents(Dependents dependents)
        {
            _context.Dependents.Add(dependents);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (DependentsExists(dependents.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetDependents", new { id = dependents.Id }, dependents));
        }
コード例 #31
0
        internal string ReportMissingDependencies(ICollection <string> existing)
        {
            var builder = new StringBuilder();

            if (String.IsNullOrEmpty(FileName))
            {
                builder.Append("warning N0001 : ");
            }
            else
            {
                builder.AppendFormat("{0} : warning N0001 : ", FileName);
            }

            builder.AppendFormat("{0} is pending. Missing dependencies: ", Name);
            foreach (string depend in Dependents.Where(depend => !existing.Contains(depend)))
            {
                builder.Append(depend).Append(", ");
            }

            return(builder.ToString());
        }
コード例 #32
0
 private static void ReportUnimplementedDependents(StringBuilder errors, Tuple<RuleDependencyAttribute, ICustomAttributeProvider> dependency, Dependents dependents)
 {
     Dependents unimplemented = dependents;
     unimplemented &= ~ImplementedDependents;
     if (unimplemented != Dependents.None)
     {
         string message = string.Format("Cannot validate the following dependents of rule {0}: {1}", dependency.Item1.Rule, unimplemented);
         errors.AppendLine(message);
     }
 }
コード例 #33
0
        protected void getChildren(Dependents d)
        {
            int numberOfChildren = int.Parse(numChildren.Value);
            if (numberOfChildren >= 1)
            {
                Dependent myDependent = new Dependent();
                myDependent.IsSpouse = false;
                myDependent.Name = ch1Name.Text;
                if (ch1Gender.Text.ToLower().Equals("male"))
                {
                    myDependent.Gender = 'M';
                }
                else if (ch1Gender.Text.ToLower().Equals("female"))
                {
                    myDependent.Gender = 'F';
                }
                myDependent.Height = ch1Height.Text;
                myDependent.Weight = ch1Weight.Text;
                myDependent.DOB = ch1DOB.Text;
                myDependent.SSN = ch1SSN.Text;
                myDependent.PrimaryCarePhysician = ch1Physician.Text;
                if (ch1Student.Text.ToLower().Equals("yes"))
                {
                    myDependent.Student = true;
                }
                else
                {
                    myDependent.Student = false;
                }
                if (ch1Medicare.Text.ToLower().Equals("yes"))
                {
                    myDependent.Medicare = true;
                }
                else
                {
                    myDependent.Medicare = false;
                }
                if (ch1SS.Text.ToLower().Equals("yes"))
                {
                    myDependent.SSEnrolled = true;
                }
                else
                {
                    myDependent.SSEnrolled = false;
                }
                d.addDependent(myDependent);
            }

            if (numberOfChildren >= 2)
            {
                Dependent myDependent = new Dependent();
                myDependent.IsSpouse = false;
                myDependent.Name = ch2Name.Text;
                if (ch2Gender.Text.ToLower().Equals("male"))
                {
                    myDependent.Gender = 'M';
                }
                else if (ch2Gender.Text.ToLower().Equals("female"))
                {
                    myDependent.Gender = 'F';
                }
                myDependent.Height = ch2Height.Text;
                myDependent.Weight = ch2Weight.Text;
                myDependent.DOB = ch2DOB.Text;
                myDependent.SSN = ch2SSN.Text;
                myDependent.PrimaryCarePhysician = ch2Physician.Text;
                if (ch2Student.Text.ToLower().Equals("yes"))
                {
                    myDependent.Student = true;
                }
                else
                {
                    myDependent.Student = false;
                }
                if (ch2Medicare.Text.ToLower().Equals("yes"))
                {
                    myDependent.Medicare = true;
                }
                else
                {
                    myDependent.Medicare = false;
                }
                if (ch2SS.Text.ToLower().Equals("yes"))
                {
                    myDependent.SSEnrolled = true;
                }
                else
                {
                    myDependent.SSEnrolled = false;
                }
                d.addDependent(myDependent);
            }
            if (numberOfChildren >= 3)
            {
                Dependent myDependent = new Dependent();
                myDependent.IsSpouse = false;
                myDependent.Name = ch3Name.Text;
                if (ch3Gender.Text.ToLower().Equals("male"))
                {
                    myDependent.Gender = 'M';
                }
                else if (ch3Gender.Text.ToLower().Equals("female"))
                {
                    myDependent.Gender = 'F';
                }
                myDependent.Height = ch3Height.Text;
                myDependent.Weight = ch3Weight.Text;
                myDependent.DOB = ch3DOB.Text;
                myDependent.SSN = ch3SSN.Text;
                myDependent.PrimaryCarePhysician = ch3Physician.Text;
                if (ch3Student.Text.ToLower().Equals("yes"))
                {
                    myDependent.Student = true;
                }
                else
                {
                    myDependent.Student = false;
                }
                if (ch3Medicare.Text.ToLower().Equals("yes"))
                {
                    myDependent.Medicare = true;
                }
                else
                {
                    myDependent.Medicare = false;
                }
                if (ch3SS.Text.ToLower().Equals("yes"))
                {
                    myDependent.SSEnrolled = true;
                }
                else
                {
                    myDependent.SSEnrolled = false;
                }
                d.addDependent(myDependent);
            }
            if (numberOfChildren >= 4)
            {
                Dependent myDependent = new Dependent();
                myDependent.IsSpouse = false;
                myDependent.Name = ch4Name.Text;
                if (ch4Gender.Text.ToLower().Equals("male"))
                {
                    myDependent.Gender = 'M';
                }
                else if (ch4Gender.Text.ToLower().Equals("female"))
                {
                    myDependent.Gender = 'F';
                }
                myDependent.Height = ch4Height.Text;
                myDependent.Weight = ch4Weight.Text;
                myDependent.DOB = ch4DOB.Text;
                myDependent.SSN = ch4SSN.Text;
                myDependent.PrimaryCarePhysician = ch4Physician.Text;
                if (ch4Student.Text.ToLower().Equals("yes"))
                {
                    myDependent.Student = true;
                }
                else
                {
                    myDependent.Student = false;
                }
                if (ch4Medicare.Text.ToLower().Equals("yes"))
                {
                    myDependent.Medicare = true;
                }
                else
                {
                    myDependent.Medicare = false;
                }
                if (ch4SS.Text.ToLower().Equals("yes"))
                {
                    myDependent.SSEnrolled = true;
                }
                else
                {
                    myDependent.SSEnrolled = false;
                }
                d.addDependent(myDependent);
            }
            if (numberOfChildren == 5)
            {
                Dependent myDependent = new Dependent();
                myDependent.IsSpouse = false;
                myDependent.Name = ch5Name.Text;
                if (ch5Gender.Text.ToLower().Equals("male"))
                {
                    myDependent.Gender = 'M';
                }
                else if (ch5Gender.Text.ToLower().Equals("female"))
                {
                    myDependent.Gender = 'F';
                }
                myDependent.Height = ch5Height.Text;
                myDependent.Weight = ch5Weight.Text;
                myDependent.DOB = ch5DOB.Text;
                myDependent.SSN = ch5SSN.Text;
                myDependent.PrimaryCarePhysician = ch5Physician.Text;
                if (ch5Student.Text.ToLower().Equals("yes"))
                {
                    myDependent.Student = true;
                }
                else
                {
                    myDependent.Student = false;
                }
                if (ch5Medicare.Text.ToLower().Equals("yes"))
                {
                    myDependent.Medicare = true;
                }
                else
                {
                    myDependent.Medicare = false;
                }
                if (ch5SS.Text.ToLower().Equals("yes"))
                {
                    myDependent.SSEnrolled = true;
                }
                else
                {
                    myDependent.SSEnrolled = false;
                }
                d.addDependent(myDependent);
            }
        }
コード例 #34
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            if (Session["UserID"] != null)
            {
                Dependents myDependents = new Dependents();
                if (isSpouse.Value.Equals("1"))
                {
                    Dependent myDependent = new Dependent();
                    myDependent.IsSpouse = true;
                    myDependent.Name = spName.Text;
                    if(spGender.Text.ToLower().Equals("male"))
                    {
                        myDependent.Gender = 'M';
                    }
                    else if (spGender.Text.ToLower().Equals("female"))
                    {
                        myDependent.Gender = 'F';
                    }
                    myDependent.Height = spHeight.Text;
                    myDependent.Weight = spWeight.Text;
                    myDependent.DOB = spDOB.Text;
                    myDependent.SSN = spSSN.Text;
                    myDependent.PrimaryCarePhysician = spPhysician.Text;
                    if (spStudent.Text.ToLower().Equals("yes"))
                    {
                        myDependent.Student = true;
                    }
                    else
                    {
                        myDependent.Student = false;
                    }
                    if (spMedicare.Text.ToLower().Equals("yes"))
                    {
                        myDependent.Medicare = true;
                    }
                    else
                    {
                        myDependent.Medicare = false;
                    }
                    if (spSS.Text.ToLower().Equals("yes"))
                    {
                        myDependent.SSEnrolled = true;
                    }
                    else
                    {
                        myDependent.SSEnrolled = false;
                    }
                    myDependents.addDependent(myDependent);
                }
                if (!numChildren.Value.Equals("0"))
                {
                    getChildren( myDependents );
                }
                if (Session["Dependents"] != null)
                {
                    Session["Dependents"] = myDependents;
                }
                else
                {
                    Session.Add("Dependents", myDependents);
                }
                Response.Redirect("OtherCoverage.aspx");

            }
        }
コード例 #35
0
ファイル: Welcome.aspx.cs プロジェクト: reydavid47/GITHUB
        protected void Continue(object sender, EventArgs e)
        {
            if (!Page.IsValid) return;
            //Get the connection string for the specific database if it isn't already in the view state
            if (ConnString == String.Empty)
                using (GetEmployerConnString gecs = new GetEmployerConnString("Starbucks"))
                    if (!gecs.HasErrors)
                    {
                        ConnString = gecs.ConnectionString;
                        EmployerID = gecs.EmployerID.ToString();
                    }

            if (ConnString != String.Empty)
                ThisSession.CnxString = ConnString;
            if (EmployerID != String.Empty)
                ThisSession.EmployerID = EmployerID;

            //Check if the employee exists and if they do, store session info and move on
            using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment())
            {
                //gee.Firstname = txtFirstName.Text;
                gee.LastName = Encoder.HtmlEncode(txtLastName.Text);
                gee.SSN = "zzzz";
                if (txtPremera1.Text != "XXXXXXX" && txtPremera2.Text != "XX") //From this point validation has already passed so this indicates they are using the member id
                    gee.MemberID = Encoder.HtmlEncode(txtPremera1.Text) + Encoder.HtmlEncode(txtPremera2.Text);
                else
                    gee.SSN = Encoder.HtmlEncode(txtSSN.Text);
                gee.DOB = String.Format("{2}-{0}-{1}", txtMonth.Text, txtDay.Text, txtYear.Text);
                gee.GetData(ConnString);

                if (!gee.HasErrors)
                {
                    if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0)
                    {
                        lblNotFound.Visible = false;
                        lblError.Visible = false;

                        ThisSession.CCHID = gee.CCHID;
                        ThisSession.EmployeeID = gee.EmployeeID;
                        ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID;
                        ThisSession.SubscriberRXID = gee.SubscriberRXID;
                        ThisSession.LastName = gee.LastName;
                        ThisSession.FirstName = gee.FirstName;
                        ThisSession.PatientAddress1 = gee.Address1;
                        ThisSession.PatientAddress2 = gee.Address2;
                        ThisSession.PatientCity = gee.City;
                        ThisSession.PatientState = gee.State;
                        ThisSession.PatientZipCode = gee.ZipCode;
                        ThisSession.PatientLatitude = gee.Latitude;
                        ThisSession.PatientLongitude = gee.Longitude;
                        ThisSession.PatientDateOfBirth = gee.DOB;
                        ThisSession.PatientPhone = gee.Phone;
                        ThisSession.HealthPlanType = gee.HealthPlanType;
                        ThisSession.MedicalPlanType = gee.MedicalPlanType;
                        ThisSession.RxPlanType = gee.RxPlanType;
                        ThisSession.PatientGender = gee.Gender;
                        ThisSession.Parent = gee.Parent;
                        ThisSession.Adult = gee.Adult;
                        ThisSession.PatientEmail = gee.Email;

                        if (gee.Insurer != String.Empty)
                            ThisSession.Insurer = gee.Insurer;
                        if (gee.RXProvider != String.Empty)
                            ThisSession.RXProvider = gee.RXProvider;

                        if (gee.DependentTable.TableName != "EmptyTable")
                        {
                            Dependents deps = new Dependents();
                            Dependent dep = null;

                            gee.ForEachDependent(delegate(DataRow dr)
                            {
                                dep = new Dependent();
                                dep.CCHID = int.Parse(dr["CCHID"].ToString());
                                dep.FirstName = dr["FirstName"].ToString();
                                dep.LastName = dr["LastName"].ToString();
                                dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString());
                                dep.Age = int.Parse(dr["Age"].ToString());
                                dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false;
                                dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false;
                                dep.RelationshipText = dr["RelationshipText"].ToString();
                                dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false;
                                dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false;
                                dep.Email = dr["Email"].ToString();

                                deps.Add(dep);
                            });
                            ThisSession.Dependents = deps;
                        }
                        if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable")
                            ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved;
                        Response.Redirect("Review.aspx");
                    }
                    else
                    { pnlReg.Visible = false; pnlCapture.Visible = true; } //Membership not found
                }
                else
                { lblError.Visible = true; }//General error validating
            }
        }
コード例 #36
0
ファイル: FillPDF.cs プロジェクト: OCIServices/ElectronicApp
        public void FillDependentData(Dependents myDependents)
        {
            if (myDependents.getSpouse() != null)
            {
                Dependent mySpouse = myDependents.getSpouse();
                pdfFormFields.SetField("dependentname1", mySpouse.Name);

                if (mySpouse.Gender.Equals('M'))
                {
                    pdfFormFields.SetField("dependentgender1male", "Yes");
                }
                else
                {
                    pdfFormFields.SetField("dependentgender1female", "Yes");
                }

                pdfFormFields.SetField("dependentheight1", mySpouse.Height);
                pdfFormFields.SetField("dependentweight1", mySpouse.Weight);
                pdfFormFields.SetField("dependentdob1", mySpouse.DOB);
                pdfFormFields.SetField("dependentssn1", mySpouse.SSN);
                pdfFormFields.SetField("dependentpcp1", mySpouse.PrimaryCarePhysician);

                if (mySpouse.Student)
                {
                    pdfFormFields.SetField("dependentfts1yes", "Yes");
                }
                else
                {
                    pdfFormFields.SetField("dependentfts1no", "Yes");
                }

                if (mySpouse.Medicare)
                {
                    pdfFormFields.SetField("dependentms1yes", "Yes");
                }
                else
                {
                    pdfFormFields.SetField("dependentms1no", "Yes");
                }

                if (mySpouse.SSEnrolled)
                {
                    pdfFormFields.SetField("dependentssenrolled1yes", "Yes");
                }
                else
                {
                    pdfFormFields.SetField("dependentssenrolled1no", "Yes");
                }
            }

                List<Dependent> myChildren = myDependents.getDependents();
                int i = 2;
                foreach (Dependent d in myChildren)
                {
                    pdfFormFields.SetField("dependentname" + i.ToString(), d.Name);

                    if (d.Gender.Equals('M'))
                    {
                        pdfFormFields.SetField("dependentgender" + i.ToString() + "male", "Yes");
                    }
                    else
                    {
                        pdfFormFields.SetField("dependentgender" + i.ToString() + "female", "Yes");
                    }

                    pdfFormFields.SetField("dependentheight" + i.ToString(), d.Height);
                    pdfFormFields.SetField("dependentweight" + i.ToString(), d.Weight);
                    pdfFormFields.SetField("dependentdob" + i.ToString(), d.DOB);
                    pdfFormFields.SetField("dependentssn" + i.ToString(), d.SSN);
                    pdfFormFields.SetField("dependentpcp" + i.ToString(), d.PrimaryCarePhysician);

                    if (d.Student)
                    {
                        pdfFormFields.SetField("dependentfts" + i.ToString() + "yes", "Yes");
                    }
                    else
                    {
                        pdfFormFields.SetField("dependentfts" + i.ToString() + "no", "Yes");
                    }

                    if (d.Medicare)
                    {
                        pdfFormFields.SetField("dependentms" + i.ToString() + "yes", "Yes");
                    }
                    else
                    {
                        pdfFormFields.SetField("dependentms" + i.ToString() + "no", "Yes");
                    }

                    if (d.SSEnrolled)
                    {
                        pdfFormFields.SetField("dependentssenrolled" + i.ToString() + "yes", "Yes");
                    }
                    else
                    {
                        pdfFormFields.SetField("dependentssenrolled" + i.ToString() + "no", "Yes");
                    }
                    i += 1;
                }
        }
コード例 #37
0
ファイル: Welcome.aspx.cs プロジェクト: reydavid47/GITHUB
        protected void LoadUserEmployerSessionInfo()
        {
            //Which employer database?
            GetKeyEmployeeInfo gkei = new GetKeyEmployeeInfo(HoldUser);
            if (!gkei.HasErrors)
            {
                ThisSession.CCHID = gkei.CCHID;
                ThisSession.EmployeeID = gkei.EmployeeID;
                ThisSession.SubscriberMedicalID = gkei.SubscriberMedicalID;
                ThisSession.SubscriberRXID = gkei.SubscriberRXID;
                ThisSession.LastName = gkei.LastName;
                ThisSession.FirstName = gkei.FirstName;
                ThisSession.PatientAddress1 = gkei.Address1;
                ThisSession.PatientAddress2 = gkei.Address2;
                ThisSession.PatientCity = gkei.City;
                ThisSession.PatientState = gkei.State;
                ThisSession.PatientZipCode = gkei.ZipCode;
                ThisSession.PatientLatitude = gkei.Latitude;
                ThisSession.PatientLongitude = gkei.Longitude;
                ThisSession.PatientDateOfBirth = gkei.DateOfBirth;
                ThisSession.PatientPhone = gkei.Phone;
                ThisSession.HealthPlanType = gkei.HealthPlanType;
                ThisSession.MedicalPlanType = gkei.MedicalPlanType;
                ThisSession.RxPlanType = gkei.RxPlanType;
                ThisSession.PatientGender = gkei.Gender;
                ThisSession.Parent = gkei.Parent;
                ThisSession.Adult = gkei.Adult;
                ThisSession.PatientEmail = HoldUser;

                if (gkei.Insurer != String.Empty)
                    ThisSession.Insurer = gkei.Insurer;
                if (gkei.RXProvider != String.Empty)
                    ThisSession.RXProvider = gkei.RXProvider;

                if (gkei.DependentTable.TableName != "EmptyTable")
                {
                    Dependents deps = new Dependents();
                    Dependent dep = null;

                    gkei.ForEachDependent(delegate(DataRow dr)
                    {
                        dep = new Dependent();
                        dep.CCHID = int.Parse(dr["CCHID"].ToString());
                        dep.FirstName = dr["FirstName"].ToString();
                        dep.LastName = dr["LastName"].ToString();
                        dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString());
                        dep.Age = int.Parse(dr["Age"].ToString());
                        dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false;
                        dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false;
                        dep.RelationshipText = dr["RelationshipText"].ToString();
                        dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false;
                        dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false;
                        dep.Email = dr["Email"].ToString();

                        deps.Add(dep);
                    });

                    ThisSession.Dependents = deps;
                }

                if (gkei.YouCouldHaveSavedTable.TableName != "EmptyTable")
                    ThisSession.YouCouldHaveSaved = (int)gkei.YouCouldHaveSaved;
            }
            else
            {
                //Literal failText = (Literal)CheckEmpIDLogin.FindControl("FailureText");
                //failText.Text = gkei.SqlException;
                //failText.Visible = true;
            }
        }
コード例 #38
0
        protected void UserWizard1_NextButtonClick(object sender, EventArgs e)
        {
            //Handle saving data the old way.
            #region Basic Info
            if (UserWizard1.ActiveStepIndex == 0)
            {
                if (Session["ClientID"] == null && Session["UserID"] == null)
                {
                    Session.Abandon();
                    FormsAuthentication.SignOut();
                    Response.Redirect("~/Default.aspx?timeout=1");
                }
                else
                {
                    Guid ClientID = (Guid)Session["ClientID"];
                    Guid UserID = (Guid)Session["UserID"];
                    ElectronicAppDBDataContext eappdata = new ElectronicAppDBDataContext();
                    //eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName, txtLastName, txtBirthDate);
                    List<uspDoesEnrolleeExistResult> myResult = eappdata.uspDoesEnrolleeExist(ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text).ToList<uspDoesEnrolleeExistResult>();
                    if (myResult.Count > 0)
                    {
                        Session["UserID"] = myResult[0].EnrolleeID;
                    }
                    else
                    {
                        eappdata.uspInsertEnrollee(UserID, ClientID, txtFirstName.Text, txtLastName.Text, txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text, false, Request.UserHostAddress.ToString());
                    }

                    employeeData myData = new employeeData();
                    myData.EmployeeName = txtFirstName.Text + " " + txtLastName.Text;
                    myData.DOB = txtMonth.Text + "/" + txtDay.Text + "/" + txtYear.Text;

                    if (cmbWaive.Text.Equals("Yes", StringComparison.CurrentCultureIgnoreCase))
                    {
                        myData.WaiveAll = true;
                        Session.Add("EmployeeData", myData);
                        UserWizard1.ActiveStepIndex = 2;
                    }
                    else
                    {
                        myData.WaiveAll = false;
                        Session.Add("EmployeeData", myData);
                    }
                }
            }
            #endregion

            #region Employee Data
            else if (UserWizard1.ActiveStepIndex == 1)
            {
                if (Session["UserID"] != null && Session["ClientID"] != null && Session["EmployeeData"] != null)
                {
                    employeeData myData = (employeeData)Session["EmployeeData"];

                    myData.HomeAddress = txtAddress.Text;
                    myData.City = txtCity.Text;
                    myData.State = txtState.Text;
                    myData.Zip = txtZip.Text;
                    myData.HomePhone = txtHomePhone.Text + "-" + txtHomePhone0.Text + "-" + txtHomePhone1.Text;
                    myData.WorkPhone = txtWorkPhone.Text + "-" + txtWorkPhone0.Text + "-" + txtWorkPhone1.Text;
                    myData.Email = txtEmail.Text;
                    // myData.DOB = txtDOB.Text;
                    myData.Height = txtHeight.Text;
                    myData.Weight = txtWeight.Text;
                    myData.Soc = txtSoc.Text + "-" + txtSoc0.Text + "-" + txtSoc1.Text;
                    myData.JobTitle = txtTitle.Text;
                    myData.DOH = txtHireDate.Text;
                    myData.AvgHours = txtHours.Text;
                    myData.Salary = txtSalary.Text;
                    myData.EmploymentStatus = cmbStatus.SelectedValue;
                    myData.MaritalStatus = cmbMaritalStatus.SelectedValue;
                    myData.NumChildren = int.Parse(cmbChildren.SelectedValue);
                    myData.PrimaryPhysician = txtPhysician.Text;

                    if (cmbMedicare.SelectedValue.ToUpper() == "YES")
                    {
                        myData.Medicare = true;
                    }
                    else
                    {
                        myData.Medicare = false;
                    }
                    if (cmbDisabled.SelectedValue.ToUpper() == "YES")
                    {
                        myData.Disabled = true;
                    }
                    else
                    {
                        myData.Disabled = false;
                    }

                    if (cmbGender.SelectedValue.ToUpper() == "MALE")
                    {
                        myData.Gender = "male";
                    }
                    else
                    {
                        myData.Gender = "female";
                    }

                    Session["EmployeeData"] = myData;
                }
                else
                {
                    Response.Redirect("~/Default.aspx?timeout=1", false);
                }
            }
            #endregion

            #region Coverage Selection
            else if (UserWizard1.ActiveStepIndex == 2)
            {
                if (Session["UserID"] != null)
                {
                    if (Session["EmployeeData"] != null && Session["CoverageOffered"] != null)
                    {
                        employeeData myEmployeeData = (employeeData)Session["EmployeeData"];
                        Coverage myCoverage = new Coverage(myEmployeeData.WaiveAll);
                        coverageOffered myCoverageOffered = (coverageOffered)Session["CoverageOffered"];

                        if (myCoverageOffered.IsMedical)
                        {
                            myCoverage.addCoverageItem(new CoverageItem("Medical", cmbMedical.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren));
                        }
                        if (myCoverageOffered.IsDental)
                        {
                            myCoverage.addCoverageItem(new CoverageItem("Dental", cmbDental.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren));
                        }
                        if (myCoverageOffered.IsVision)
                        {
                            myCoverage.addCoverageItem(new CoverageItem("Vision", cmbVision.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren));
                        }
                        if (myCoverageOffered.IsLife)
                        {
                            myCoverage.addCoverageItem(new CoverageItem("Life", cmbLife.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren));
                        }
                        if (myCoverageOffered.IsDisability)
                        {
                            myCoverage.addCoverageItem(new CoverageItem("Disability", cmbDisability.SelectedValue.ToLower(), myEmployeeData.IsSingle, myEmployeeData.IsChildren));
                        }

                        if ((!myCoverageOffered.IsMedical || cmbMedical.SelectedValue.ToLower() == "waive") &&
                          (!myCoverageOffered.IsDental || cmbDental.SelectedValue.ToLower() == "waive") &&
                          (!myCoverageOffered.IsDisability || cmbDisability.SelectedValue.ToLower() == "waive") &&
                          (!myCoverageOffered.IsVision || cmbVision.SelectedValue.ToLower() == "waive") &&
                          (!myCoverageOffered.IsLife || cmbLife.SelectedValue.ToLower() == "waive"))
                        {
                            //myEmployeeData.WaiveAll = true;
                            myCoverage.IsWaiveAll = true;
                        }

                        if (Session["Coverage"] != null)
                        {
                            Session["Coverage"] = myCoverage;
                        }
                        else
                        {
                            Session.Add("Coverage", myCoverage);
                        }

                        if (myCoverage.isWaiving("Medical"))
                        {
                            UserWizard1.ActiveStepIndex = 4;
                        }
                        else if (myCoverage.isWaiving("Dental"))
                        {
                            UserWizard1.ActiveStepIndex = 5;
                        }
                        else if (myCoverage.isWaiving("Vision"))
                        {
                            UserWizard1.ActiveStepIndex = 6;
                        }
                        else if (myCoverage.isWaiving("Life"))
                        {
                            UserWizard1.ActiveStepIndex = 7;
                        }
                        else if (myCoverage.isWaiving("Disability"))
                        {
                            UserWizard1.ActiveStepIndex = 8;
                        }
                        else
                        {
                            bool isSpouseCovered = false;
                            bool isChildrenCovered = false;
                            if (!myEmployeeData.IsSingle)
                            {
                                isSpouseCovered = myCoverage.isSpouseCovered();
                            }
                            if (myEmployeeData.IsChildren)
                            {
                                isChildrenCovered = myCoverage.isChildCovered();
                            }
                            if (isSpouseCovered || isChildrenCovered)
                            {
                                //Do Nothing. Wizard will procede to Step 3 normally.
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }
                        }
                    }
                    else
                    {
                        Session.Abandon();
                        FormsAuthentication.SignOut();
                        Response.Redirect("~/Default.aspx?timeout=1");
                    }
                }
                else
                {
                    Session.Abandon();
                    FormsAuthentication.SignOut();
                    Response.Redirect("~/Default.aspx?timeout=1");
                }
            }
            #endregion

            #region Dependent Data
            else if (UserWizard1.ActiveStepIndex == 3)
            {
                if (Session["UserID"] != null)
                {
                    Dependents myDependents = new Dependents();
                    if (isSpouse.Value.Equals("1"))
                    {
                        Dependent myDependent = new Dependent();
                        myDependent.IsSpouse = true;
                        myDependent.Name = spName.Text;
                        if (spGender.Text.ToLower().Equals("male"))
                        {
                            myDependent.Gender = 'M';
                        }
                        else if (spGender.Text.ToLower().Equals("female"))
                        {
                            myDependent.Gender = 'F';
                        }
                        myDependent.Height = spHeight.Text;
                        myDependent.Weight = spWeight.Text;
                        myDependent.DOB = spDOB.Text;
                        myDependent.SSN = spSSN.Text;
                        myDependent.PrimaryCarePhysician = spPhysician.Text;
                        if (spStudent.Text.ToLower().Equals("yes"))
                        {
                            myDependent.Student = true;
                        }
                        else
                        {
                            myDependent.Student = false;
                        }
                        if (spMedicare.Text.ToLower().Equals("yes"))
                        {
                            myDependent.Medicare = true;
                        }
                        else
                        {
                            myDependent.Medicare = false;
                        }
                        if (spSS.Text.ToLower().Equals("yes"))
                        {
                            myDependent.SSEnrolled = true;
                        }
                        else
                        {
                            myDependent.SSEnrolled = false;
                        }
                        myDependents.addDependent(myDependent);
                    }
                    if (!numChildren.Value.Equals("0"))
                    {
                        getChildren(myDependents);
                    }
                    if (Session["Dependents"] != null)
                    {
                        Session["Dependents"] = myDependents;
                    }
                    else
                    {
                        Session.Add("Dependents", myDependents);
                    }
                    UserWizard1.ActiveStepIndex = 9;

                }
            }
            #endregion

            #region Medical Waive
            else if (UserWizard1.ActiveStepIndex == 4)
            {
                if (Session["UserID"] != null)
                {
                    if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                    {
                        bool isSpouseCovered = false;
                        bool isChildrenCovered = false;

                        Coverage myCoverage = (Coverage)Session["Coverage"];
                        employeeData myData = (employeeData)Session["EmployeeData"];
                        DeclineReason myReason = saveReasons();

                        if (Session["ReasonForDeclineHealth"] != null)
                        {
                            Session.Add("ReasonForDeclineHealth", myReason);
                        }
                        else
                        {
                            Session["ReasonForDeclineHealth"] = myReason;
                        }
                        if (!myData.IsSingle)
                        {
                            isSpouseCovered = myCoverage.isSpouseCovered();
                        }
                        if (myData.IsChildren)
                        {
                            isChildrenCovered = myCoverage.isChildCovered();
                        }
                        if (myCoverage.isWaiving("Dental"))
                        {
                            UserWizard1.ActiveStepIndex = 5;
                        }
                        else if (myCoverage.isWaiving("Vision"))
                        {
                            UserWizard1.ActiveStepIndex = 6;
                        }
                        else if (myCoverage.isWaiving("Life"))
                        {
                            UserWizard1.ActiveStepIndex = 7;
                        }
                        else if (myCoverage.isWaiving("Disability"))
                        {
                            UserWizard1.ActiveStepIndex = 8;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else
                        {
                            if (myData.WaiveAll || myCoverage.IsWaiveAll)
                            {
                                UserWizard1.ActiveStepIndex = 12;
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }
                        }
                    }
                }
            }
            #endregion

            #region Dental Waive
            else if (UserWizard1.ActiveStepIndex == 5)
            {
                if (Session["UserID"] != null)
                {
                    if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                    {
                        bool isSpouseCovered = false;
                        bool isChildrenCovered = false;

                        Coverage myCoverage = (Coverage)Session["Coverage"];
                        employeeData myData = (employeeData)Session["EmployeeData"];
                        DeclineReason myReason = saveReasons0();

                        if (Session["ReasonForDeclineDental"] != null)
                        {
                            Session.Add("ReasonForDeclineDental", myReason);
                        }
                        else
                        {
                            Session["ReasonForDeclineDental"] = myReason;
                        }
                        if (!myData.IsSingle)
                        {
                            isSpouseCovered = myCoverage.isSpouseCovered();
                        }
                        if (myData.IsChildren)
                        {
                            isChildrenCovered = myCoverage.isChildCovered();
                        }
                        if (myCoverage.isWaiving("Vision"))
                        {
                            UserWizard1.ActiveStepIndex = 6;
                        }
                        else if (myCoverage.isWaiving("Life"))
                        {
                            UserWizard1.ActiveStepIndex = 7;
                        }
                        else if (myCoverage.isWaiving("Disability"))
                        {
                            UserWizard1.ActiveStepIndex = 8;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else
                        {
                            if (myData.WaiveAll || myCoverage.IsWaiveAll)
                            {
                                UserWizard1.ActiveStepIndex = 12;
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }                        }
                    }
                }
            }
            #endregion

            #region Vison Waive
            else if (UserWizard1.ActiveStepIndex == 6)
            {
                if (Session["UserID"] != null)
                {
                    if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                    {
                        bool isSpouseCovered = false;
                        bool isChildrenCovered = false;

                        Coverage myCoverage = (Coverage)Session["Coverage"];
                        employeeData myData = (employeeData)Session["EmployeeData"];
                        DeclineReason myReason = saveReasons1();

                        if (Session["ReasonForDeclineVision"] != null)
                        {
                            Session.Add("ReasonForDeclineVision", myReason);
                        }
                        else
                        {
                            Session["ReasonForDeclineVision"] = myReason;
                        }
                        if (!myData.IsSingle)
                        {
                            isSpouseCovered = myCoverage.isSpouseCovered();
                        }
                        if (myData.IsChildren)
                        {
                            isChildrenCovered = myCoverage.isChildCovered();
                        }

                        if (myCoverage.isWaiving("Life"))
                        {
                            UserWizard1.ActiveStepIndex = 7;
                        }
                        else if (myCoverage.isWaiving("Disability"))
                        {
                            UserWizard1.ActiveStepIndex = 8;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else
                        {
                            if (myData.WaiveAll || myCoverage.IsWaiveAll)
                            {
                                UserWizard1.ActiveStepIndex = 12;
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }
                        }
                    }
                }
            }
            #endregion

            #region Life Waive
            else if (UserWizard1.ActiveStepIndex == 7)
            {
                if (Session["UserID"] != null)
                {
                    if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                    {
                        bool isSpouseCovered = false;
                        bool isChildrenCovered = false;

                        Coverage myCoverage = (Coverage)Session["Coverage"];
                        employeeData myData = (employeeData)Session["EmployeeData"];
                        DeclineReason myReason = saveReasons2();

                        if (Session["ReasonForDeclineLife"] != null)
                        {
                            Session.Add("ReasonForDeclineLife", myReason);
                        }
                        else
                        {
                            Session["ReasonForDeclineLife"] = myReason;
                        }
                        if (!myData.IsSingle)
                        {
                            isSpouseCovered = myCoverage.isSpouseCovered();
                        }
                        if (myData.IsChildren)
                        {
                            isChildrenCovered = myCoverage.isChildCovered();
                        } if (myCoverage.isWaiving("Disability"))
                        {
                            UserWizard1.ActiveStepIndex = 8;
                        }
                        else if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else
                        {
                            if (myData.WaiveAll || myCoverage.IsWaiveAll)
                            {
                                UserWizard1.ActiveStepIndex = 12;
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }
                        }
                    }
                }
            }
            #endregion

            #region Disability Waive
            else if (UserWizard1.ActiveStepIndex == 8)
            {
                if (Session["UserID"] != null)
                {
                    if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                    {
                        bool isSpouseCovered = false;
                        bool isChildrenCovered = false;

                        Coverage myCoverage = (Coverage)Session["Coverage"];
                        employeeData myData = (employeeData)Session["EmployeeData"];
                        DeclineReason myReason = saveReasons3();

                        if (Session["ReasonForDeclineDisability"] != null)
                        {
                            Session.Add("ReasonForDeclineDisability", myReason);
                        }
                        else
                        {
                            Session["ReasonForDeclineDisability"] = myReason;
                        }
                        if (!myData.IsSingle)
                        {
                            isSpouseCovered = myCoverage.isSpouseCovered();
                        }
                        if (myData.IsChildren)
                        {
                            isChildrenCovered = myCoverage.isChildCovered();
                        }
                        if (isSpouseCovered || isChildrenCovered)
                        {
                            UserWizard1.ActiveStepIndex = 3;
                        }
                        else
                        {
                            if (myData.WaiveAll || myCoverage.IsWaiveAll)
                            {
                                UserWizard1.ActiveStepIndex = 12;
                            }
                            else
                            {
                                UserWizard1.ActiveStepIndex = 9;
                            }
                        }
                    }
                }
            }
            #endregion

            #region Other Coverage
            else if (UserWizard1.ActiveStepIndex == 9)
            {
                if (Session["UserID"] != null)
                {
                    if (cmbMedicare.SelectedValue.ToLower().Equals("yes"))
                    {
                        MedicareCoverage myMedicare = new MedicareCoverage();
                        myMedicare.Name = txtMedicareName.Text;
                        myMedicare.ID = txtMedicareID.Text;
                        myMedicare.EffDateA = txtMedicareA.Text;
                        myMedicare.EffDateB = txtMedicareB.Text;
                        myMedicare.EffDateC = txtMedicareC.Text;
                        if (Session["MedicareCoverage"] == null)
                        {
                            Session.Add("MedicareCoverage", myMedicare);
                        }
                        else
                        {
                            Session["MedicareCoverage"] = myMedicare;
                        }
                    }
                    else
                    {
                        if (Session["MedicareCoverage"] != null)
                        {
                            Session.Remove("MedicareCoverage");
                        }

                    }
                    if (cmbConcurrentCoverage.SelectedValue.ToLower().Equals("yes"))
                    {
                        ConcurrentCoverage myConcurrent = new ConcurrentCoverage();
                        myConcurrent.Name = txtConcurentName.Text;
                        myConcurrent.Employer = txtConcurrentEmployer.Text;
                        myConcurrent.InsuranceCompanyName = txtConcurrentProvider.Text;
                        myConcurrent.PolicyNo = txtConcurrentPolicy.Text;
                        myConcurrent.EffectiveDate = txtConcurrentEff.Text;
                        myConcurrent.EndDate = txtConcurrentEnd.Text;
                        myConcurrent.IsDental = ckDental.Checked;
                        myConcurrent.IsDisability = ckDisability.Checked;
                        myConcurrent.IsLife = ckLife.Checked;
                        myConcurrent.IsMedical = ckMedical.Checked;
                        myConcurrent.IsVision = ckVision.Checked;
                        if (cmbConcurrentType.SelectedValue.Equals("employee", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myConcurrent.IsEmployee = true;
                        }
                        else if (cmbConcurrentType.SelectedValue.Equals("employee/child(ren)", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myConcurrent.IsEmployeeChild = true;
                        }
                        else if (cmbConcurrentType.SelectedValue.Equals("employee/spouse", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myConcurrent.IsEmployeeSpouse = true;
                        }
                        else if (cmbConcurrentType.SelectedValue.Equals("Employee/Spouse/Child(ren)", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myConcurrent.IsEmployeeSpouseChild = true;
                        }

                        if (Session["ConcurrentCoverage"] == null)
                        {
                            Session.Add("ConcurrentCoverage", myConcurrent);
                        }
                        else
                        {
                            Session["ConcurrentCoverage"] = myConcurrent;
                        }
                    }
                    else
                    {
                        if (Session["ConcurrentCoverage"] != null)
                        {
                            Session.Remove("ConcurrentCoverage");
                        }

                    }
                    if (cmbPreviousCoverage.SelectedValue.ToLower().Equals("yes"))
                    {
                        PreviousCoverage myPrevious = new PreviousCoverage();
                        myPrevious.Names = txtPreviousName.Text;
                        myPrevious.Employer = txtPreviousEmployer.Text;
                        myPrevious.InsuranceCompanyName = txtPreviousProvider.Text;
                        myPrevious.Policy = txtPolicy.Text;
                        myPrevious.EffectiveDate = txtPreviousEff.Text;
                        myPrevious.EndDate = txtPreviousEnd.Text;

                        if (cmbPreviousType.SelectedValue.Equals("employee", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myPrevious.IsEmployee = true;
                        }
                        else if (cmbPreviousType.SelectedValue.Equals("employee/child(ren)", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myPrevious.IsEmployeeChild = true;
                        }
                        else if (cmbPreviousType.SelectedValue.Equals("employee/spouse", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myPrevious.IsEmployeeSpouse = true;
                        }
                        else if (cmbPreviousType.SelectedValue.Equals("Employee/Spouse/Child(ren)", StringComparison.CurrentCultureIgnoreCase))
                        {
                            myPrevious.IsEmployeeSpouseChild = true;
                        }

                        if (Session["PreviousCoverage"] == null)
                        {
                            Session.Add("PreviousCoverage", myPrevious);
                        }
                        else
                        {
                            Session["PreviousCoverage"] = myPrevious;
                        }
                    }
                    else
                    {
                        if (Session["PreviousCoverage"] != null)
                        {
                            Session.Remove("PreviousCoverage");
                        }
                    }

                    if (isLife.Value == "1")
                    {
                        LifeBeneficiaries myLife = new LifeBeneficiaries();
                        myLife.Primary1Name = txtPrimary1Name.Text + ", " + txtPrimary1Addr.Text;
                        myLife.Primary1Percent = txtPrimary1Perc.Text;
                        myLife.Primary1Relationship = txtPrimary1Relation.Text;
                        myLife.Primary1SSN = txtPrimary1SSN.Text;

                        myLife.Primary2Name = txtPrimary2Name.Text + ", " + txtPrimary2Addr.Text;
                        myLife.Primary2Percent = txtPrimary2Perc.Text;
                        myLife.Primary2Relationship = txtPrimary2Relation.Text;
                        myLife.Primary2SSN = txtPrimary2SSN.Text;

                        myLife.Secondary1Name = txtSecondary1Name.Text + ", " + txtSecondary1Addr.Text;
                        myLife.Secondary1Percent = txtSecondary1Perc.Text;
                        myLife.Secondary1Relationship = txtSecondary1Relation.Text;
                        myLife.Secondary1SSN = txtSecondary1SSN.Text;

                        myLife.Secondary2Name = txtSecondary2Name.Text + ", " + txtSecondary2Addr.Text;
                        myLife.Secondary2Percent = txtSecondary2Perc.Text;
                        myLife.Secondary2Relationship = txtSecondary2Relation.Text;
                        myLife.Secondary2SSN = txtSecondary2SSN.Text;
                        if (Session["LifeBeneficiaries"] == null)
                        {
                            Session.Add("LifeBeneficiaries", myLife);
                        }
                        else
                        {
                            Session["LifeBeneficiaries"] = myLife;
                        }
                    }
                    else
                    {
                        if (Session["LifeBeneficiaries"] != null)
                        {
                            Session.Remove("LifeBeneficiaries");
                        }
                    }
                }
            }
            #endregion

            #region Health Information
            else if (UserWizard1.ActiveStepIndex == 10)
            {
                bool hasCondition = false;
                HealthInformationAnswers myAnswers = new HealthInformationAnswers();
                foreach (System.Web.UI.WebControls.ListItem li in CheckBoxList1.Items)
                {
                    if (li.Selected)
                    {
                        myAnswers.addAnswer(li);
                        hasCondition = true;
                    }
                }
                foreach (System.Web.UI.WebControls.ListItem li in CheckBoxList3.Items)
                {
                    if (li.Selected)
                    {
                        myAnswers.addAnswer(li);
                        hasCondition = true;
                    }
                }

                if (txtDueDate.Text != "")
                {
                    myAnswers.DueData = txtDueDate.Text;
                }
                else
                {
                    myAnswers.DueData = "";
                }

                if (Q32.Text.ToLower().Equals("yes"))
                {
                    System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("32. Have you or any of your dependents recieved inpatiant or outpatient services in the last 3 years (excluding routine tests, physicals or inoculations)?", "Q32", true);
                    li.Selected = true;
                    myAnswers.addAnswer(li);
                    myAnswers.Q32 = true;
                    hasCondition = true;
                }

                if (Q33.Text.ToLower().Equals("yes"))
                {
                    System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("33. Do you or any person named in this application have tests, treatments, hospitalization or surgery planned or recommended in the future?", "Q33", true);
                    li.Selected = true;
                    myAnswers.addAnswer(li);
                    myAnswers.Q33 = true;
                    hasCondition = true;
                }

                if (Q34.Text.ToLower().Equals("yes"))
                {
                    System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("34. Do you or any person named in this application take any medicine, prescription drugs or require shots/injections?", "Q34", true);
                    li.Selected = true;
                    myAnswers.addAnswer(li);
                    myAnswers.Q34 = true;
                    hasCondition = true;
                }
                if (Q35.Text.ToLower().Equals("yes"))
                {
                    System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("35. Do you or any person named in this application have any other medical conditions which have not yet been previously mentioned?", "Q35", true);
                    li.Selected = true;
                    myAnswers.addAnswer(li);
                    myAnswers.Q35 = true;
                    hasCondition = true;
                }

                Session.Add("HealthInformationAnswers", myAnswers);

                if (!hasCondition)
                {
                    if (Session["HealthStatements"] != null)
                    {
                        Session.Remove("HealthStatements");
                    }
                    UserWizard1.ActiveStepIndex = 12;
                }

                else
                {
                    //Response.Redirect("~/NebraskaApp/HealthExplanations.aspx", false);

                    HealthStatements hs = new HealthStatements();

                    HealthStatement mystatem = new HealthStatement();

                    mystatem.Condition = "Text";
                    mystatem.DateDiagnosed = "Date";
                    mystatem.DateLastTreated = "Date";
                    mystatem.IsMedication = false;
                    mystatem.Name = "Foo";
                    mystatem.Question = "Question?";
                    mystatem.QuestionNum = "1a";
                    mystatem.Recovery = "sdfshjdlkf";
                    mystatem.RowID = 1;
                    mystatem.TreatmentType = "jdflskdj";

                    //hs.addStatement(mystatem);

                    if (Session["HealthStatements"] == null)
                    {
                        Session.Add("HealthStatements", hs);
                    }
                    ObjectDataSource1.Select();
                }
            }
            #endregion

            #region Health Explanations
            else if (UserWizard1.ActiveStepIndex == 11)
            {
                HealthStatements myStatements = new HealthStatements();
                /*foreach (KeyValuePair<int, string> id in ControlIdList)
                {
                    DynamicTableControl control = (DynamicTableControl)m_controls[id.Key];
                    foreach (int id2 in control.RowIdList)
                    {
                        RowControl r = (RowControl)control.MyRows[id2];
                        HealthStatement myStatement = r.getHealthStatement();
                        myStatement.QuestionNum = id.Value.Split('.')[0];
                        myStatement.Question = id.Value;
                        myStatement.RowID = id2;
                        myStatements.addStatement(myStatement);
                    }
                }*/

                if (Session["HealthStatements"] != null)
                {
                    //Session.Add("HealthStatements", myStatements);
                }
                else
                {
                    //Session["HealthStatements"] = myStatements;
                }

            }
            #endregion

            #region Processing
            else if (UserWizard1.ActiveStepIndex == 12)
            {
                fillPdf();
            }
            #endregion

            #region Review And Sign
            else if (UserWizard1.ActiveStepIndex == 13)
            {
                //Simply pass control to next step.
            }
            #endregion
        }
コード例 #39
0
ファイル: Welcome.aspx.cs プロジェクト: reydavid47/GITHUB
        protected void Continue(object sender, EventArgs e)
        {
            //Get the connection string for the specific database if it isn't already in the view state
            if (ConnString == String.Empty)
                using (GetEmployerConnString gecs = new GetEmployerConnString("AnalogDevices")) //2 = Analog Devices
                    if (!gecs.HasErrors)
                    {
                        ConnString = gecs.ConnectionString;
                        EmployerID = gecs.EmployerID.ToString();
                    }

            if (ConnString != String.Empty)
                ThisSession.CnxString = ConnString;
            if (EmployerID != String.Empty)
                ThisSession.EmployerID = EmployerID;

            //Check if the employee exists and if they do, store session info and move on
            using (GetEmployeeEnrollment gee = new GetEmployeeEnrollment())
            {
                //gee.Firstname = txtFirstName.Text;
                gee.LastName = Encoder.HtmlEncode(txtLastName.Text);
                gee.MemberID = Encoder.HtmlEncode(txtMemID.Text);
                gee.DOB = Encoder.HtmlEncode(txtDOB.Text);
                gee.GetData(ConnString);

                if (!gee.HasErrors)
                {
                    if (gee.EmployeeTable.TableName != "Empty" && gee.EmployeeTable.Rows.Count > 0)
                    {
                        lblNotFound.Visible = false;
                        lblError.Visible = false;

                        ThisSession.CCHID = gee.CCHID;
                        ThisSession.EmployeeID = gee.EmployeeID;
                        ThisSession.SubscriberMedicalID = gee.SubscriberMedicalID;
                        ThisSession.SubscriberRXID = gee.SubscriberRXID;
                        ThisSession.LastName = gee.LastName;
                        //ThisSession.FirstName = gee.Firstname;
                        ThisSession.PatientAddress1 = gee.Address1;
                        ThisSession.PatientAddress2 = gee.Address2;
                        ThisSession.PatientCity = gee.City;
                        ThisSession.PatientState = gee.State;
                        ThisSession.PatientZipCode = gee.ZipCode;
                        ThisSession.PatientLatitude = gee.Latitude;
                        ThisSession.PatientLongitude = gee.Longitude;
                        ThisSession.PatientDateOfBirth = gee.DOB;
                        ThisSession.PatientPhone = gee.Phone;
                        ThisSession.HealthPlanType = gee.HealthPlanType;
                        ThisSession.MedicalPlanType = gee.MedicalPlanType;
                        ThisSession.RxPlanType = gee.RxPlanType;
                        ThisSession.PatientGender = gee.Gender;
                        ThisSession.Parent = gee.Parent;
                        ThisSession.Adult = gee.Adult;
                        ThisSession.PatientEmail = gee.Email;

                        if (gee.Insurer != String.Empty)
                            ThisSession.Insurer = gee.Insurer;
                        if (gee.RXProvider != String.Empty)
                            ThisSession.RXProvider = gee.RXProvider;

                        if (gee.DependentTable.TableName != "EmptyTable")
                        {
                            Dependents deps = new Dependents();
                            Dependent dep = null;

                            gee.ForEachDependent(delegate(DataRow dr)
                            {
                                dep = new Dependent();
                                dep.CCHID = int.Parse(dr["CCHID"].ToString());
                                dep.FirstName = dr["FirstName"].ToString();
                                dep.LastName = dr["LastName"].ToString();
                                dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString());
                                dep.Age = int.Parse(dr["Age"].ToString());
                                dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false;
                                dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false;
                                dep.RelationshipText = dr["RelationshipText"].ToString();
                                dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false;
                                dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false;
                                dep.Email = dr["Email"].ToString();

                                deps.Add(dep);
                            });
                            ThisSession.Dependents = deps;
                        }
                        if (gee.YouCouldHaveSavedTable.TableName != "EmptyTable")
                            ThisSession.YouCouldHaveSaved = (int)gee.YouCouldHaveSaved;
                        Response.Redirect("Review.aspx");
                    }
                    else
                    { lblNotFound.Visible = true; }
                }
                else
                { lblError.Visible = true; }
            }
        }