Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            UserAddEditDialog add = new UserAddEditDialog(this.main_form);

            if (add.ShowDialog() == DialogResult.OK)
            {
                this.RefreshGridUsers();
            }
        }
Exemplo n.º 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int user_id = (int)this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, colId);

            try
            {
                APIResult result = APIClient.GET(this.main_form.config.ApiUrl + "users/", this.main_form.config.ApiKey, "&id=" + user_id);

                if (result.Success && result.ReturnValue != null)
                {
                    InternalUsers     user = JsonConvert.DeserializeObject <InternalUsers>(result.ReturnValue);
                    UserAddEditDialog edit = new UserAddEditDialog(this.main_form, user);
                    if (edit.ShowDialog() == DialogResult.OK)
                    {
                        this.RefreshGridUsers();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }