Esempio n. 1
0
 private void Start()
 {
     // get the components on the object we need ( should not be null due to require component so no need to check )
     agent              = GetComponentInChildren <NavMeshAgent>();
     character          = GetComponent <ThirdPersonCharacter>();
     residentController = gameObject.GetComponent <Resident> ();
     monthManager       = GameObject.Find("Clock").GetComponent <MonthManager> ();
     criminalController = gameObject.GetComponent <Criminal> ();
     rm = GameObject.Find("ResidentManager").GetComponent <ResidentManager> ();
     //Randomizes the walk speed for residents!
     if (isServer)
     {
         if (criminalController == null)
         {
             GetResidentPoints(monthManager.isDay);      //Sets resident movement locations
             agent.speed = 0.5f;                         //Sets resident speed
         }
         else
         {
             GoCommitCrime();                          //Get Crime Waypoints
             agent.speed = 0.8f;                       //Make criminal walk faster
         }
         agent.updateRotation = false;
         agent.updatePosition = true;
     }
 }
    protected void lbDelete_Click(object sender, EventArgs e)
    {
        ImageButton linkButton = new ImageButton();

        linkButton = (ImageButton)sender;
        bool result = ResidentManager.DeleteResident(Convert.ToInt32(linkButton.CommandArgument));

        showResidentGrid();
    }
Esempio n. 3
0
    private void laodResitentInfo()
    {
        Resident resident = ResidentManager.GetResidentByID(int.Parse(Request.QueryString["ResidentID"]));

        lblAdmittedFrom.Text    = resident.AdmissionFrom;
        lblPrimaryLanguage.Text = resident.ExtraField8;
        lblPhysicianName.Text   = resident.AttendingPhysician;
        lblResidentName.Text    = resident.Name;
        lblProperty.Text        = resident.ExtraField7;
    }
    private void loadResident()
    {
        ListItem li = new ListItem("Select Resident...", "0");

        ddlResident.Items.Add(li);

        List <Resident> residents = new List <Resident>();

        residents = ResidentManager.GetAllResidents();
        foreach (Resident resident in residents)
        {
            ListItem item = new ListItem(resident.ResidentName.ToString(), resident.ResidentID.ToString());
            ddlResident.Items.Add(item);
        }
    }
Esempio n. 5
0
 private void laodResitentInfo()
 {
     try
     {
         Resident resident = ResidentManager.GetResidentByID(int.Parse(Request.QueryString["ResidentID"]));
         lblAdmittedFrom.Text       = resident.AdmissionFrom;
         lblPharmacyPreference.Text = resident.PharmacyPreference + (resident.PharmacyPreferenceTelephone != ""? (", " + resident.PharmacyPreferenceTelephone):"");
         lblPhysicianName.Text      = resident.AttendingPhysician;
         lblResidentName.Text       = resident.Name;
         lblProperty.Text           = resident.ExtraField7;
         lblCompnayName.Text        = resident.ExtraField9;
         lblAllergy.Text            = resident.ExtraField11;
     }
     catch (Exception ex)
     {}
 }
    protected void ddlPropertyID_SelectedIndexChanged(object sender, EventArgs e)
    {
        string searchString = "Where 1=1 " + (ddlStatus.SelectedValue == "All" ? "" : "and AL_Resident.ExtraField10='" + ddlStatus.SelectedValue + "'");

        if (ddlPropertyID.SelectedIndex != 0)
        {
            searchString += " And AL_Resident.ExtraField1 = " + ddlPropertyID.SelectedValue;
        }
        searchString += " order by AL_Property.PropertyID, AL_Resident.Name";

        List <Resident> searchResult = new List <Resident>();

        searchResult = ResidentManager.SearchResidents(searchString);

        lblCount.Text = " (" + searchResult.Count.ToString() + ") ";
        LinkPermissionChecking(searchResult);
        gvResident.DataSource = searchResult;
        gvResident.DataBind();
        LoadGridColor();
    }
    private void showResidentGrid()
    {
        string searchString = "Where " + (ddlStatus.SelectedValue == "All" ? "" : "AL_Resident.ExtraField10='" + ddlStatus.SelectedValue + "' and") + " AL_Resident.ExtraField1 in ('0" + (getLogin().ExtraField3 == "" ? "" : "','" + getLogin().ExtraField3.Replace(",", "','")) + "')";

        if (Request.QueryString["SearchKey"] != null && hfHasSearchDone.Value == "0")
        {
            hfHasSearchDone.Value = "1";
            searchString         += " and AL_Resident.Address  like '%" + Request.QueryString["SearchKey"] + "%' or  AL_Resident.Name like '%" + Request.QueryString["SearchKey"] + "%' ";
        }
        searchString += " order by AL_Property.PropertyID, AL_Resident.Name";

        List <Resident> searchResult = new List <Resident>();

        searchResult = ResidentManager.SearchResidents(searchString);

        lblCount.Text = " (" + searchResult.Count.ToString() + ") ";
        LinkPermissionChecking(searchResult);
        gvResident.DataSource = searchResult;
        gvResident.DataBind();
        LoadGridColor();
    }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        if (managerTraits.Count == 0)
        {
            initializeManagerTraits();
        }
        if (residentTraits.Count == 0)
        {
            initializeTraits();
        }
        if (factoryTraits.Count == 0)
        {
            initializeFactoryTraits();
        }

        if (rm == null)
        {
            rm = FindObjectOfType <ResidentManager> ();
        }
        jobBuilding       = getBuilding(job);
        residenceBuilding = getBuilding(residence);
        monthsHomeless    = 0;
        monthsJobless     = 0;
        if (isServer)
        {
            if (lowlife)               // lowLife is set by the ResidentManager when it spawns new residents
            {
                generateLowlife();
            }
            else
            {
                generatePerson();
            }
            spendingMoney = spendingBudget[skill];
        }
        advanceMonth();
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        colorsOn = false;
        ui       = GameObject.Find("Canvas").GetComponent <CanvasManager> ();
        objects  = GameObject.FindObjectsOfType <OwnableObject> ();
        rm       = GameObject.FindObjectOfType <ResidentManager> ();
        isDay    = true;

        //Sets values to control the sun
        turnTime       = MONTH_LENGTH;
        dayCycleLength = TURNS_UNTIL_NIGHT;
        if (isServer)
        {
            sunController = GameObject.FindObjectOfType <SunController> ();
            sunController.dayRotateSpeed.x   = (-(360 / (turnTime * dayCycleLength))) / 2;
            sunController.nightRotateSpeed.x = (-(360 / (turnTime * dayCycleLength))) / 2;
            players      = GameObject.FindObjectsOfType <Player> ();
            time         = 0;
            monthsPassed = 1;
            foreach (OwnableObject o in objects)
            {
                //Gets rents of all buildings of a type
                if (o is Building)
                {
                    Building building = o.GetComponent <Building> ();
                    if (dictRent.ContainsKey(building.type))
                    {
                        dictRent [building.type] += building.rent;
                    }
                    else
                    {
                        dictRent.Add(building.type, building.rent);
                    }

                    //Gets condition for all buildings of a type
                    if (dictCondition.ContainsKey(building.type))
                    {
                        dictCondition [building.type] += building.condition;
                    }
                    else
                    {
                        dictCondition.Add(building.type, building.condition);
                    }

                    //Gets safety for all buildings of a type
                    if (dictSafety.ContainsKey(building.type))
                    {
                        dictSafety [building.type] += building.safety;
                    }
                    else
                    {
                        dictSafety.Add(building.type, building.safety);
                    }

                    //Gets a dictionary of number of buildings of each type
                    if (dictNumberOfType.ContainsKey(building.type))
                    {
                        dictNumberOfType [building.type] += 1;
                    }
                    else
                    {
                        dictNumberOfType.Add(building.type, 1);
                    }
                }
            }
        }
    }
Esempio n. 10
0
    private void laodResitentInfo()
    {
        Resident resident = ResidentManager.GetResidentByID(int.Parse(Request.QueryString["ResidentID"]));

        txtPhysician.Text = resident.AttendingPhysician;
    }
Esempio n. 11
0
 public ResidentController()
 {
     this.residentManager = new ResidentManager();
     this.postManager     = new PostManager();
 }
    private void showResidentData()
    {
        Resident resident = new Resident();

        resident = ResidentManager.GetResidentByID(Int32.Parse(Request.QueryString["residentID"]));

        txtName.Text                                  = resident.Name;
        txtAdmissionDate.Text                         = CheckNullDate(resident.AdmissionDate);//.ToString("dd MMM yyyy");
        txtAdmissionFrom.Text                         = resident.AdmissionFrom;
        txtUsualOccupation.Text                       = resident.UsualOccupation;
        txtPlaceOfBirth.Text                          = resident.PlaceOfBirth;
        txtUsualAddress.Text                          = resident.UsualAddress;
        txtTelephone.Text                             = resident.Telephone;
        txtRace.Text                                  = resident.Race;
        txtAge.Text                                   = resident.Age.ToString();
        txtDateOfBirth.Text                           = CheckNullDate(resident.DateOfBirth);//.ToString("dd MMM yyyy");
        txtSex.Text                                   = resident.Sex;
        txtMaritalStatus.Text                         = resident.MaritalStatus;
        txtHeight.Text                                = resident.Height;
        txtWeight.Text                                = resident.Weight;
        txtReligion.Text                              = resident.Religion;
        txtClergyman.Text                             = resident.Clergyman;
        txtChurchSynagogue.Text                       = resident.ChurchSynagogue;
        txtChurchSynagogueTelephone.Text              = resident.ChurchSynagogueTelephone;
        txtAddress.Text                               = resident.Address;
        txtAddressTelephone.Text                      = resident.AddressTelephone;
        txtSocialSecurity.Text                        = resident.SocialSecurity;
        txtMedicare.Text                              = resident.Medicare;
        txtMedicaid.Text                              = resident.Medicaid;
        txtInsurance.Text                             = resident.Insurance;
        txtInsuranceAddress.Text                      = resident.InsuranceAddress;
        txtInsuranceAddressTelephone.Text             = resident.InsuranceAddressTelephone;
        txtPolicy.Text                                = resident.Policy;
        txtInsuranceGroup.Text                        = resident.InsuranceGroup;
        txtInsuranceGroupNo.Text                      = resident.InsuranceGroupNo;
        txtResponsibleParty.Text                      = resident.ResponsibleParty;
        txtResponsiblePartyRelationship.Text          = resident.ResponsiblePartyRelationship;
        txtResponsiblePartyAddress.Text               = resident.ResponsiblePartyAddress;
        txtResponsiblePartyTelephone.Text             = resident.ResponsiblePartyTelephone;
        txtPowerOfAttorney.Text                       = resident.PowerOfAttorney;
        txtPowerOfAttorneyAddress.Text                = resident.PowerOfAttorneyAddress;
        txtPowerOfAttorneyRelationship.Text           = resident.PowerOfAttorneyRelationship;
        txtPowerOfAttorneyTelephone.Text              = resident.PowerOfAttorneyTelephone;
        txtNearestRelativeOrGuardian.Text             = resident.NearestRelativeOrGuardian;
        txtNearestRelativeOrGuardianRelationship.Text = resident.NearestRelativeOrGuardianRelationship;
        txtNearestRelativeOrGuardianAddress.Text      = resident.NearestRelativeOrGuardianAddress;
        txtNearestRelativeOrGuardianTelephone.Text    = resident.NearestRelativeOrGuardianTelephone;
        txtNotifyInCaseOfEmergency.Text               = resident.NotifyInCaseOfEmergency;
        txtNotifyInCaseOfEmergencyRelationship.Text   = resident.NotifyInCaseOfEmergencyRelationship;
        txtNotifyInCaseOfEmergencyAddress.Text        = resident.NotifyInCaseOfEmergencyAddress;
        txtNotifyInCaseOfEmergencyTelephone.Text      = resident.NotifyInCaseOfEmergencyTelephone;
        txtHospitalPreference.Text                    = resident.HospitalPreference;
        txtHospitalPreferenceTelephone.Text           = resident.HospitalPreferenceTelephone;
        txtHospitalPreferenceEmail.Text               = resident.HospitalPreferenceEmail;
        txtFuneralHomePreference.Text                 = resident.FuneralHomePreference;
        txtFuneralHomePreferenceTelephone.Text        = resident.FuneralHomePreferenceTelephone;
        txtPharmacyPreference.Text                    = resident.PharmacyPreference;
        txtPharmacyPreferenceTelephone.Text           = resident.PharmacyPreferenceTelephone;
        txtDentist.Text                               = resident.Dentist;
        txtDentistTelephone.Text                      = resident.DentistTelephone;
        txtAttendingPhysician.Text                    = resident.AttendingPhysician;
        txtAttendingPhysicianAddress.Text             = resident.AttendingPhysicianAddress;
        txtAttendingPhysicianTelephone.Text           = resident.AttendingPhysicianTelephone;
        txtAlternatePhysician.Text                    = resident.AlternatePhysician;
        txtAlternatePhysicianAddress.Text             = resident.AlternatePhysicianAddress;
        txtAlternatePhysicianTelephone.Text           = resident.AlternatePhysicianTelephone;
        txtDateofLastPhysicalExam.Text                = CheckNullDate(resident.DateofLastPhysicalExam);//.ToString("dd MMM yyyy");
        txtYearlyPhysicalDue.Text                     = resident.YearlyPhysicalDue;
        txtDiagnosis.Text                             = resident.Diagnosis;
        txtAllergies.Text                             = resident.Allergies;
        txtDischargedOrExpiredDate.Text               = CheckNullDate(resident.DischargedOrExpiredDate);//.ToString("dd MMM yyyy");
        txtDischargedOrExpiredReason.Text             = resident.DischargedOrExpiredReason;
        cbIsWithoutMDApproval.Checked                 = resident.IsWithoutMDApproval;
        txtReleasedTo.Text                            = resident.ReleasedTo;
        txtNewAddress.Text                            = resident.NewAddress;
        txtPlaceOfDeathAddressnCitynCountynState.Text = resident.PlaceOfDeathAddressnCitynCountynState;
        txtPrecinctNo.Text                            = resident.PrecinctNo;
        txtMorticianName.Text                         = resident.MorticianName;
        txtSignature.Text                             = resident.Signature;
        ddlPropertyID.SelectedValue                   = resident.ExtraField1;
        txtExtraField8.Text                           = resident.ExtraField8;
        ddlStatus.SelectedValue                       = resident.ExtraField10 == "InActive" ? "InActive" : "Active";
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Resident resident = new Resident();

        resident = ResidentManager.GetResidentByID(Int32.Parse(Request.QueryString["residentID"]));
        Resident tempResident = new Resident();

        tempResident.ResidentID = resident.ResidentID;

        tempResident.Name                                  = txtName.Text;
        tempResident.AdmissionDate                         = ChangeTheDate(txtAdmissionDate.Text);
        tempResident.AdmissionFrom                         = txtAdmissionFrom.Text;
        tempResident.UsualOccupation                       = txtUsualOccupation.Text;
        tempResident.PlaceOfBirth                          = txtPlaceOfBirth.Text;
        tempResident.UsualAddress                          = txtUsualAddress.Text;
        tempResident.Telephone                             = txtTelephone.Text;
        tempResident.Race                                  = txtRace.Text;
        tempResident.Age                                   = Int32.Parse(txtAge.Text);
        tempResident.DateOfBirth                           = ChangeTheDate(txtDateOfBirth.Text);
        tempResident.Sex                                   = txtSex.Text;
        tempResident.MaritalStatus                         = txtMaritalStatus.Text;
        tempResident.Height                                = txtHeight.Text;
        tempResident.Weight                                = txtWeight.Text;
        tempResident.Religion                              = txtReligion.Text;
        tempResident.Clergyman                             = txtClergyman.Text;
        tempResident.ChurchSynagogue                       = txtChurchSynagogue.Text;
        tempResident.ChurchSynagogueTelephone              = txtChurchSynagogueTelephone.Text;
        tempResident.Address                               = txtAddress.Text;
        tempResident.AddressTelephone                      = txtAddressTelephone.Text;
        tempResident.SocialSecurity                        = txtSocialSecurity.Text;
        tempResident.Medicare                              = txtMedicare.Text;
        tempResident.Medicaid                              = txtMedicaid.Text;
        tempResident.Insurance                             = txtInsurance.Text;
        tempResident.InsuranceAddress                      = txtInsuranceAddress.Text;
        tempResident.InsuranceAddressTelephone             = txtInsuranceAddressTelephone.Text;
        tempResident.Policy                                = txtPolicy.Text;
        tempResident.InsuranceGroup                        = txtInsuranceGroup.Text;
        tempResident.InsuranceGroupNo                      = txtInsuranceGroupNo.Text;
        tempResident.ResponsibleParty                      = txtResponsibleParty.Text;
        tempResident.ResponsiblePartyRelationship          = txtResponsiblePartyRelationship.Text;
        tempResident.ResponsiblePartyAddress               = txtResponsiblePartyAddress.Text;
        tempResident.ResponsiblePartyTelephone             = txtResponsiblePartyTelephone.Text;
        tempResident.PowerOfAttorney                       = txtPowerOfAttorney.Text;
        tempResident.PowerOfAttorneyAddress                = txtPowerOfAttorneyAddress.Text;
        tempResident.PowerOfAttorneyRelationship           = txtPowerOfAttorneyRelationship.Text;
        tempResident.PowerOfAttorneyTelephone              = txtPowerOfAttorneyTelephone.Text;
        tempResident.NearestRelativeOrGuardian             = txtNearestRelativeOrGuardian.Text;
        tempResident.NearestRelativeOrGuardianRelationship = txtNearestRelativeOrGuardianRelationship.Text;
        tempResident.NearestRelativeOrGuardianAddress      = txtNearestRelativeOrGuardianAddress.Text;
        tempResident.NearestRelativeOrGuardianTelephone    = txtNearestRelativeOrGuardianTelephone.Text;
        tempResident.NotifyInCaseOfEmergency               = txtNotifyInCaseOfEmergency.Text;
        tempResident.NotifyInCaseOfEmergencyRelationship   = txtNotifyInCaseOfEmergencyRelationship.Text;
        tempResident.NotifyInCaseOfEmergencyAddress        = txtNotifyInCaseOfEmergencyAddress.Text;
        tempResident.NotifyInCaseOfEmergencyTelephone      = txtNotifyInCaseOfEmergencyTelephone.Text;
        tempResident.HospitalPreference                    = txtHospitalPreference.Text;
        tempResident.HospitalPreferenceTelephone           = txtHospitalPreferenceTelephone.Text;
        tempResident.HospitalPreferenceEmail               = txtHospitalPreferenceEmail.Text;
        tempResident.FuneralHomePreference                 = txtFuneralHomePreference.Text;
        tempResident.FuneralHomePreferenceTelephone        = txtFuneralHomePreferenceTelephone.Text;
        tempResident.PharmacyPreference                    = txtPharmacyPreference.Text;
        tempResident.PharmacyPreferenceTelephone           = txtPharmacyPreferenceTelephone.Text;
        tempResident.Dentist                               = txtDentist.Text;
        tempResident.DentistTelephone                      = txtDentistTelephone.Text;
        tempResident.AttendingPhysician                    = txtAttendingPhysician.Text;
        tempResident.AttendingPhysicianAddress             = txtAttendingPhysicianAddress.Text;
        tempResident.AttendingPhysicianTelephone           = txtAttendingPhysicianTelephone.Text;
        tempResident.AlternatePhysician                    = txtAlternatePhysician.Text;
        tempResident.AlternatePhysicianAddress             = txtAlternatePhysicianAddress.Text;
        tempResident.AlternatePhysicianTelephone           = txtAlternatePhysicianTelephone.Text;
        tempResident.DateofLastPhysicalExam                = ChangeTheDate(txtDateofLastPhysicalExam.Text);
        tempResident.YearlyPhysicalDue                     = txtYearlyPhysicalDue.Text;
        tempResident.Diagnosis                             = txtDiagnosis.Text;
        tempResident.Allergies                             = txtAllergies.Text;
        tempResident.DischargedOrExpiredDate               = ChangeTheDate(txtDischargedOrExpiredDate.Text);
        tempResident.DischargedOrExpiredReason             = txtDischargedOrExpiredReason.Text;
        tempResident.IsWithoutMDApproval                   = cbIsWithoutMDApproval.Checked;
        tempResident.ReleasedTo                            = txtReleasedTo.Text;
        tempResident.NewAddress                            = txtNewAddress.Text;
        tempResident.PlaceOfDeathAddressnCitynCountynState = txtPlaceOfDeathAddressnCitynCountynState.Text;
        tempResident.PrecinctNo                            = txtPrecinctNo.Text;
        tempResident.MorticianName                         = txtMorticianName.Text;
        tempResident.Signature                             = txtSignature.Text;
        tempResident.ExtraField1                           = ddlPropertyID.SelectedValue;
        tempResident.ExtraField2                           = resident.ExtraField2;
        tempResident.ExtraField3                           = resident.ExtraField3;
        tempResident.ExtraField4                           = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");
        tempResident.ExtraField5                           = getLogin().FirstName + " " + getLogin().MiddleName + " " + getLogin().LastName;
        tempResident.ExtraField6                           = "";
        tempResident.ExtraField7                           = "";
        tempResident.ExtraField8                           = txtExtraField8.Text;
        tempResident.ExtraField9                           = "";
        tempResident.ExtraField10                          = ddlStatus.SelectedValue;
        bool result = ResidentManager.UpdateResident(tempResident);

        lblMsg1.Visible = true;
        lblMsg2.Visible = true;
        lblMsg3.Visible = true;
        //Response.Redirect("AdminResidentDisplay.aspx");
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Resident resident = new Resident();

        resident.Name                                  = txtName.Text;
        resident.AdmissionDate                         = ChangeTheDate(txtAdmissionDate.Text);
        resident.AdmissionFrom                         = txtAdmissionFrom.Text;
        resident.UsualOccupation                       = txtUsualOccupation.Text;
        resident.PlaceOfBirth                          = txtPlaceOfBirth.Text;
        resident.UsualAddress                          = txtUsualAddress.Text;
        resident.Telephone                             = txtTelephone.Text;
        resident.Race                                  = txtRace.Text;
        resident.Age                                   = Int32.Parse(txtAge.Text == ""?"0":txtAge.Text);
        resident.DateOfBirth                           = ChangeTheDate(txtDateOfBirth.Text);
        resident.Sex                                   = txtSex.Text;
        resident.MaritalStatus                         = txtMaritalStatus.Text;
        resident.Height                                = txtHeight.Text;
        resident.Weight                                = txtWeight.Text;
        resident.Religion                              = txtReligion.Text;
        resident.Clergyman                             = txtClergyman.Text;
        resident.ChurchSynagogue                       = txtChurchSynagogue.Text;
        resident.ChurchSynagogueTelephone              = txtChurchSynagogueTelephone.Text;
        resident.Address                               = txtAddress.Text;
        resident.AddressTelephone                      = txtAddressTelephone.Text;
        resident.SocialSecurity                        = txtSocialSecurity.Text;
        resident.Medicare                              = txtMedicare.Text;
        resident.Medicaid                              = txtMedicaid.Text;
        resident.Insurance                             = txtInsurance.Text;
        resident.InsuranceAddress                      = txtInsuranceAddress.Text;
        resident.InsuranceAddressTelephone             = txtInsuranceAddressTelephone.Text;
        resident.Policy                                = txtPolicy.Text;
        resident.InsuranceGroup                        = txtInsuranceGroup.Text;
        resident.InsuranceGroupNo                      = txtInsuranceGroupNo.Text;
        resident.ResponsibleParty                      = txtResponsibleParty.Text;
        resident.ResponsiblePartyRelationship          = txtResponsiblePartyRelationship.Text;
        resident.ResponsiblePartyAddress               = txtResponsiblePartyAddress.Text;
        resident.ResponsiblePartyTelephone             = txtResponsiblePartyTelephone.Text;
        resident.PowerOfAttorney                       = txtPowerOfAttorney.Text;
        resident.PowerOfAttorneyAddress                = txtPowerOfAttorneyAddress.Text;
        resident.PowerOfAttorneyRelationship           = txtPowerOfAttorneyRelationship.Text;
        resident.PowerOfAttorneyTelephone              = txtPowerOfAttorneyTelephone.Text;
        resident.NearestRelativeOrGuardian             = txtNearestRelativeOrGuardian.Text;
        resident.NearestRelativeOrGuardianRelationship = txtNearestRelativeOrGuardianRelationship.Text;
        resident.NearestRelativeOrGuardianAddress      = txtNearestRelativeOrGuardianAddress.Text;
        resident.NearestRelativeOrGuardianTelephone    = txtNearestRelativeOrGuardianTelephone.Text;
        resident.NotifyInCaseOfEmergency               = txtNotifyInCaseOfEmergency.Text;
        resident.NotifyInCaseOfEmergencyRelationship   = txtNotifyInCaseOfEmergencyRelationship.Text;
        resident.NotifyInCaseOfEmergencyAddress        = txtNotifyInCaseOfEmergencyAddress.Text;
        resident.NotifyInCaseOfEmergencyTelephone      = txtNotifyInCaseOfEmergencyTelephone.Text;
        resident.HospitalPreference                    = txtHospitalPreference.Text;
        resident.HospitalPreferenceTelephone           = txtHospitalPreferenceTelephone.Text;
        resident.HospitalPreferenceEmail               = txtHospitalPreferenceEmail.Text;
        resident.FuneralHomePreference                 = txtFuneralHomePreference.Text;
        resident.FuneralHomePreferenceTelephone        = txtFuneralHomePreferenceTelephone.Text;
        resident.PharmacyPreference                    = txtPharmacyPreference.Text;
        resident.PharmacyPreferenceTelephone           = txtPharmacyPreferenceTelephone.Text;
        resident.Dentist                               = txtDentist.Text;
        resident.DentistTelephone                      = txtDentistTelephone.Text;
        resident.AttendingPhysician                    = txtAttendingPhysician.Text;
        resident.AttendingPhysicianAddress             = txtAttendingPhysicianAddress.Text;
        resident.AttendingPhysicianTelephone           = txtAttendingPhysicianTelephone.Text;
        resident.AlternatePhysician                    = txtAlternatePhysician.Text;
        resident.AlternatePhysicianAddress             = txtAlternatePhysicianAddress.Text;
        resident.AlternatePhysicianTelephone           = txtAlternatePhysicianTelephone.Text;
        resident.DateofLastPhysicalExam                = ChangeTheDate(txtDateofLastPhysicalExam.Text);
        resident.YearlyPhysicalDue                     = txtYearlyPhysicalDue.Text;
        resident.Diagnosis                             = txtDiagnosis.Text;
        resident.Allergies                             = txtAllergies.Text;
        resident.DischargedOrExpiredDate               = ChangeTheDate(txtDischargedOrExpiredDate.Text);
        resident.DischargedOrExpiredReason             = txtDischargedOrExpiredReason.Text;
        resident.IsWithoutMDApproval                   = cbIsWithoutMDApproval.Checked;
        resident.ReleasedTo                            = txtReleasedTo.Text;
        resident.NewAddress                            = txtNewAddress.Text;
        resident.PlaceOfDeathAddressnCitynCountynState = txtPlaceOfDeathAddressnCitynCountynState.Text;
        resident.PrecinctNo                            = txtPrecinctNo.Text;
        resident.MorticianName                         = txtMorticianName.Text;
        resident.Signature                             = txtSignature.Text;
        resident.ExtraField1                           = ddlPropertyID.SelectedValue;
        resident.ExtraField2                           = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");;
        resident.ExtraField3                           = getLogin().FirstName + " " + getLogin().MiddleName + " " + getLogin().LastName;
        resident.ExtraField4                           = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");;
        resident.ExtraField5                           = getLogin().FirstName + " " + getLogin().MiddleName + " " + getLogin().LastName;;
        resident.ExtraField6                           = "";
        resident.ExtraField7                           = "";
        resident.ExtraField8                           = txtExtraField8.Text;
        resident.ExtraField9                           = "";
        resident.ExtraField10                          = ddlStatus.SelectedValue;
        int resutl = ResidentManager.InsertResident(resident);

        CommonManager.SQLExec("update Login_Login set AddedResident+=1 where LoginID=(Select RootUser from Login_Login where LoginID=" + getLogin().LoginID + ")");
        Response.Redirect("AdminResidentInsertUpdate.aspx?residentID=" + resutl.ToString());
    }