public EL.Registrations.Residents Select(EL.Registrations.Residents residentEL) { DataTable dt = Helper.executeQuery("select * from residents where residentid = '" + residentEL.Residentid + "'"); if (dt.Rows.Count > 0) { residentEL.Residentid = Convert.ToInt32(dt.Rows[0]["residentid"]); residentEL.Barangayidnumber = dt.Rows[0]["barangayidnumber"].ToString(); residentEL.Lastname = dt.Rows[0]["lastname"].ToString(); residentEL.Firstname = dt.Rows[0]["firstname"].ToString(); residentEL.Middlename = dt.Rows[0]["middlename"].ToString(); residentEL.Height = dt.Rows[0]["height"].ToString(); residentEL.Weight = dt.Rows[0]["weight"].ToString(); residentEL.Precintnumber = dt.Rows[0]["precintnumber"].ToString(); residentEL.Ctcnumber = dt.Rows[0]["ctcnumber"].ToString(); residentEL.Dateaccomplished = dt.Rows[0]["dateaccomplished"].ToString(); residentEL.Daterecorded = dt.Rows[0]["daterecorded"].ToString(); residentEL.Ispwd = Convert.ToInt32(dt.Rows[0]["ispwd"]); return(residentEL); } else { return(null); } }
private void dgvResidents_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { residentEL.Residentid = Convert.ToInt32(dgvResidents.SelectedRows[0].Cells["residentid"].Value); residentEL = residentBL.Select(residentEL); txtResident.Text = residentEL.Lastname + ", " + residentEL.Firstname + " " + residentEL.Middlename; ShowResidents(false); } }
private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 | e.ColumnIndex == 1 | e.ColumnIndex == 2) { issuanceEL.Issuanceid = Convert.ToInt32(dgv.SelectedRows[0].Cells["issuanceid"].Value); issuanceEL = issuanceBL.Select(issuanceEL); residentEL.Residentid = issuanceEL.Residentid; residentEL = residentBL.Select(residentEL); certificationEL.Certificationid = issuanceEL.Certificationid; certificationEL = certificationBL.Select(certificationEL); } if (e.ColumnIndex == 0) { s = "VIEW"; ShowView(); lblTitle.Text = "View Issuance"; lblResident.Text = residentEL.Lastname + ", " + residentEL.Firstname + " " + residentEL.Middlename; lblCertificate.Text = certificationEL.Certification; lblIssuanceDateAndtime.Text = issuanceEL.Issuancedateandtime; } else if (e.ColumnIndex == 1) { s = "EDIT"; ShowAddEdit(); ShowResidents(false); lblTitle.Text = "Updating Issuance"; txtResident.Text = residentEL.Lastname + ", " + residentEL.Firstname + " " + residentEL.Middlename; cbCertificate.SelectedValue = certificationEL.Certificationid; } 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(issuanceBL.Delete(issuanceEL)); } } }
public Boolean Delete(EL.Registrations.Residents residentEL) { return(residentDL.Delete(residentEL)); }
public Boolean Update(EL.Registrations.Residents residentEL) { return(residentDL.Update(residentEL)); }
public long Insert(EL.Registrations.Residents residentEL) { return(residentDL.Insert(residentEL)); }
public EL.Registrations.Residents Select(EL.Registrations.Residents residentEL) { return(residentDL.Select(residentEL)); }
public long Insert(EL.Registrations.Residents residentEL) { return(Helper.executeNonQueryLong("insert into residents (barangayidnumber, lastname, firstname, middlename, height, weight, precintnumber, ctcnumber, dateaccomplished, daterecorded, ispwd) values ('" + residentEL.Barangayidnumber + "', '" + residentEL.Lastname + "', '" + residentEL.Firstname + "', '" + residentEL.Middlename + "', '" + residentEL.Height + "', '" + residentEL.Weight + "','" + residentEL.Precintnumber + "', '" + residentEL.Ctcnumber + "', '" + residentEL.Dateaccomplished + "', '" + residentEL.Daterecorded + "', '" + residentEL.Ispwd + "')")); }
public Boolean Delete(EL.Registrations.Residents residentEL) { return(Helper.executeNonQueryBool("delete from residents where residentid = '" + residentEL.Residentid + "'")); }
public Boolean Update(EL.Registrations.Residents residentEL) { return(Helper.executeNonQueryBool("update residents set barangayidnumber = '" + residentEL.Barangayidnumber + "', lastname = '" + residentEL.Lastname + "', firstname = '" + residentEL.Firstname + "', middlename = '" + residentEL.Middlename + "', height = '" + residentEL.Height + "', weight = '" + residentEL.Weight + "', precintnumber = '" + residentEL.Precintnumber + "', ctcnumber = '" + residentEL.Ctcnumber + "', dateaccomplished = '" + residentEL.Dateaccomplished + "', ispwd = '" + residentEL.Ispwd + "' where residentid = '" + residentEL.Residentid + "'")); }
public frmPrintables(EL.Registrations.Residents _residentEL) { InitializeComponent(); residentEL = _residentEL; }
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))); } } }