Beispiel #1
0
        public ActionResult ClientGrowthChart(string client = "", int type = 0)
        {
            ViewBag.eClientId = client;
            ViewBag.Type      = type;

            try
            {
                long          cid = 0;
                Clientprofile cp  = new Clientprofile();
                if (!string.IsNullOrEmpty(client))
                {
                    cid = Convert.ToInt64(EncryptDecrypt.Decrypt(client));
                    cp  = new RosterData().GetClientDetails(cid);
                }
                ViewBag.ClientDetail = cp;
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }

            return(View());
        }
Beispiel #2
0
        public List <Clientprofile> GetClientProfile(Guid?AgencyId, long ClientId, DateTime monthReview)
        {
            List <Clientprofile> ClientprofileList = new List <Clientprofile>();
            Clientprofile        clientProfile     = new Clientprofile();;
            string queryCommand = "SELECT";

            try
            {
                if (Connection.State == ConnectionState.Open)
                {
                    Connection.Close();
                }
                Connection.Open();
                command.Connection  = Connection;
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Clear();
                command.Parameters.Add(new SqlParameter("@Agencyid", AgencyId));
                command.Parameters.Add(new SqlParameter("@ClientId", ClientId));
                command.Parameters.Add(new SqlParameter("@AttendanceDate", monthReview));
                command.Parameters.Add(new SqlParameter("@Command", queryCommand));
                command.CommandText = "USP_ClientGetProfile";
                DataAdapter         = new SqlDataAdapter(command);
                _dataset            = new DataSet();
                DataAdapter.Fill(_dataset);
                if ((_dataset.Tables[0] != null) && (_dataset.Tables[0].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[0].Rows)
                    {
                        clientProfile.ChildName = dr["ChildName"].ToString();
                        clientProfile.ChildId   = EncryptDecrypt.Encrypt64(dr["ClientId"].ToString());
                        clientProfile.ChildAge  = "(" + dr["ChildYear"].ToString() + "Y  " + dr["ChildMonth"].ToString() + "M " + dr["ChildDay"].ToString() + "Days )";

                        clientProfile.DOB           = (!string.IsNullOrEmpty(Convert.ToDateTime(dr["DOB"]).ToString("MM/dd/yyyy"))) ? (Convert.ToDateTime(dr["DOB"]).ToString("MM/dd/yyyy")) : "";
                        clientProfile.BMI           = dr["BMI"].ToString();
                        clientProfile.BMIPercentage = dr["BMIPercentage"].ToString();
                        //if(string.IsNullOrEmpty(clientProfile.BMIPercentage))
                        //{
                        //    clientProfile.BMI = "-";
                        //}
                        //else
                        //{
                        //    clientProfile.BMI = Math.Round(Convert.ToDecimal(clientProfile.BMIPercentage),2) + " " + "( " + clientProfile.BMI + " )";
                        //}
                        clientProfile.Doctor  = dr["Doctor"].ToString();
                        clientProfile.Dentist = dr["Dentist"].ToString();
                        clientProfile.TransportationProvided = dr["TransportationProvided"].ToString();
                        // Clientprofile.PregnantMother = (string.IsNullOrEmpty(dr["PregnantMother"].ToString())) ? dr["PregnantMother"].ToString() : "";
                        // members.IsHomeBased = Convert.ToBoolean(dr["HomeBased"]);
                        // clientProfile.ParentDOB = Convert.ToDateTime(dr["ParentDob"]).ToString("MM/dd/yyyy");
                        clientProfile.ParentDOB = dr["ParentDob"] == DBNull.Value  ? "" : Convert.ToDateTime(dr["ParentDob"]).ToString("MM/dd/yyyy");
                        clientProfile.Mother    = dr["ParentName"].ToString();
                        clientProfile.Language  = dr["Language"].ToString();
                        int iep  = 0;
                        int ifsp = 0;
                        if (!string.IsNullOrEmpty(dr["IEP"].ToString()))
                        {
                            iep = Convert.ToInt32(dr["IEP"]);
                        }
                        if (!string.IsNullOrEmpty(dr["IFSP"].ToString()))
                        {
                            ifsp = Convert.ToInt32(dr["IFSP"]);
                        }

                        if ((iep == 1) || (ifsp == 1))
                        {
                            clientProfile.IEP = "Yes";
                        }
                        else if ((iep == 0) || (ifsp == 0))
                        {
                            clientProfile.IEP = "No";
                        }
                        else
                        {
                            clientProfile.IEP = "-";
                        }
                        clientProfile.Employed     = dr["Employed"].ToString();
                        clientProfile.BehaviorPlan = dr["BehaviorPlan"].ToString();
                        //clientProfile.StartDate= Convert.ToDateTime(dr["StartDate"]).ToString("MM/dd/yyyy");
                        clientProfile.StartDate        = dr["StartDate"].ToString();
                        clientProfile.TotalEnrolled    = string.IsNullOrEmpty(dr["TotalEnrollment"].ToString())?0:Convert.ToInt32(dr["TotalEnrollment"]);
                        clientProfile.Profilepic       = dr["ProfilePicture"].ToString() == "" ? "" : Convert.ToBase64String((byte[])dr["ProfilePicture"]);
                        clientProfile.IsPregnantMother = string.IsNullOrEmpty(dr["PregnantMother"].ToString()) ? false : (Convert.ToInt32(dr["PregnantMother"]) == 1) ? true : false;
                    }
                }
                if ((_dataset.Tables[1] != null) && (_dataset.Tables[1].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[1].Rows)
                    {
                        clientProfile.MissingScreenings = (dr["MissingScreening"].ToString().ToLower() == "yes")?"Yes":"No";
                    }
                }
                //if ((_dataset.Tables[2] != null) && (_dataset.Tables[2].Rows.Count > 0))
                //{
                //    foreach (DataRow dr in _dataset.Tables[2].Rows)
                //    {
                //        clientProfile.LastdateofCasenote =(string.IsNullOrEmpty(dr["LastCaseNote"].ToString())) ?"": Convert.ToDateTime( dr["LastCaseNote"]).ToString("MM/dd/yyyy");
                //    }
                //}
                if ((_dataset.Tables[2] != null) && (_dataset.Tables[2].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[2].Rows)
                    {
                        clientProfile.Address += (string.IsNullOrEmpty(dr["Street"].ToString())) ? "" : dr["Street"].ToString().ToLower() + "+";
                        clientProfile.Address += (string.IsNullOrEmpty(dr["StreetName"].ToString())) ? "" : dr["StreetName"].ToString().ToLower() + ", ";
                        // clientProfile.Address+= (string.IsNullOrEmpty(dr["ApartmentNo"].ToString())) ? "+" : dr["ApartmentNo"].ToString().ToLower()+ "+";

                        clientProfile.Address += (string.IsNullOrEmpty(dr["City"].ToString())) ? "" : dr["City"].ToString().ToLower() + ", ";
                        // clientProfile.Address += (string.IsNullOrEmpty(dr["County"].ToString())) ? "" : dr["County"].ToString() + "+";

                        clientProfile.Address += (string.IsNullOrEmpty(dr["State"].ToString())) ? "" : dr["State"].ToString().ToUpper() + " ";
                        clientProfile.Address += (string.IsNullOrEmpty(dr["Zipcode"].ToString())) ? "" : dr["Zipcode"].ToString().ToLower();

                        clientProfile.Address.Trim().ToLower();


                        // clientProfile.Address = dr["StreetName"].ToString() + "," + dr["City"].ToString() + "," + dr["State"].ToString() + "," + dr["Zipcode"].ToString();
                    }
                }
                if ((_dataset.Tables[3] != null) && (_dataset.Tables[3].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[3].Rows)
                    {
                        clientProfile.Trimester = dr["Trimester"].ToString();
                    }
                }

                if ((_dataset.Tables[4] != null) && (_dataset.Tables[4].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[4].Rows)
                    {
                        clientProfile.TotalCasenote      = string.IsNullOrEmpty(dr["TotalCaseNoteWritten"].ToString())?"0": dr["TotalCaseNoteWritten"].ToString();
                        clientProfile.LastdateofCasenote = string.IsNullOrEmpty(dr["LastCaseNote"].ToString())?"-": Convert.ToDateTime(dr["LastCaseNote"]).ToString("MM/dd/yyyy");
                    }
                }
                if ((_dataset.Tables[6] != null) && (_dataset.Tables[6].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[6].Rows)
                    {
                        clientProfile.TransferRequested = dr["TransferRequested"].ToString();
                    }
                }


                if ((_dataset.Tables[7] != null) && (_dataset.Tables[7].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[7].Rows)
                    {
                        clientProfile.Parent = dr["ParentType"].ToString();
                    }
                }

                if ((_dataset.Tables[8] != null) && (_dataset.Tables[8].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[8].Rows)
                    {
                        clientProfile.ParentMaleName    = dr["FatherName"].ToString();
                        clientProfile.FatherDOB         = (dr["FatherDOB"].ToString() == "") ? "" : Convert.ToDateTime(dr["FatherDOB"]).ToString("MM/dd/yyyy");
                        clientProfile.FatherIsEmployed  = dr["FatherIsEmployed"].ToString();
                        clientProfile.FatherJobTraining = dr["FatherJobTraining"].ToString();
                    }
                }

                if ((_dataset.Tables[9] != null) && (_dataset.Tables[9].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[9].Rows)
                    {
                        clientProfile.ParenFemaleName   = dr["MotherName"].ToString();
                        clientProfile.MotherDOB         = (dr["MotherDob"].ToString() == "") ? "" : Convert.ToDateTime(dr["MotherDob"]).ToString("MM/dd/yyyy");
                        clientProfile.MotherIsEmployed  = dr["MotherIsEmployed"].ToString();
                        clientProfile.MotherJobTraining = dr["MotherJobTraining"].ToString();
                    }
                }

                if ((_dataset.Tables[10] != null) && (_dataset.Tables[10].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[10].Rows)
                    {
                        clientProfile.Allergies = dr["Allergies"].ToString();
                    }
                }

                if ((_dataset.Tables[11] != null) && (_dataset.Tables[11].Rows.Count > 0))
                {
                    foreach (DataRow dr in _dataset.Tables[11].Rows)
                    {
                        clientProfile.Attendance = Convert.ToDouble(dr["AttendancePercentage"].ToString());
                    }
                }
                ClientprofileList.Add(clientProfile);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            finally
            {
                Connection.Close();
                command.Dispose();
            }
            return(ClientprofileList);
        }