Exemple #1
0
        private void dgvAccount_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Globals.IsFreeVersion)
            {
                if (dgvAccount.Rows.Count < 1)
                {
                    MessageBox.Show("There are no Accounts in DataBase");
                    return;
                }
                else
                {
                    try
                    {
                        frmAccountPasswordUpdate objfrmAccountPasswordUpdate = new frmAccountPasswordUpdate();
                        CheckAccount             objCheckAccount             = new CheckAccount();

                        userNameForPasswordUpdate = dgvAccount.Rows[e.RowIndex].Cells[0].FormattedValue.ToString();
                        passwordForPasswordUpdate = dgvAccount.Rows[e.RowIndex].Cells[1].FormattedValue.ToString();
                        objCheckAccount.UpdatePassword(userNameForPasswordUpdate, passwordForPasswordUpdate);
                        objfrmAccountPasswordUpdate.Show();
                    }
                    catch (Exception ex)
                    {
                        Console.Write(ex.Message);
                    }
                }
            }

            //using (OpenFileDialog ofd = new OpenFileDialog())
            //{
            //    ofd.Filter = "Text Files (*.txt)|*.txt";
            //    ofd.InitialDirectory = Application.StartupPath;
            //    if (ofd.ShowDialog() == DialogResult.OK)
            //    {
            //        ExportAccountsToFile(ofd.FileName);
            //        AddToListBox("Accounts Exported to ---" + ofd.FileName);
            //    }
            //}
        }
Exemple #2
0
        private void dgvAccount_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Globals.IsFreeVersion)
            {
                if (dgvAccount.Rows.Count < 1)
                {
                    MessageBox.Show("There are no Accounts in DataBase");
                    return;
                }
                else
                {
                    try
                    {
                        frmAccountPasswordUpdate objfrmAccountPasswordUpdate = new frmAccountPasswordUpdate();
                        CheckAccount objCheckAccount = new CheckAccount();

                        userNameForPasswordUpdate = dgvAccount.Rows[e.RowIndex].Cells[0].FormattedValue.ToString();
                        passwordForPasswordUpdate = dgvAccount.Rows[e.RowIndex].Cells[1].FormattedValue.ToString();
                        objCheckAccount.UpdatePassword(userNameForPasswordUpdate, passwordForPasswordUpdate);
                        objfrmAccountPasswordUpdate.Show();

                    }
                    catch (Exception ex)
                    {
                        Console.Write(ex.Message);
                    }
                }
            }

            //using (OpenFileDialog ofd = new OpenFileDialog())
            //{
            //    ofd.Filter = "Text Files (*.txt)|*.txt";
            //    ofd.InitialDirectory = Application.StartupPath;
            //    if (ofd.ShowDialog() == DialogResult.OK)
            //    {
            //        ExportAccountsToFile(ofd.FileName);
            //        AddToListBox("Accounts Exported to ---" + ofd.FileName);
            //    }
            //}
        }