Ejemplo n.º 1
0
        public EL.Registrations.Certifications Select(EL.Registrations.Certifications certificationEL)
        {
            DataTable dt = Helper.executeQuery("select * from certifications where certificationid = '" + certificationEL.Certificationid + "'");

            if (dt.Rows.Count > 0)
            {
                certificationEL.Certificationid = Convert.ToInt32(dt.Rows[0]["certificationid"]);
                certificationEL.Certification   = dt.Rows[0]["certification"].ToString();

                return(certificationEL);
            }
            else
            {
                return(null);
            }
        }
        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 EL.Registrations.Certifications Select(EL.Registrations.Certifications certificationEL)
 {
     return(certificationDL.Select(certificationEL));
 }