Ejemplo n.º 1
0
        private void BtnAddUser_Click(object sender, EventArgs e)
        {
            if (!Util.Func.IsUserAllowed(user, Util.PermissionAlertType.Message, this.ParentForm))
            {
                return;
            }

            Blur blur = new Blur(this.ParentForm, 0.60);

            blur.Show();

            Forms.User createUserForm = new Forms.User
            {
                Task    = Enums.Task.Create,
                TopMost = true
            };

            //Update
            var dialogResult = createUserForm.ShowWithDialog();

            if (dialogResult == Enums.ActionDialog.Created)
            {
                //Delete To Avoid Duplicate
                UsersGrid.Controls.Clear();
                GetUsers();
            }
            blur.Close();
        }
Ejemplo n.º 2
0
        private void OnClick(object sender, EventArgs e)
        {
            Blur blur = new Blur(this.ParentForm, UIConstants.FormBlurOpacity);

            blur.Show();

            // Open User Details
            Forms.User UserDetails = new Forms.User
            {
                //Task = Enums.Task.Get,
                CurrentUser = User,
                TopMost     = true
            };
            //UserDetails.ShowDialog();
            var dialogResult = UserDetails.ShowWithDialog();

            if (dialogResult == Enums.ActionDialog.Updated)
            {
                //Update
                var response = QueryController.User.Get(User);
                if (response.StatusCode == 200)
                {
                    User = (Backend.Objects.User)response.Data;
                }

                var c = User;
                Initialize();
            }
            else if (dialogResult == Enums.ActionDialog.Deleted)
            {
                // Remove from Parent
                this.Hide();
            }


            blur.Close();
        }