Exemplo n.º 1
0
        private void AuditCheck(int auditId, bool isPass)
        {
            AuditRequest request = auditDal.GetAuditRequestById(auditId);

            if (request != null)
            {
                if (isPass)
                {
                    bool result = false;
                    switch (request.AuditType)
                    {
                    case "管理员注册":
                        AdminDal adminDal = new AdminDal();
                        result = adminDal.InsertAdmin(JsonConvert.DeserializeObject <AdminInfo>(request.Content));
                        break;

                    case "用户注册":
                        UserDal userDal = new UserDal();
                        result = userDal.InsertUser(JsonConvert.DeserializeObject <UserInfo>(request.Content));
                        break;

                    default:
                        break;
                    }
                    if (!result)
                    {
                        MessageBox.Show("审核通过失败");
                    }
                }
                request.AuditorId = StaticData.adminLocal.AdminId;
                request.IsPass    = isPass;
                bool isCheck = auditDal.Audit_Check(request);
                if (!isCheck)
                {
                    MessageBox.Show("审核处理失败");
                }
            }
        }