Beispiel #1
0
        public EL.Registrations.Educations Select(EL.Registrations.Educations educationEL)
        {
            DataTable dt = Helper.executeQuery("select * from educations where residentid = '" + educationEL.Residentid + "'");

            if (dt.Rows.Count > 0)
            {
                educationEL.Educationid             = Convert.ToInt32(dt.Rows[0]["educationid"]);
                educationEL.Residentid              = Convert.ToInt32(dt.Rows[0]["residentid"]);
                educationEL.Educationalattainmentid = Convert.ToInt32(dt.Rows[0]["educationalattainmentid"]);
                educationEL.Course        = dt.Rows[0]["course"].ToString();
                educationEL.Yeargraduated = dt.Rows[0]["yeargraduated"].ToString();

                return(educationEL);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 public Boolean Delete(EL.Registrations.Educations educationEL)
 {
     return(educationDL.Delete(educationEL));
 }
Beispiel #3
0
 public Boolean Update(EL.Registrations.Educations educationEL)
 {
     return(educationDL.Update(educationEL));
 }
Beispiel #4
0
 public long Insert(EL.Registrations.Educations educationEL)
 {
     return(educationDL.Insert(educationEL));
 }
Beispiel #5
0
 public EL.Registrations.Educations Select(EL.Registrations.Educations educationEL)
 {
     return(educationDL.Select(educationEL));
 }
Beispiel #6
0
 public Boolean Delete(EL.Registrations.Educations educationEL)
 {
     return(Helper.executeNonQueryBool("delete from educations where residentid = '" + educationEL.Residentid + "'"));
 }
Beispiel #7
0
 public Boolean Update(EL.Registrations.Educations educationEL)
 {
     return(Helper.executeNonQueryBool("update educations set educationalattainmentid = '" + educationEL.Educationalattainmentid + "', course = '" + educationEL.Course + "', yeargraduated = '" + educationEL.Yeargraduated + "' where residentid = '" + educationEL.Residentid + "'"));
 }
Beispiel #8
0
 public long Insert(EL.Registrations.Educations educationEL)
 {
     return(Helper.executeNonQueryLong("insert into educations (residentid, educationalattainmentid, course, yeargraduated) values ('" + educationEL.Residentid + "', '" + educationEL.Educationalattainmentid + "', '" + educationEL.Course + "', '" + educationEL.Yeargraduated + "')"));
 }
Beispiel #9
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)));
                }
            }
        }