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); } }
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)); } } }
public Boolean Delete(EL.Registrations.Accomplishments accomplishmentEL) { return(Helper.executeNonQueryBool("delete from accomplishments where accomplishmentid = '" + accomplishmentEL.Accomplishmentid + "'")); }
public Boolean Update(EL.Registrations.Accomplishments accomplishmentEL) { return(Helper.executeNonQueryBool("update accomplishments set title = '" + accomplishmentEL.Title + "', dateaccomplished = '" + accomplishmentEL.Dateaccomplished + "' where accomplishmentid = '" + accomplishmentEL.Accomplishmentid + "'")); }
public long Insert(EL.Registrations.Accomplishments accomplishmentEL) { return(Helper.executeNonQueryLong("insert into accomplishments (title, dateaccomplished) values ('" + accomplishmentEL.Title + "', '" + accomplishmentEL.Dateaccomplished + "')")); }
public Boolean Delete(EL.Registrations.Accomplishments accomplishmentEL) { return(accomplishmentDL.Delete(accomplishmentEL)); }
public long Insert(EL.Registrations.Accomplishments accomplishmentEL) { return(accomplishmentDL.Insert(accomplishmentEL)); }
public EL.Registrations.Accomplishments Select(EL.Registrations.Accomplishments accomplishmentEL) { return(accomplishmentDL.Select(accomplishmentEL)); }