<%@ page contentType="text/html; charset=GB2312" %>
<%@page import="zr.zrpower.entity.sys.SessionUser"%>
<%@page import="zr.zrpower.ejb.sys.UIService"%>
<%@page import="zr.zrpower.ejb.sys.UserService" %>

<%@page import="java.lang.Object"%>
<%@ page import="java.io.*,java.text.*,java.util.*" %>
<HTML>
<%
  SessionUser user = (SessionUser) session.getAttribute("userinfo");
  UserService userService=new UserService();
  UIService userUI = new UIService();

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<link REL="stylesheet" type="text/css" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>"></HEAD>
<script src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js" type="text/jscript" ></script>
<script src="../../../zrsysmanage/html5/layer/layer.js"></script>
<BODY class="BodyMain">


<br>

<div align="center" style="font-size:18px;">
<font color=red>
<%
String PageSizeStr=request.getParameter("PAGESIZE");
int PageSize=Integer.parseInt(PageSizeStr);
String WindowType=request.getParameter("WINDOWTYPE");
boolean result=false;
try
{

  result=userService.ChangeAppCon( user.getUserID(),PageSize,WindowType);

          user.setUserWINDOWTYPE(WindowType);
          user.setUserPageSize(PageSize);
             if (WindowType.equals("1"))
             {
                 user.setUserCSS("Blue.css");
                 user.setUserImage("blueimg");
                 user.setUserIndexColor("#8DAAF4");
                 user.setWebEditCss("coolblue");
             }
             if (WindowType.equals("2"))
                {user.setUserCSS("Public.css");
                 user.setUserImage("publicimg");
                 user.setUserIndexColor("#94DD77");
                 user.setWebEditCss("green");
             }
             if (WindowType.equals("3"))
                {
                   user.setUserCSS("Yellow.css");
                   user.setUserImage("yellowimg");
                   user.setUserIndexColor("#F4CEA7");
                   user.setWebEditCss("yellow");
                }
             if (WindowType.equals("4"))
                 {
                   user.setUserCSS("Window.css");
                   user.setUserImage("windowimg");
                   user.setUserIndexColor("#C6C6C6");
                   user.setWebEditCss("light");
                 }
             if (WindowType.equals("5"))
                 {
                   user.setUserCSS("nBlue.css");
                   user.setUserImage("nblueimg");
                   user.setUserIndexColor("#7C85A2");
                   user.setWebEditCss("light");
                 }
               if (WindowType.equals("6"))
              {
                  user.setUserCSS("html5.css");
                  user.setUserImage("6");
                  user.setUserIndexColor("#C6C6C6");
                  user.setWebEditCss("light");
             }
               session.setAttribute("userinfo",user);

  }
   catch (Exception ex)
   {
      out.println("应用配置保存失败！<br>"+ex.toString());
      result=false;
    }
if(result)
{
  %>
      <SCRIPT LANGUAGE="JavaScript">
         <%if("6".equals(WindowType)){%>
            window.parent.location.href="../../../main1.jsp";
         <%}else{%>
            window.parent.location.href="../../../main.jsp";
         <%}%>
         //window.parent.location.reload();
         layer.alert('个性化设置成功,重新登录后生效！', {icon: 1});
         //alert("个性化设置成功,重新登录后生效！");

      </SCRIPT>
<%
}

%>
</font>
<br />
<br>
<br>
<br>
  <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
  <%=userUI.ClickButton("返 回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
  </tr></table>
                 </center>
</div>



</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
userService = null;
%>
