private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) { accountEL.Accountid = Convert.ToInt32(dgv.SelectedRows[0].Cells["ACCOUNT ID"].Value); if (e.ColumnIndex == 0) { lblTitle.Text = "EDIT ACCOUNT"; s = "EDIT"; ShowForm(true); accountEL = accountBL.Select(accountEL); txtUsername.Text = accountEL.Username; txtPassword.Text = accountEL.Password; } if (e.ColumnIndex == 1) { switch (MessageBox.Show(this, "ARE YOU SURE TO DELETE THIS SELECTED ITEM?", "Deleting", MessageBoxButtons.YesNo)) { case DialogResult.No: break; default: ShowResult(accountBL.Delete(accountEL)); break; } } }
public EL.Registrations.accounts Select(EL.Registrations.accounts accountEL) { DataTable dt = Helper.executeQuery("select * from accounts where accountid = '" + accountEL.Accountid + "'"); if (dt.Rows.Count > 0) { accountEL.Accountid = Convert.ToInt32(dt.Rows[0]["accountid"]); accountEL.Username = dt.Rows[0]["username"].ToString(); accountEL.Password = dt.Rows[0]["password"].ToString(); return(accountEL); } else { return(null); } }
public Boolean Delete(EL.Registrations.accounts accountEL) { return(Helper.executeNonQueryBool("delete from accounts where accountid = '" + accountEL.Accountid + "'")); }
public Boolean Update(EL.Registrations.accounts accountEL) { return(Helper.executeNonQueryBool("update accounts set username = '******', password = '******' where accountid = '" + accountEL.Accountid + "'")); }
public long Insert(EL.Registrations.accounts accountEL) { return(Helper.executeNonQueryLong("insert into accounts (username, password) values ('" + accountEL.Username + "', '" + accountEL.Password + "')")); }
public DataTable Login(EL.Registrations.accounts accountEL) { return(Helper.executeQuery("select * from accounts where username = '******' and password = '******'")); }
public Boolean Delete(EL.Registrations.accounts accountEL) { return(accountDL.Delete(accountEL)); }
public Boolean Update(EL.Registrations.accounts accountEL) { return(accountDL.Update(accountEL)); }
public long Insert(EL.Registrations.accounts accountEL) { return(accountDL.Insert(accountEL)); }
public EL.Registrations.accounts Select(EL.Registrations.accounts accountEL) { return(accountDL.Select(accountEL)); }
public DataTable Login(EL.Registrations.accounts accountEL) { return(accountDL.Login(accountEL)); }