public void updateData() { UserHandleNsTalk talk = new UserHandleNsTalk(); Protocol pro = talk.Get_All_User_Info(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { List<string> columnName = new List<string>(); columnName.Add("用户名"); columnName.Add("权限"); this.userDataGridView.DataSource = TableDataUtil.convertListListDataToDataTable(columnName, pro.data); if (canEdit) { foreach (DataGridViewRow row in this.userDataGridView.Rows) { row.ContextMenuStrip = this.contextMenuStrip1; } } } }
private void U_Modify_BackgroundWorker( object sender, RunWorkerCompletedEventArgs e) { UserHandleNsTalk talk = new UserHandleNsTalk(); Protocol pro = talk.Get_All_User_Info(ClientInfo.session); if (pro.protoType == ProtoType.SUCCESS) { OpenUShowForm(pro, true); } else if (pro.protoType == ProtoType.OUT_OF_TIME) { MessageBox.Show("系统超时,请重新登录"); LoginForm lg = new LoginForm(); lg.Show(); this.Hide(); } else if (pro.protoType == ProtoType.ERROR) { MessageBox.Show("获取信息错误,请重新获取"); } }