Esempio n. 1
0
        // 刷新列表
        private void refreshList()
        {
            Cursor = Cursors.WaitCursor;
            List <AuditRequest> auditRequests = auditDal.GetAuditRequests(comboBox1.Text);

            if (auditRequests == null || auditRequests.Count == 0)
            {
                lvAuditList.BeginUpdate();
                lvAuditList.Items.Clear();
                lvAuditList.EndUpdate();
                Cursor = Cursors.Default;
                return;
            }
            lvAuditList.BeginUpdate();
            lvAuditList.Items.Clear();

            if (comboBox1.Text == "管理员注册")
            {
                colLicense.Width = 0;
                AdminInfo adminTemp;
                for (int i = 0; i < auditRequests.Count; i++)
                {
                    lvAuditList.Items.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    adminTemp = JsonConvert.DeserializeObject <AdminInfo>(auditRequests[i].Content);
                    lvAuditList.Items[i].SubItems[1].Text = auditRequests[i].Id.ToString();
                    lvAuditList.Items[i].SubItems[2].Text = adminTemp.AdminName;
                    lvAuditList.Items[i].SubItems[3].Text = adminTemp.AdminPhone;
                    lvAuditList.Items[i].SubItems[4].Text = adminTemp.AdminRealName;
                    lvAuditList.Items[i].SubItems[5].Text = adminTemp.AdminIdentity;
                    lvAuditList.Items[i].SubItems[6].Text = adminTemp.AdminAddress;
                    lvAuditList.Items[i].SubItems[7].Text = "";
                }
            }
            else if (comboBox1.Text == "用户注册")
            {
                colLicense.Width = 100;
                UserInfo userTemp;
                for (int i = 0; i < auditRequests.Count; i++)
                {
                    lvAuditList.Items.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    lvAuditList.Items[i].SubItems.Add("");
                    userTemp = JsonConvert.DeserializeObject <UserInfo>(auditRequests[i].Content);
                    lvAuditList.Items[i].SubItems[1].Text = auditRequests[i].Id.ToString();
                    lvAuditList.Items[i].SubItems[2].Text = userTemp.UserName;
                    lvAuditList.Items[i].SubItems[3].Text = userTemp.UserPhone;
                    lvAuditList.Items[i].SubItems[4].Text = userTemp.UserRealName;
                    lvAuditList.Items[i].SubItems[5].Text = userTemp.UserIdentity;
                    lvAuditList.Items[i].SubItems[6].Text = userTemp.UserAddress;
                    lvAuditList.Items[i].SubItems[7].Text = userTemp.UserDriLicense;
                }
            }
            lvAuditList.EndUpdate();
            Cursor = Cursors.Default;
        }