コード例 #1
0
        public EL.Registrations.Residentsoccupation Select(EL.Registrations.Residentsoccupation residentoccupationEL)
        {
            DataTable dt = Helper.executeQuery("select * from residentsoccupation where residentid = '" + residentoccupationEL.Residentid + "'");

            if (dt.Rows.Count > 0)
            {
                residentoccupationEL.Residentoccupationid = Convert.ToInt32(dt.Rows[0]["residentoccupationid"]);
                residentoccupationEL.Residentid           = Convert.ToInt32(dt.Rows[0]["residentid"]);
                residentoccupationEL.Occupationid         = Convert.ToInt32(dt.Rows[0]["occupationid"]);

                return(residentoccupationEL);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
 public Boolean Delete(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(residentoccupationDL.Delete(residentoccupationEL));
 }
コード例 #3
0
 public long Insert(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(residentoccupationDL.Insert(residentoccupationEL));
 }
コード例 #4
0
 public EL.Registrations.Residentsoccupation Select(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(residentoccupationDL.Select(residentoccupationEL));
 }
コード例 #5
0
 public Boolean Delete(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(Helper.executeNonQueryBool("delete from residentsoccupation where residentid = '" + residentoccupationEL.Residentid + "'"));
 }
コード例 #6
0
 public Boolean Update(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(Helper.executeNonQueryBool("update residentsoccupation set occupationid = '" + residentoccupationEL.Occupationid + "' where residentid = '" + residentoccupationEL.Residentid + "'"));
 }
コード例 #7
0
 public long Insert(EL.Registrations.Residentsoccupation residentoccupationEL)
 {
     return(Helper.executeNonQueryLong("insert into residentsoccupation (residentid, occupationid) values ('" + residentoccupationEL.Residentid + "', '" + residentoccupationEL.Occupationid + "')"));
 }
コード例 #8
0
        private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0 | e.ColumnIndex == 1 | e.ColumnIndex == 2)
            {
                residentEL.Residentid            = Convert.ToInt32(dgv.SelectedRows[0].Cells["residentid"].Value);
                educationEL.Residentid           = residentEL.Residentid;
                residentreligionEL.Residentid    = residentEL.Residentid;
                residentcivilstatusEL.Residentid = residentEL.Residentid;
                residentsexEL.Residentid         = residentEL.Residentid;
                residentcitizenshipEL.Residentid = residentEL.Residentid;
                residentoccupationEL.Residentid  = residentEL.Residentid;
                homeaddressEL.Residentid         = residentEL.Residentid;
                residenthouseholdEL.Residentid   = residentEL.Residentid;
                provincialaddressEL.Residentid   = residentEL.Residentid;
                contactdetailEL.Residentid       = residentEL.Residentid;
                birthinformationEL.Residentid    = residentEL.Residentid;
            }


            if (e.ColumnIndex == 0)
            {
                s = "VIEW";
                ShowView();
                ShowHouseholds(false);
                lblTitle.Text = "View Resident Profile";

                residentEL            = residentBL.Select(residentEL);
                educationEL           = educationBL.Select(educationEL);
                residentreligionEL    = residentreligionBL.Select(residentreligionEL);
                residentcivilstatusEL = residentcivilstatusBL.Select(residentcivilstatusEL);
                residentsexEL         = residentsexBL.Select(residentsexEL);
                residentcitizenshipEL = residentcitizenshipBL.Select(residentcitizenshipEL);
                residentoccupationEL  = residentoccupationBL.Select(residentoccupationEL);
                homeaddressEL         = homeaddressBL.Select(homeaddressEL);
                residenthouseholdEL   = residenthouseholdBL.Select(residenthouseholdEL);
                provincialaddressEL   = provincialaddressBL.Select(provincialaddressEL);
                contactdetailEL       = contactdetailBL.Select(contactdetailEL);
                birthinformationEL    = birthinformationBL.Select(birthinformationEL);
                purokEL.Purokid       = homeaddressEL.Purokid;
                purokEL = purokBL.Select(purokEL);
                citizenshipEL.Citizenshipid = residentcitizenshipEL.Citizenshipid;
                citizenshipEL           = citizenshipBL.Select(citizenshipEL);
                householdEL.Householdid = residenthouseholdEL.Householdid;
                householdEL             = householdBL.Select(householdEL);
                religionEL.Religionid   = residentreligionEL.Religionid;
                religionEL  = religionBL.Select(religionEL);
                sexEL.Sexid = residentsexEL.Sexid;
                sexEL       = sexBL.Select(sexEL);
                civilstatusEL.Civilstatusid = residentcivilstatusEL.Civilstatusid;
                civilstatusEL = civilstatusBL.Select(civilstatusEL);
                educationalattainmentEL.Educationalattainmentid = educationEL.Educationalattainmentid;
                educationalattainmentEL   = educationalattainmentBL.Select(educationalattainmentEL);
                occupationEL.Occupationid = residentoccupationEL.Occupationid;
                occupationEL = occupationBL.Select(occupationEL);

                lblBarangayIDNumber.Text = residentEL.Barangayidnumber;
                lblFullName.Text         = residentEL.Firstname + " " + residentEL.Middlename + " " + residentEL.Lastname;
                lblHouseholdControl.Text = "Household Member Control: " + householdEL.Householdnumber + " " + householdEL.Household;
                lblAddress.Text          = homeaddressEL.Housenumber + ", " + homeaddressEL.Street + ", " + homeaddressEL.Subdivision + ", " + purokEL.Purok + ", Barangay Bukay Pait, " + provincialaddressEL.Municipality + ", " + provincialaddressEL.Province;
                lblDateRecorded.Text     = "Date Recorded: " + Convert.ToDateTime(residentEL.Daterecorded).ToString("MMMM dd, yyyy");


                lblBarangayIDNumber1.Text     = residentEL.Barangayidnumber;
                lblLastName.Text              = residentEL.Lastname;
                lblFirstName.Text             = residentEL.Firstname;
                lblMiddleName.Text            = residentEL.Middlename;
                lblCitizenship.Text           = citizenshipEL.Citizenship;
                lblReligion.Text              = religionEL.Religion;
                lblBirthPlace.Text            = birthinformationEL.Birthplace;
                lblBirthday.Text              = Convert.ToDateTime(birthinformationEL.Birthdate).ToString("MMMM dd, yyyy");
                lblGender.Text                = sexEL.Sex;
                lblHeight.Text                = residentEL.Height + " cm";
                lblWeight.Text                = residentEL.Weight + " kg";
                lblCivilStatus.Text           = civilstatusEL.Civilstatus;
                lblEducationalAttainment.Text = educationalattainmentEL.Educationalattainment;
                lblCourse.Text                = educationEL.Course;
                lblYear.Text       = educationEL.Yeargraduated;
                lblOccupation.Text = occupationEL.Occupation;

                lblHouseNumber.Text = homeaddressEL.Housenumber;
                lblStreet.Text      = homeaddressEL.Street;
                lblSubdivision.Text = homeaddressEL.Subdivision;
                lblPurok.Text       = purokEL.Purok;

                lblMunicipality.Text = provincialaddressEL.Municipality;
                lblProvince.Text     = provincialaddressEL.Province;

                lblPrecintNumber.Text   = residentEL.Precintnumber;
                lblEmailAddress.Text    = contactdetailEL.Emailaddress;
                lblPhoneNumber.Text     = contactdetailEL.Phonenumber;
                lblCellphoneNumber.Text = contactdetailEL.Cellphonenumber;

                lblCTCNumber.Text        = residentEL.Ctcnumber;
                lblDateAccomplished.Text = Convert.ToDateTime(residentEL.Dateaccomplished).ToString("MMMM dd, yyyy");
            }
            else if (e.ColumnIndex == 1)
            {
                s = "EDIT";
                ShowAddEdit();
                ShowHouseholds(false);
                lblTitle.Text = "Updating Resident";

                residentEL            = residentBL.Select(residentEL);
                educationEL           = educationBL.Select(educationEL);
                residentreligionEL    = residentreligionBL.Select(residentreligionEL);
                residentcivilstatusEL = residentcivilstatusBL.Select(residentcivilstatusEL);
                residentsexEL         = residentsexBL.Select(residentsexEL);
                residentcitizenshipEL = residentcitizenshipBL.Select(residentcitizenshipEL);
                residentoccupationEL  = residentoccupationBL.Select(residentoccupationEL);
                homeaddressEL         = homeaddressBL.Select(homeaddressEL);
                residenthouseholdEL   = residenthouseholdBL.Select(residenthouseholdEL);
                provincialaddressEL   = provincialaddressBL.Select(provincialaddressEL);
                contactdetailEL       = contactdetailBL.Select(contactdetailEL);
                birthinformationEL    = birthinformationBL.Select(birthinformationEL);



                txtBarangayIDNumber.Text = residentEL.Barangayidnumber;
                txtLastName.Text         = residentEL.Lastname;
                txtFirstName.Text        = residentEL.Firstname;
                txtMiddleName.Text       = residentEL.Middlename;
                txtHeight.Text           = residentEL.Height;
                txtWeight.Text           = residentEL.Weight;
                txtPrecintNumber.Text    = residentEL.Precintnumber;
                txtCTCNumber.Text        = residentEL.Ctcnumber;
                dtpDateAccomplished.Text = residentEL.Dateaccomplished;
                cbIsPwd.Checked          = Convert.ToBoolean(residentEL.Ispwd);

                cbEducationalAttainment.SelectedValue = educationEL.Educationalattainmentid.ToString();
                txtCourse.Text        = educationEL.Course;
                txtYearGraduated.Text = educationEL.Yeargraduated;

                cbReligion.SelectedValue = residentreligionEL.Religionid.ToString();

                cbCivilStatus.SelectedValue = residentcivilstatusEL.Civilstatusid;

                cbSex.SelectedValue = residentsexEL.Sexid;

                cbCitizenship.SelectedValue = residentcitizenshipEL.Citizenshipid;

                cbProfessionOrOccupation.SelectedValue = residentoccupationEL.Occupationid;

                cbPurok.SelectedValue = homeaddressEL.Purokid;
                txtHouseNumber.Text   = homeaddressEL.Housenumber;
                txtStreet.Text        = homeaddressEL.Street;
                txtSubdivision.Text   = homeaddressEL.Subdivision;

                householdEL.Householdid = residenthouseholdEL.Householdid;
                householdEL             = householdBL.Select(householdEL);
                txtHousehold.Text       = householdEL.Household + " (" + householdEL.Householdnumber + ")";

                cbHouseholdMember.SelectedValue = residenthouseholdEL.Householdmemberid;

                txtProvince.Text     = provincialaddressEL.Province;
                txtMunicipality.Text = provincialaddressEL.Municipality;

                txtEmailAddress.Text    = contactdetailEL.Emailaddress;
                txtPhoneNumber.Text     = contactdetailEL.Phonenumber;
                txtCellphoneNumber.Text = contactdetailEL.Cellphonenumber;

                txtBirthPlace.Text = birthinformationEL.Birthplace;
                dtpBirthDate.Text  = birthinformationEL.Birthdate;
            }
            else if (e.ColumnIndex == 2)
            {
                DialogResult dialogResult = MessageBox.Show("ARE YOU SURE TO DELETE THIS SELECTED ITEM?", "DELETING", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    ShowResult((birthinformationBL.Delete(birthinformationEL)) &
                               (educationBL.Delete(educationEL)) &
                               (residentreligionBL.Delete(residentreligionEL)) &
                               (residentcivilstatusBL.Delete(residentcivilstatusEL)) &
                               (residentsexBL.Delete(residentsexEL)) &
                               (residentcitizenshipBL.Delete(residentcitizenshipEL)) &
                               (residentoccupationBL.Delete(residentoccupationEL)) &
                               (homeaddressBL.Delete(homeaddressEL)) &
                               (residenthouseholdBL.Delete(residenthouseholdEL)) &
                               (provincialaddressBL.Delete(provincialaddressEL)) &
                               (contactdetailBL.Delete(contactdetailEL)) &
                               (residentBL.Delete(residentEL)));
                }
            }
        }