예제 #1
0
        private void btnRegisterAccount_Click(object sender, EventArgs e)
        {
            var registerAccount = new RegisterAccount();

            registerAccount.ShowDialog();

            txtSearchAttendance.Focus();
        }
예제 #2
0
        private void dgvAccount_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var registerAccount = new RegisterAccount();

                // Header name
                registerAccount.Text = "Update | Delete | Account Data";

                // Image path
                string paths = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10));

                // Get the index of particular row
                int rowIndex = e.RowIndex;
                registerAccount.lblId.Text          = dgvAccount.Rows[rowIndex].Cells[0].Value.ToString();
                registerAccount.txtFirstName.Text   = dgvAccount.Rows[rowIndex].Cells[1].Value.ToString();
                registerAccount.txtLastName.Text    = dgvAccount.Rows[rowIndex].Cells[2].Value.ToString();
                registerAccount.txtUsername.Text    = dgvAccount.Rows[rowIndex].Cells[3].Value.ToString();
                registerAccount.txtPassword.Text    = dgvAccount.Rows[rowIndex].Cells[4].Value.ToString();
                registerAccount.pctrBoxPhotos.Image = Image.FromFile(paths + dgvAccount.Rows[rowIndex].Cells[5].Value.ToString());

                // Path image
                registerAccount.txtPathImage.Text = dgvAccount.Rows[rowIndex].Cells[5].Value.ToString();

                registerAccount.lblRegisterAccount.Visible = false;
                registerAccount.btnSave.Visible            = false;
                registerAccount.btnUpdate.Visible          = true;
                registerAccount.btnDelete.Visible          = true;
                registerAccount.errorProviderRegisterAccount.Clear();

                registerAccount.ShowDialog();
                txtSearch.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error, row header mouse click, fetch account data", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
        private void btnRegisterAccount_Click(object sender, EventArgs e)
        {
            var registerAccount = new RegisterAccount();

            registerAccount.ShowDialog();
        }