Beispiel #1
0
        public EL.Registrations.Accomplishments Select(EL.Registrations.Accomplishments accomplishmentEL)
        {
            DataTable dt = Helper.executeQuery("select * from accomplishments where accomplishmentid = '" + accomplishmentEL.Accomplishmentid + "'");

            if (dt.Rows.Count > 0)
            {
                accomplishmentEL.Accomplishmentid = Convert.ToInt32(dt.Rows[0]["accomplishmentid"]);
                accomplishmentEL.Title            = dt.Rows[0]["title"].ToString();
                accomplishmentEL.Dateaccomplished = dt.Rows[0]["dateaccomplished"].ToString();

                return(accomplishmentEL);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0 | e.ColumnIndex == 1 | e.ColumnIndex == 2)
            {
                accomplishmentEL.Accomplishmentid = Convert.ToInt32(dgv.SelectedRows[0].Cells["accomplishmentid"].Value);
                filelocationEL.Accomplishmentid   = accomplishmentEL.Accomplishmentid;
            }

            if (e.ColumnIndex == 0)
            {
                s = "VIEW";
                ShowView();
                lblTitle.Text = "View Accomplishment";

                accomplishmentEL            = accomplishmentBL.Select(accomplishmentEL);
                lblTitleAccomplishment.Text = accomplishmentEL.Title;
                lblDateAccomplished.Text    = Convert.ToDateTime(accomplishmentEL.Dateaccomplished).ToString("mmmm dd, yyyy");

                filelocationEL = filelocationBL.Select(filelocationEL);
                lblFile.Text   = filelocationEL.Filelocation;
            }
            else if (e.ColumnIndex == 1)
            {
                s = "EDIT";
                ShowAddEdit();
                lblTitle.Text = "Updating Accomplishment";

                accomplishmentEL         = accomplishmentBL.Select(accomplishmentEL);
                txtTitle.Text            = accomplishmentEL.Title;
                dtpDateAccomplished.Text = accomplishmentEL.Dateaccomplished;

                filelocationEL = filelocationBL.Select(filelocationEL);
                txtFile.Text   = filelocationEL.Filelocation;
            }
            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(filelocationBL.Delete(filelocationEL) & accomplishmentBL.Delete(accomplishmentEL));
                }
            }
        }
Beispiel #3
0
 public Boolean Delete(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(Helper.executeNonQueryBool("delete from accomplishments where accomplishmentid = '" + accomplishmentEL.Accomplishmentid + "'"));
 }
Beispiel #4
0
 public Boolean Update(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(Helper.executeNonQueryBool("update accomplishments set title = '" + accomplishmentEL.Title + "', dateaccomplished = '" + accomplishmentEL.Dateaccomplished + "' where accomplishmentid = '" + accomplishmentEL.Accomplishmentid + "'"));
 }
Beispiel #5
0
 public long Insert(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(Helper.executeNonQueryLong("insert into accomplishments (title, dateaccomplished) values ('" + accomplishmentEL.Title + "', '" + accomplishmentEL.Dateaccomplished + "')"));
 }
Beispiel #6
0
 public Boolean Delete(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(accomplishmentDL.Delete(accomplishmentEL));
 }
Beispiel #7
0
 public long Insert(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(accomplishmentDL.Insert(accomplishmentEL));
 }
Beispiel #8
0
 public EL.Registrations.Accomplishments Select(EL.Registrations.Accomplishments accomplishmentEL)
 {
     return(accomplishmentDL.Select(accomplishmentEL));
 }