Beispiel #1
0
        private void btnActive_Click(object sender, EventArgs e)
        {
            try
            {
                if (lsvUsers.SelectedItems.Count <= 0)
                {
                    MessageBox.Show("select an item to edit", "Item not yet selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                User  oUser = null;
                fUser frm   = new fUser();

                if (lsvUsers.SelectedItems != null && lsvUsers.SelectedItems.Count > 0)
                {
                    oUser = (User)lsvUsers.SelectedItems[0].Tag;
                }

                //if(btnActive.Text=="Active")
                //{

                //}

                frm.ItemChanged = RefreshList;
                frm.ShowDlg(oUser);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     try
     {
         fUser frm = new fUser();
         frm.ItemChanged = RefreshList;
         frm.ShowDlg(new User());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }