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));
                }
            }
        }
Пример #2
0
        public EL.Registrations.Issuances Select(EL.Registrations.Issuances issuanceEL)
        {
            DataTable dt = Helper.executeQuery("select * from issuances where issuanceid = '" + issuanceEL.Issuanceid + "'");

            if (dt.Rows.Count > 0)
            {
                issuanceEL.Issuanceid          = Convert.ToInt32(dt.Rows[0]["issuanceid"]);
                issuanceEL.Residentid          = Convert.ToInt32(dt.Rows[0]["residentid"]);
                issuanceEL.Certificationid     = Convert.ToInt32(dt.Rows[0]["certificationid"]);
                issuanceEL.Issuancedateandtime = dt.Rows[0]["issuancedateandtime"].ToString();

                return(issuanceEL);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
 public Boolean Delete(EL.Registrations.Issuances issuanceEL)
 {
     return(Helper.executeNonQueryBool("delete from issuances where issuanceid = '" + issuanceEL.Issuanceid + "'"));
 }
Пример #4
0
 public Boolean Update(EL.Registrations.Issuances issuanceEL)
 {
     return(Helper.executeNonQueryBool("update issuances set residentid = '" + issuanceEL.Residentid + "', certificationid = '" + issuanceEL.Certificationid + "', issuancedateandtime = '" + issuanceEL.Issuancedateandtime + "' where issuanceid = '" + issuanceEL.Issuanceid + "'"));
 }
Пример #5
0
 public long Insert(EL.Registrations.Issuances issuanceEL)
 {
     return(Helper.executeNonQueryLong("insert into issuances (residentid, certificationid, issuancedateandtime) values ('" + issuanceEL.Residentid + "', '" + issuanceEL.Certificationid + "', '" + issuanceEL.Issuancedateandtime + "')"));
 }
Пример #6
0
 public Boolean Delete(EL.Registrations.Issuances issuanceEL)
 {
     return(issuanceDL.Delete(issuanceEL));
 }
Пример #7
0
 public Boolean Update(EL.Registrations.Issuances issuanceEL)
 {
     return(issuanceDL.Update(issuanceEL));
 }
Пример #8
0
 public long Insert(EL.Registrations.Issuances issuanceEL)
 {
     return(issuanceDL.Insert(issuanceEL));
 }
Пример #9
0
 public EL.Registrations.Issuances Select(EL.Registrations.Issuances issuanceEL)
 {
     return(issuanceDL.Select(issuanceEL));
 }