Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public Boolean Delete(EL.Registrations.accounts accountEL)
 {
     return(Helper.executeNonQueryBool("delete from accounts where accountid = '" + accountEL.Accountid + "'"));
 }
Ejemplo n.º 4
0
 public Boolean Update(EL.Registrations.accounts accountEL)
 {
     return(Helper.executeNonQueryBool("update accounts set username = '******', password = '******' where accountid = '" + accountEL.Accountid + "'"));
 }
Ejemplo n.º 5
0
 public long Insert(EL.Registrations.accounts accountEL)
 {
     return(Helper.executeNonQueryLong("insert into accounts (username, password) values ('" + accountEL.Username + "', '" + accountEL.Password + "')"));
 }
Ejemplo n.º 6
0
 public DataTable Login(EL.Registrations.accounts accountEL)
 {
     return(Helper.executeQuery("select * from accounts where username = '******' and password = '******'"));
 }
Ejemplo n.º 7
0
 public Boolean Delete(EL.Registrations.accounts accountEL)
 {
     return(accountDL.Delete(accountEL));
 }
Ejemplo n.º 8
0
 public Boolean Update(EL.Registrations.accounts accountEL)
 {
     return(accountDL.Update(accountEL));
 }
Ejemplo n.º 9
0
 public long Insert(EL.Registrations.accounts accountEL)
 {
     return(accountDL.Insert(accountEL));
 }
Ejemplo n.º 10
0
 public EL.Registrations.accounts Select(EL.Registrations.accounts accountEL)
 {
     return(accountDL.Select(accountEL));
 }
Ejemplo n.º 11
0
 public DataTable Login(EL.Registrations.accounts accountEL)
 {
     return(accountDL.Login(accountEL));
 }