Example #1
0
        private void btnUTCrudDetails_Click(object sender, EventArgs e)
        {
            int            userTypeIndex = dgvUTTable.CurrentCell.RowIndex;
            UserTypeEntity userType      = AllUserTypes.ElementAt(userTypeIndex);
            CRUD_UserType  crudUserType  = new CRUD_UserType(userType);

            crudUserType.makeReadOnly();
            crudUserType.Show();
        }
Example #2
0
        private void btnUTCrudAdd_Click(object sender, EventArgs e)
        {
            UserTypeEntity ut     = new UserTypeEntity();
            CRUD_UserType  crudUT = new CRUD_UserType(ut);

            crudUT.ShowDialog();
            if (crudUT.DialogResult == DialogResult.OK)
            {
                AllUserTypes.Add(ut);
                dgvUTTable.Invalidate();
            }
        }
Example #3
0
        private void btnUTCrudEdit_Click(object sender, EventArgs e)
        {
            int            userTypeIndex = dgvUTTable.CurrentCell.RowIndex;
            UserTypeEntity userType      = AllUserTypes.ElementAt(userTypeIndex);

            CRUD_UserType crudUserType = new CRUD_UserType(userType);

            crudUserType.editing = true;
            crudUserType.ShowDialog();

            if (crudUserType.DialogResult == DialogResult.OK)
            {
                dgvUTTable.InvalidateRow(userTypeIndex);
            }
        }