예제 #1
0
        /// <summary>
        /// Action to open client listing page
        /// </summary>
        /// <returns></returns>
        public ActionResult viewclients()
        {
            try
            {
                Client objClient = new Client();

                DataSet ds = objDBGHC_Clients.GHC_Clients_GetAll("dDateAdded", "DESC");

                if (ds != null && ds.Tables[1] != null)
                {
                    List<GHC_ClientsData> sList = new List<GHC_ClientsData>();
                    foreach (DataRow row in ds.Tables[1].Rows)
                    {
                        var nRecord = new GHC_ClientsData();
                        nRecord.nClientID = Methods.doInt(row["nClientID"]);
                        nRecord.dDateOfBirth = (Methods.CorrectDBNull(row["dDateOfBirth"].ToString()) != "") ? (DateTime?)Convert.ToDateTime(Convert.ToDateTime(Methods.CorrectDBNull(row["dDateOfBirth"])).ToShortDateString()) : null;
                        nRecord.sClientName = Methods.CorrectDBNull(row["sClientName"]);
                        nRecord.bGender = Methods.doBoolean(row["bGender"]);
                        nRecord.sSocialSecurityNumber = Methods.CorrectDBNull(row["sSocialSecurityNumber"]);
                        nRecord.sCity = Methods.CorrectDBNull(row["sCity"]);
                        nRecord.sCellPhone = Methods.CorrectDBNull(row["sCellPhone"]);
                        sList.Add(nRecord);
                    }
                    objClient.objGHC_ClientsDataList= sList;

                }
                return View(objClient);
            }
            catch (Exception ex)
            {
                CommonRepository.LogError(sController, "viewclients", ex.ToString());
                Session[Helpers.CommonConstants.Message] = Messages.GetMessage("[Error]");
                Session[Helpers.CommonConstants.MessageType] = "2";
                return RedirectToAction("index", "dashboard");
            }
        }
예제 #2
0
        public ActionResult createclient(Client objClient, FormCollection form)
        {
            try
            {

                GHC_ClientsData objClientUpdate = new GHC_ClientsData();
                var clientRec = new GHC_ClientsData();
                if (!ModelState.IsValid)
                {
                    var sErrors = (from s in ModelState
                                   where s.Value.Errors.Count > 0
                                   select s.Value.Errors).ToList();

                    string sErrorMsg = string.Empty;
                    foreach (var obj in sErrors)
                        obj.ToList().ForEach(a => sErrorMsg += "<br/>" + a.ErrorMessage);

                    Session[Helpers.CommonConstants.Message] = sErrorMsg.Remove(0, 5);
                    Session[Helpers.CommonConstants.MessageType] = "2";

                    return RedirectToAction("createclient");
                }

                int nReturn = 0;
                int nClientId = Methods.doInt(form["hdnClientID"]);
                if (Methods.CorrectDBNull(Request["txtBirthDate"]) != "")
                    objClient.objGHC_ClientsData.dDateOfBirth = Methods.doStringToDate(Request["txtBirthDate"]);

                if (nClientId > 0)
                {
                    // Edit Referral
                    objClientUpdate.nClientID = nClientId;
                    objClientUpdate.dDateOfBirth = Convert.ToDateTime(objClient.objGHC_ClientsData.dDateOfBirth);
                    objClientUpdate.sClientName = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sClientName);
                    objClientUpdate.sMaritalStatus = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMaritalStatus);
                    objClientUpdate.bGender = Methods.doBoolean(objClient.objGHC_ClientsData.bGender);
                    objClientUpdate.sRace = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sRace);
                    objClientUpdate.sSocialSecurityNumber = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSocialSecurityNumber);
                    objClientUpdate.sAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sAddress);
                    objClientUpdate.sCity = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sCity);
                    objClientUpdate.sState = Methods.doInt(objClient.objGHC_ClientsData.sState);
                    objClientUpdate.sZip = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sZip);
                    objClientUpdate.sClientHomePhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sClientHomePhone);

                    objClientUpdate.sMsgPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMsgPhone);
                    objClientUpdate.sCellPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sCellPhone);
                    objClientUpdate.sSchool = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSchool);
                    objClientUpdate.sGrade = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sGrade);
                    objClientUpdate.sSchoolPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSchoolPhone);
                    objClientUpdate.sEmployer = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sEmployer);
                    objClientUpdate.sOccuption = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sOccuption);
                    objClientUpdate.sClientWorkPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sClientWorkPhone);
                    objClientUpdate.sMotherName = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMotherName);

                    objClientUpdate.sMotherAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMotherAddress);
                    objClientUpdate.sMotherPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMotherPhone);
                    objClientUpdate.sMotherCity = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMotherCity);
                    objClientUpdate.sMotherState = Methods.doInt(objClient.objGHC_ClientsData.sMotherState);
                    objClientUpdate.sMotherZipcode = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sMotherZipcode);
                    objClientUpdate.sFatherName = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFatherName);
                    objClientUpdate.sFatherPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFatherPhone);
                    objClientUpdate.sFatherAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFatherAddress);
                    objClientUpdate.sFatherCity = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFatherCity);
                    objClientUpdate.sFatherZipcode = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFatherZipcode);
                    objClientUpdate.sFatherState = Methods.doInt(objClient.objGHC_ClientsData.sFatherState);

                    objClientUpdate.sFosterParentsName = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFosterParentsName);
                    objClientUpdate.sFosterParentsPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFosterParentsPhone);
                    objClientUpdate.sFosterParentsAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFosterParentsAddress);
                    objClientUpdate.sFosterParentsState = Methods.doInt(objClient.objGHC_ClientsData.sFosterParentsState);
                    objClientUpdate.sFosterParentsCity = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFosterParentsCity);
                    objClientUpdate.sFosterParentsZipcode = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFosterParentsZipcode);
                    objClientUpdate.sCaseWorker = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sCaseWorker);
                    objClientUpdate.sCaseWorkerPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sCaseWorkerPhone);
                    objClientUpdate.sProbationOfficer = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sProbationOfficer);
                    objClientUpdate.sProbationOfficerPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sProbationOfficerPhone);
                    objClientUpdate.sProbationInformation = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sProbationInformation);

                    objClientUpdate.sEmergencyContact = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sEmergencyContact);
                    objClientUpdate.sHomePhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sHomePhone);
                    objClientUpdate.sRelationShipToPatient = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sRelationShipToPatient);
                    objClientUpdate.sWorkPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sWorkPhone);
                    objClientUpdate.sFamilyPhysician = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFamilyPhysician);
                    objClientUpdate.sFamilyPhysicianPhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFamilyPhysicianPhone);
                    objClientUpdate.sReferredBy = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sReferredBy);
                    objClientUpdate.sFinacialResponsibleForPayment = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sFinacialResponsibleForPayment);
                    objClientUpdate.sPayby = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPayby);
                    objClientUpdate.sOther = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sOther);
                    objClientUpdate.sPrimaryInsurance = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPrimaryInsurance);
                    objClientUpdate.sPrimaryInsurancePhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPrimaryInsurancePhone);

                    objClientUpdate.sPrimaryInsuranceAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPrimaryInsuranceAddress);
                    objClientUpdate.sPrimaryInsurancePolicyHolder = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPrimaryInsurancePolicyHolder);
                    objClientUpdate.sPrimaryInsuranceID = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sPrimaryInsuranceID);
                    objClientUpdate.sSecondaryInsurance = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSecondaryInsurance);
                    objClientUpdate.sSecondaryInsurancePhone = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSecondaryInsurancePhone);
                    objClientUpdate.sSecondaryInsuranceAddress = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSecondaryInsuranceAddress);
                    objClientUpdate.sSecondaryInsurancePolicyHolder = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSecondaryInsurancePolicyHolder);
                    objClientUpdate.sSecondaryInsuranceID = Methods.CorrectDBNull(objClient.objGHC_ClientsData.sSecondaryInsuranceID);
                    objClientUpdate.dDateModified = DateTime.Now;
                    objClientUpdate.nModifiedBy = Methods.nUserID;

                    nReturn = objDBGHC_Clients.GHC_Clients_Update(objClientUpdate);

                    if (nReturn > 1)
                    {
                        Session[Helpers.CommonConstants.Message] = Messages.GetMessage("[Update]", "Client");
                        Session[Helpers.CommonConstants.MessageType] = "1";
                        return RedirectToAction("viewclients");
                    }
                    else
                    {
                        throw new Exception();
                    }
                }

                return RedirectToAction("createclient", new { @id = Methods.base64Encode(nClientId.ToString()) });
            }
            catch (Exception ex)
            {
                CommonRepository.LogError(sController, "createreferral", ex.ToString());
                Session[Helpers.CommonConstants.Message] = Messages.GetMessage("[Error]");
                Session[Helpers.CommonConstants.MessageType] = "2";
                return RedirectToAction("viewclients");
            }
        }
예제 #3
0
        /// <summary>
        /// Action to open client in edit mode
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult createclient(string id = "0")
        {
            try
            {
                Client objClientinfo = new Client();
                int nClientId = Methods.doInt(Methods.base64Decode(id));
                string sSQL = "Select * from GHC_Clients where nClientID = " + nClientId + " ";
                DataRow dr = DBMethods.GetInfoById(sSQL);
                var clientRec = new GHC_ClientsData();
                if (dr != null)
                {

                    clientRec.nClientID = Methods.doInt(dr["nClientID"]);
                    clientRec.sClientName = Methods.CorrectDBNull(dr["sClientName"]);
                    clientRec.dDateOfBirth = (Methods.CorrectDBNull(dr["dDateOfBirth"].ToString()) != "") ? (DateTime?)Convert.ToDateTime(Convert.ToDateTime(Methods.CorrectDBNull(dr["dDateOfBirth"])).ToShortDateString()) : null; //Convert.ToDateTime(Methods.CorrectDBNull(dr["dDateOfBirth"]));
                    clientRec.sMaritalStatus = Methods.CorrectDBNull(dr["sMaritalStatus"]);
                    clientRec.bGender = Methods.doBoolean(dr["bGender"]);
                    clientRec.sRace = Methods.CorrectDBNull(dr["sRace"]);
                    clientRec.sSocialSecurityNumber = Methods.CorrectDBNull(dr["sSocialSecurityNumber"]);
                    clientRec.sAddress = Methods.CorrectDBNull(dr["sAddress"]);
                    clientRec.sCity = Methods.CorrectDBNull(dr["sCity"]);
                    clientRec.sState = Methods.doInt(dr["sState"]);
                    clientRec.sZip = Methods.CorrectDBNull(dr["sZip"]);
                    clientRec.sClientHomePhone = Methods.CorrectDBNull(dr["sClientHomePhone"]);
                    clientRec.sMsgPhone = Methods.CorrectDBNull(dr["sMsgPhone"]);
                    clientRec.sCellPhone = Methods.CorrectDBNull(dr["sCellPhone"]);
                    clientRec.sSchool = Methods.CorrectDBNull(dr["sSchool"]);
                    clientRec.sGrade = Methods.CorrectDBNull(dr["sGrade"]);
                    clientRec.sSchoolPhone = Methods.CorrectDBNull(dr["sSchoolPhone"]);
                    clientRec.sEmployer = Methods.CorrectDBNull(dr["sEmployer"]);
                    clientRec.sOccuption = Methods.CorrectDBNull(dr["sOccuption"]);
                    clientRec.sClientWorkPhone = Methods.CorrectDBNull(dr["sClientWorkPhone"]);
                    clientRec.sMotherName = Methods.CorrectDBNull(dr["sMotherName"]);
                    clientRec.sMotherPhone = Methods.CorrectDBNull(dr["sMotherPhone"]);
                    clientRec.sMotherAddress = Methods.CorrectDBNull(dr["sMotherAddress"]);
                    clientRec.sMotherCity = Methods.CorrectDBNull(dr["sMotherCity"]);
                    clientRec.sMotherState = Methods.doInt(dr["sMotherState"]);
                    clientRec.sMotherZipcode = Methods.CorrectDBNull(dr["sMotherZipcode"]);

                    clientRec.sFatherName = Methods.CorrectDBNull(dr["sFatherName"]);
                    clientRec.sFatherPhone = Methods.CorrectDBNull(dr["sFatherPhone"]);
                    clientRec.sFatherAddress = Methods.CorrectDBNull(dr["sFatherAddress"]);
                    clientRec.sFatherCity = Methods.CorrectDBNull(dr["sFatherCity"]);
                    clientRec.sFatherState = Methods.doInt(dr["sFatherState"]);
                    clientRec.sFatherZipcode = Methods.CorrectDBNull(dr["sFatherZipcode"]);

                    clientRec.sFosterParentsName = Methods.CorrectDBNull(dr["sFosterParentsName"]);
                    clientRec.sFosterParentsPhone = Methods.CorrectDBNull(dr["sFosterParentsPhone"]);
                    clientRec.sFosterParentsAddress = Methods.CorrectDBNull(dr["sFosterParentsAddress"]);
                    clientRec.sFosterParentsCity = Methods.CorrectDBNull(dr["sFosterParentsCity"]);
                    clientRec.sFosterParentsState = Methods.doInt(dr["sFosterParentsState"]);
                    clientRec.sFosterParentsZipcode = Methods.CorrectDBNull(dr["sFosterParentsZipcode"]);

                    clientRec.sCaseWorker = Methods.CorrectDBNull(dr["sCaseWorker"]);
                    clientRec.sCaseWorkerPhone = Methods.CorrectDBNull(dr["sCaseWorkerPhone"]);
                    clientRec.bIsClientOnProbation = Methods.doBoolean(dr["bIsClientOnProbation"]);
                    clientRec.sProbationOfficer = Methods.CorrectDBNull(dr["sProbationOfficer"]);
                    clientRec.sProbationOfficerPhone = Methods.CorrectDBNull(dr["sProbationOfficerPhone"]);
                    clientRec.sProbationInformation = Methods.CorrectDBNull(dr["sProbationInformation"]);
                    clientRec.sEmergencyContact = Methods.CorrectDBNull(dr["sEmergencyContact"]);
                    clientRec.sHomePhone = Methods.CorrectDBNull(dr["sHomePhone"]);
                    clientRec.sRelationShipToPatient = Methods.CorrectDBNull(dr["sRelationShipToPatient"]);

                    clientRec.sWorkPhone = Methods.CorrectDBNull(dr["sWorkPhone"]);
                    clientRec.sFamilyPhysician = Methods.CorrectDBNull(dr["sFamilyPhysician"]);
                    clientRec.sFamilyPhysicianPhone = Methods.CorrectDBNull(dr["sFamilyPhysicianPhone"]);
                    clientRec.sReferredBy = Methods.CorrectDBNull(dr["sReferredBy"]);
                    clientRec.sFinacialResponsibleForPayment = Methods.CorrectDBNull(dr["sFinacialResponsibleForPayment"]);
                    clientRec.sPayby = Methods.CorrectDBNull(dr["sPayby"]);
                    clientRec.sOther = Methods.CorrectDBNull(dr["sOther"]);
                    clientRec.sPrimaryInsurance = Methods.CorrectDBNull(dr["sPrimaryInsurance"]);
                    clientRec.sPrimaryInsurancePhone = Methods.CorrectDBNull(dr["sPrimaryInsurancePhone"]);

                    clientRec.sPrimaryInsuranceAddress = Methods.CorrectDBNull(dr["sPrimaryInsuranceAddress"]);
                    clientRec.sPrimaryInsurancePolicyHolder = Methods.CorrectDBNull(dr["sPrimaryInsurancePolicyHolder"]);
                    clientRec.sPrimaryInsuranceID = Methods.CorrectDBNull(dr["sPrimaryInsuranceID"]);
                    clientRec.sSecondaryInsurance = Methods.CorrectDBNull(dr["sSecondaryInsurance"]);
                    clientRec.sSecondaryInsurancePhone = Methods.CorrectDBNull(dr["sSecondaryInsurancePhone"]);
                    clientRec.sSecondaryInsuranceAddress = Methods.CorrectDBNull(dr["sSecondaryInsuranceAddress"]);
                    clientRec.sSecondaryInsurancePolicyHolder = Methods.CorrectDBNull(dr["sSecondaryInsurancePolicyHolder"]);
                    clientRec.sSecondaryInsuranceID = Methods.CorrectDBNull(dr["sSecondaryInsuranceID"]);
                }
                objClientinfo.objGHC_ClientsData = clientRec;
                return View(objClientinfo);
            }
            catch (Exception ex)
            {
                CommonRepository.LogError(sController, "createclient", ex.ToString());
                Session[Helpers.CommonConstants.Message] = Messages.GetMessage("[Error]");
                Session[Helpers.CommonConstants.MessageType] = "2";
                return RedirectToAction("viewclients");
            }
        }
예제 #4
0
 public int GHC_Clients_Update(GHC_ClientsData ObjGHC_ClientsData)
 {
     int rowsAffected = 0;
       SqlConnection connection = null;
       try
       {
       connection = (SqlConnection)new DBConnect().ConnectionObject;
       SqlCommand Command = new SqlCommand("GHC_GHC_Clients_Update", connection);
       Command.CommandType = CommandType.StoredProcedure;
       Command.Parameters.AddWithValue("@nClientID", ObjGHC_ClientsData.nClientID);
       Command.Parameters.AddWithValue("@sClientName",ObjGHC_ClientsData.sClientName);
       Command.Parameters.AddWithValue("@dDateOfBirth",ObjGHC_ClientsData.dDateOfBirth);
       Command.Parameters.AddWithValue("@sMaritalStatus",ObjGHC_ClientsData.sMaritalStatus);
       Command.Parameters.AddWithValue("@bGender",ObjGHC_ClientsData.bGender);
       Command.Parameters.AddWithValue("@sRace",ObjGHC_ClientsData.sRace);
       Command.Parameters.AddWithValue("@sSocialSecurityNumber",ObjGHC_ClientsData.sSocialSecurityNumber);
       Command.Parameters.AddWithValue("@sAddress",ObjGHC_ClientsData.sAddress);
       Command.Parameters.AddWithValue("@sCity",ObjGHC_ClientsData.sCity);
       Command.Parameters.AddWithValue("@sState",ObjGHC_ClientsData.sState);
       Command.Parameters.AddWithValue("@sZip",ObjGHC_ClientsData.sZip);
       Command.Parameters.AddWithValue("@sClientHomePhone",ObjGHC_ClientsData.sClientHomePhone);
       Command.Parameters.AddWithValue("@sMsgPhone",ObjGHC_ClientsData.sMsgPhone);
       Command.Parameters.AddWithValue("@sCellPhone",ObjGHC_ClientsData.sCellPhone);
       Command.Parameters.AddWithValue("@sSchool",ObjGHC_ClientsData.sSchool);
       Command.Parameters.AddWithValue("@sGrade",ObjGHC_ClientsData.sGrade);
       Command.Parameters.AddWithValue("@sSchoolPhone",ObjGHC_ClientsData.sSchoolPhone);
       Command.Parameters.AddWithValue("@sEmployer",ObjGHC_ClientsData.sEmployer);
       Command.Parameters.AddWithValue("@sOccuption",ObjGHC_ClientsData.sOccuption);
       Command.Parameters.AddWithValue("@sClientWorkPhone",ObjGHC_ClientsData.sClientWorkPhone);
       Command.Parameters.AddWithValue("@sMotherName",ObjGHC_ClientsData.sMotherName);
       Command.Parameters.AddWithValue("@sMotherPhone",ObjGHC_ClientsData.sMotherPhone);
       Command.Parameters.AddWithValue("@sMotherAddress",ObjGHC_ClientsData.sMotherAddress);
       Command.Parameters.AddWithValue("@sMotherCity",ObjGHC_ClientsData.sMotherCity);
       Command.Parameters.AddWithValue("@sMotherState",ObjGHC_ClientsData.sMotherState);
       Command.Parameters.AddWithValue("@sMotherZipcode",ObjGHC_ClientsData.sMotherZipcode);
       Command.Parameters.AddWithValue("@sFatherName",ObjGHC_ClientsData.sFatherName);
       Command.Parameters.AddWithValue("@sFatherPhone",ObjGHC_ClientsData.sFatherPhone);
       Command.Parameters.AddWithValue("@sFatherAddress",ObjGHC_ClientsData.sFatherAddress);
       Command.Parameters.AddWithValue("@sFatherCity",ObjGHC_ClientsData.sFatherCity);
       Command.Parameters.AddWithValue("@sFatherState",ObjGHC_ClientsData.sFatherState);
       Command.Parameters.AddWithValue("@sFatherZipcode",ObjGHC_ClientsData.sFatherZipcode);
       Command.Parameters.AddWithValue("@sFosterParentsName",ObjGHC_ClientsData.sFosterParentsName);
       Command.Parameters.AddWithValue("@sFosterParentsPhone",ObjGHC_ClientsData.sFosterParentsPhone);
       Command.Parameters.AddWithValue("@sFosterParentsAddress",ObjGHC_ClientsData.sFosterParentsAddress);
       Command.Parameters.AddWithValue("@sFosterParentsCity",ObjGHC_ClientsData.sFosterParentsCity);
       Command.Parameters.AddWithValue("@sFosterParentsState",ObjGHC_ClientsData.sFosterParentsState);
       Command.Parameters.AddWithValue("@sFosterParentsZipcode",ObjGHC_ClientsData.sFosterParentsZipcode);
       Command.Parameters.AddWithValue("@sCaseWorker",ObjGHC_ClientsData.sCaseWorker);
       Command.Parameters.AddWithValue("@sCaseWorkerPhone",ObjGHC_ClientsData.sCaseWorkerPhone);
       Command.Parameters.AddWithValue("@bIsClientOnProbation",ObjGHC_ClientsData.bIsClientOnProbation);
       Command.Parameters.AddWithValue("@sProbationOfficer",ObjGHC_ClientsData.sProbationOfficer);
       Command.Parameters.AddWithValue("@sProbationOfficerPhone",ObjGHC_ClientsData.sProbationOfficerPhone);
       Command.Parameters.AddWithValue("@sProbationInformation",ObjGHC_ClientsData.sProbationInformation);
       Command.Parameters.AddWithValue("@sEmergencyContact",ObjGHC_ClientsData.sEmergencyContact);
       Command.Parameters.AddWithValue("@sHomePhone",ObjGHC_ClientsData.sHomePhone);
       Command.Parameters.AddWithValue("@sRelationShipToPatient",ObjGHC_ClientsData.sRelationShipToPatient);
       Command.Parameters.AddWithValue("@sWorkPhone",ObjGHC_ClientsData.sWorkPhone);
       Command.Parameters.AddWithValue("@sFamilyPhysician",ObjGHC_ClientsData.sFamilyPhysician);
       Command.Parameters.AddWithValue("@sFamilyPhysicianPhone",ObjGHC_ClientsData.sFamilyPhysicianPhone);
       Command.Parameters.AddWithValue("@sReferredBy",ObjGHC_ClientsData.sReferredBy);
       Command.Parameters.AddWithValue("@sFinacialResponsibleForPayment",ObjGHC_ClientsData.sFinacialResponsibleForPayment);
       Command.Parameters.AddWithValue("@sPayby",ObjGHC_ClientsData.sPayby);
       Command.Parameters.AddWithValue("@sOther",ObjGHC_ClientsData.sOther);
       Command.Parameters.AddWithValue("@sPrimaryInsurance",ObjGHC_ClientsData.sPrimaryInsurance);
       Command.Parameters.AddWithValue("@sPrimaryInsurancePhone",ObjGHC_ClientsData.sPrimaryInsurancePhone);
       Command.Parameters.AddWithValue("@sPrimaryInsuranceAddress",ObjGHC_ClientsData.sPrimaryInsuranceAddress);
       Command.Parameters.AddWithValue("@sPrimaryInsurancePolicyHolder",ObjGHC_ClientsData.sPrimaryInsurancePolicyHolder);
       Command.Parameters.AddWithValue("@sPrimaryInsuranceID",ObjGHC_ClientsData.sPrimaryInsuranceID);
       Command.Parameters.AddWithValue("@sSecondaryInsurance",ObjGHC_ClientsData.sSecondaryInsurance);
       Command.Parameters.AddWithValue("@sSecondaryInsurancePhone",ObjGHC_ClientsData.sSecondaryInsurancePhone);
       Command.Parameters.AddWithValue("@sSecondaryInsuranceAddress",ObjGHC_ClientsData.sSecondaryInsuranceAddress);
       Command.Parameters.AddWithValue("@sSecondaryInsurancePolicyHolder",ObjGHC_ClientsData.sSecondaryInsurancePolicyHolder);
       Command.Parameters.AddWithValue("@sSecondaryInsuranceID",ObjGHC_ClientsData.sSecondaryInsuranceID);
       Command.Parameters.AddWithValue("@dDateModified",ObjGHC_ClientsData.dDateModified);
       Command.Parameters.AddWithValue("@nModifiedBy",ObjGHC_ClientsData.nModifiedBy);
       SqlParameter returnValueParam = new SqlParameter("@RETURN_VALUE", SqlDbType.Int);
       returnValueParam.Direction = ParameterDirection.ReturnValue;
       Command.Parameters.Add(returnValueParam);
       connection.Open();
       Command.ExecuteNonQuery();
       rowsAffected = Convert.ToInt32(returnValueParam.Value);
       }
       catch
       {
       rowsAffected = 0;
       }
       finally
       {
       if (connection != null)
        connection.Close();
       connection.Dispose();
       }
       return rowsAffected;
 }