Ejemplo n.º 1
0
        /// <summary>
        /// Puts the relevant data into session from a DataSet object rather than storing the whole object in session
        /// </summary>
        /// <param name="info">The GetKeyEmployeeInfo Object filled with data</param>
        /// <param name="UserName">The UserName of the employee</param>
        /// <returns>True if successfull, False if there are errors or no data</returns>
        public static Boolean PutInSession(this GetKeyEmployeeInfo info, String UserName)
        {
            if (info.HasErrors)
            {
                return(false);
            }
            if (info.Tables.Count == 0)
            {
                return(false);
            }
            if (info.Tables[0].Rows.Count == 0)
            {
                return(false);
            }

            ThisSession.CCHID                 = info.CCHID;
            ThisSession.EmployeeID            = info.EmployeeID;
            ThisSession.SubscriberMedicalID   = info.SubscriberMedicalID;
            ThisSession.SubscriberRXID        = info.SubscriberRXID;
            ThisSession.LastName              = info.LastName;
            ThisSession.FirstName             = info.FirstName;
            ThisSession.PatientAddress1       = info.Address1;
            ThisSession.PatientAddress2       = info.Address2;
            ThisSession.PatientCity           = info.City;
            ThisSession.PatientState          = info.State;
            ThisSession.PatientZipCode        = info.ZipCode;
            ThisSession.PatientLatitude       = info.Latitude;
            ThisSession.PatientLongitude      = info.Longitude;
            ThisSession.DefaultPatientAddress = ThisSession.PatientAddressSingleLine;
            ThisSession.PatientDateOfBirth    = info.DateOfBirth;
            ThisSession.PatientPhone          = info.Phone;
            ThisSession.HealthPlanType        = info.HealthPlanType;
            ThisSession.MedicalPlanType       = info.MedicalPlanType;
            ThisSession.RxPlanType            = info.RxPlanType;
            ThisSession.PatientGender         = info.Gender;
            ThisSession.Parent                = info.Parent;
            ThisSession.Adult                 = info.Adult;
            ThisSession.PatientEmail          = UserName.Trim();
            ThisSession.OptInIncentiveProgram = info.OptInIncentiveProgram;
            ThisSession.OptInEmailAlerts      = info.OptInEmailAlerts;
            ThisSession.OptInTextMsgAlerts    = info.OptInTextMsgAlerts;
            ThisSession.MobilePhone           = info.MobilePhone;
            ThisSession.OptInPriceConcierge   = info.OptInPriceConcierge;
            if (info.Insurer != String.Empty)
            {
                ThisSession.Insurer = info.Insurer;
            }
            if (info.RXProvider != String.Empty)
            {
                ThisSession.RXProvider = info.RXProvider;
            }
            if (info.DependentTable.TableName != "EmptyTable")
            {
                Dependents deps = new Dependents();
                Dependent  dep  = null;

                info.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 (info.YouCouldHaveSavedTable.TableName != "EmptyTable")
            {
                ThisSession.YouCouldHaveSaved = (int)info.YouCouldHaveSaved;
            }

            return(true);
        }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }