亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? accountaction.java

?? hibernate應用測試,初學hibernate 的會員可以看看.
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.action;

import org.apache.struts.action.*;
import java.io.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.sql.SQLException;

import com.bean.ClientTable;
import com.bean.CompUser;
import com.bean.StorehouseManager;
import com.dao.ClientTableDAO;
import com.dao.CompUserDAO;
import com.dao.AcountTableDAO;
import com.dao.AcountGroupDAO;
import com.dao.StorehouseManagerDAO;
import com.tool.pagetool.*;
import com.tool.QueryStrCreator;
import com.tool.LogTableWriter;
import com.bean.AcountTable;
import com.dao.RoleUrlDAO;
import com.dao.UrlAccountDAO;
import com.bean.UrlGroup;
import com.bean.RoleGroup;
import com.dao.RoleGroupDAO;
import com.dao.UrlGroupDAO;
import com.bean.UrlAccount;
import com.bean.AccountAndGroup;
import com.bean.AcountGroup;
import com.bean.StorehouseShmanagerView;
import com.dao.StorehouseShmanagerViewDAO;

public class AccountAction extends Action {
    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {
        request.setCharacterEncoding("gb2312");
        response.setContentType("text/html;charset=gb2312");
        String target = "";
        String flag = request.getParameter("flag");
        String type = request.getParameter("type");
        ActionErrors actionErrors = new ActionErrors();
        if (flag == null) flag = "";
        if (flag.equals("add")) { //添加賬號
            try {

                String accountName = request.getParameter("account");
                String pwd = request.getParameter("pwd");
                String typeFlag = request.getParameter("type");
                String idStr = request.getParameter("id");
                int lastId = AcountTableDAO.getLastId() + 1;
                int id = 0;

                //判斷賬號名是否存在
                boolean isHasFlag = AcountTableDAO.selectIsHasAccountName(
                        accountName);
                if (isHasFlag) {
                    AcountTableDAO.rollback();
                    ActionError actionError = new ActionError(
                            "errors.generally.failed", "賬號已存在");
                    actionErrors.add("", actionError);
                    saveErrors(request, actionErrors);
                    return mapping.findForward("addAccount");
                }
                AcountTableDAO.startTransation();
                AcountTable accountTable = new AcountTable();
                accountTable.setAccountName(accountName);
                accountTable.setPwd(pwd);
                accountTable.setAcountId(lastId);
                try {
                    id = new Integer(idStr).intValue();
                } catch (Exception e) {
                    e.printStackTrace();
                    AcountTableDAO.rollback();
                    ActionError actionError = new ActionError(
                            "errors.generally.failed", e.getMessage());
                    actionErrors.add("", actionError);
                    saveErrors(request, actionErrors);
                    return mapping.findForward("addAccount");
                }
                byte[] tmpC = type.getBytes("ISO8859-1");
                type = new String(tmpC, "gb2312");
                if (type.equals("client")) {
                    accountTable.setClientId(id);
                } else if (type.equals("compUser")) {
                    accountTable.setCompUserId(id);
                } else if (type.equals("shm")) {
                    accountTable.setShmId(id);
                }
                AcountTableDAO.insertAcountTable(accountTable);
                AcountTableDAO.commit();
                ActionError actionError = new ActionError(
                        "errors.addSuccese");
                actionErrors.add("addClientSuccese", actionError);
                saveErrors(request, actionErrors);
            } catch (Exception e) {
                e.printStackTrace();
                AcountTableDAO.rollback();
                ActionError actionError = new ActionError(
                        "errors.generally.failed", e.getMessage());
                actionErrors.add("", actionError);
                saveErrors(request, actionErrors);
            }
            target = "addAccount";
        } else if (type != null && flag.equals("")) { //打開導入信息窗口
            byte[] tmpC = type.getBytes("ISO8859-1");
            type = new String(tmpC, "gb2312");
            if (type.equals("client")) {
                target = "importClientForAddAccount";
                return mapping.findForward(target);
            } else if (type.equals("shm")) {
                target = "importShM";
                return mapping.findForward(target);
            } else if (type.equals("compUser")) {
                target = "importCompUserForAddAccount";
                return mapping.findForward(target);
            }
        } else if (flag.equals("showForSetRole")) { //列賬號信息,待設置權限
            initPage(request); //初始化分頁數據并放于request中
            target = "setAccountRole";
        } else if (flag.equals("gotoSetRole")) { //跳轉到當前賬號的權限設置界面
            String acountIdStr = request.getParameter("acountId");
            int acountId = -1;
            try {
                acountId = new Integer(acountIdStr).intValue();
                List allRole = RoleUrlDAO.selectAllRoleUrl(); //查出所有權限
                request.setAttribute("allRole", allRole);
                List theAcountRole = UrlAccountDAO.selectRoleByAccountId(
                        acountId); //查出當前賬號的權限,不包括組中的權限
                AcountTable acount = AcountTableDAO.selectAcountTableByacountId(
                        acountId); //當前賬號的基本信息
                request.setAttribute("allRole", allRole);
                request.setAttribute("theAcountRole", theAcountRole);
                request.setAttribute("acount", acount);
                target = "setAccountRoleItem";
            } catch (Exception e) {
                e.printStackTrace();
                target = "";
            }
        } else if (flag.equals("setRole")) {//執行設置權限
            String[] urlIdArray = request.getParameterValues("checkbox");
            String acountIdStr = request.getParameter("acountId");

            if (acountIdStr == null)return mapping.findForward(
                    "");
            try {
                UrlAccountDAO.startTransation();
                int lastId = UrlAccountDAO.getLastId();
                int acountId = new Integer(acountIdStr).intValue();
                if (urlIdArray == null) { //刪除賬號自已的所有權限
                    UrlAccountDAO.deleteUrlAccountByurlAccountId(acountId);
                } else {
                    UrlAccountDAO.deleteUrlAccountByurlAccountId(acountId); //先刪除再添加
                    int urlId = -1;
                    for (int i = 0; i < urlIdArray.length; i++) {
                        urlId = new Integer(urlIdArray[i]).intValue();
                        UrlAccount urlAccount = new UrlAccount();
                        urlAccount.setDelFlag(0);
                        urlAccount.setAccountId(acountId);
                        urlAccount.setUrlAccountId(lastId + i + 1);
                        urlAccount.setUrlId(urlId);
                        UrlAccountDAO.insertUrlAccount(urlAccount);
                    }
                }
                UrlAccountDAO.commit();
                ActionError actionError = new ActionError(
                        "errors.generally.succese");
                actionErrors.add("addGroupSuccese", actionError);
                saveErrors(request, actionErrors);
                List allRole = RoleUrlDAO.selectAllRoleUrl(); //查出所有權限
                request.setAttribute("allRole", allRole);
                List theAcountRole = UrlAccountDAO.selectRoleByAccountId(
                        acountId); //查出當前賬號的權限,不包括組中的權限
                AcountTable acount = AcountTableDAO.selectAcountTableByacountId(
                        acountId); //當前賬號的基本信息
                request.setAttribute("allRole", allRole);
                request.setAttribute("theAcountRole", theAcountRole);
                request.setAttribute("acount", acount);
            } catch (Exception e) {
                e.printStackTrace();
                UrlGroupDAO.rollback();
                ActionError actionError = new ActionError(
                        "errors.generally.failed", e.getMessage());
                actionErrors.add("addClientSuccese", actionError);
                saveErrors(request, actionErrors);
            }
            target = "setAccountRoleItem";
        } else if (flag.equals("addAcountToTeam") || flag.equals("forAddAcount")) {
            initPage(request);
            String groupIdStr = request.getParameter("groupId");
            try {
                int groupId = new Integer(groupIdStr).intValue();
                RoleGroup roleGroup = RoleGroupDAO.selectRoleGroupBygroupId(
                        groupId);
                request.setAttribute("roleGroup", roleGroup);
                target = "forTeamAAcount";
            } catch (Exception e) {
                e.printStackTrace();
                target = "";
            }
        } else if (flag.equals("showAcountDetail")) {
            String acountIdStr = request.getParameter("acountId");
            int acountId = -1;
            try {
                acountId = Integer.parseInt(acountIdStr);
                AccountAndGroup acountAndGroup = AcountTableDAO.
                                                 selectAcountAndGroupByAcountId(
                        acountId);
//                System.out.println("acount.getAcountName()="+acountAndGroup.getAccountName());
                request.setAttribute("acountAndGroup", acountAndGroup);
                if (acountAndGroup.getClientId() > 0) {
                    ClientTable client = ClientTableDAO.
                                         selectClientTableByclientId(
                                                 acountAndGroup.getClientId());
                    request.setAttribute("client", client);
                    target = "showAcountClient";
                } else if (acountAndGroup.getCompUserId() > 0) {
                    CompUser compUser = CompUserDAO.selectCompUserBycompUserId(
                            acountAndGroup.getCompUserId());
                    request.setAttribute("compUser", compUser);
                    target = "showAcountCompUser";
                } else if (acountAndGroup.getShmId() > 0) {
                    StorehouseShmanagerView shManager =
                            StorehouseShmanagerViewDAO.
                            selectStorehouseShmanagerViewByshmId(acountAndGroup.
                            getShmId());
                    request.setAttribute("shManager", shManager);
                    target = "showAcountSHM";
                } else {
                    target = "";
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (flag.equals("gotoEditAcount")) { //跳轉到編輯賬號
            initPage(request);
            List allRoleGroup = RoleGroupDAO.selectAllRoleGroup();
            request.setAttribute("allRoleGroup", allRoleGroup);
            target = "editAccount";
        } else if (flag.equals("getToOther")) { //將所選賬號移到所選取組
            String[] acountIdAndAcountGroupId = request.getParameterValues(
                    "checkbox"); //checkbox中的值的格式為:"acountId||acountGroupId"
            String groupIdStr = request.getParameter("groupId2");
            if (acountIdAndAcountGroupId == null || groupIdStr == null)return
                    mapping.findForward("");
            int groupId = -1;
            try {
                groupId = Integer.parseInt(groupIdStr);
                for (int i = 0; i < acountIdAndAcountGroupId.length; i++) {
                    String accountGroupIdStr = acountIdAndAcountGroupId[i].
                                               substring(
                            acountIdAndAcountGroupId[i].indexOf("||") + 2);
                    AcountGroup acountGroup = new AcountGroup();
                    acountGroup.setGroupId(groupId);
                    acountGroup.setSelfId(Integer.parseInt(accountGroupIdStr));
                    int tmpUpdateCount = AcountGroupDAO.
                                         updateGroupIdByAcountGroupId(
                                                 acountGroup);
                    if (tmpUpdateCount == 0) {
                        String accountIdStr = acountIdAndAcountGroupId[i].
                                              substring(
                                0, acountIdAndAcountGroupId[i].indexOf("||"));
                        int lastId = AcountGroupDAO.getLastId();
                        acountGroup.setSelfId(lastId + 1);
                        acountGroup.setAcountId(Integer.parseInt(accountIdStr));
                        AcountGroupDAO.insertAcountGroup(acountGroup);
                    }
                }
                ActionError actionError = new ActionError(
                        "errors.generally.succese");
                actionErrors.add("addGroupSuccese", actionError);
                saveErrors(request, actionErrors);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲专区一二三| 国产精品精品国产色婷婷| 在线观看91精品国产入口| 国产精品色哟哟| 欧美综合视频在线观看| 夜夜精品浪潮av一区二区三区| 色综合天天综合在线视频| √…a在线天堂一区| 日本韩国欧美在线| 日韩精品亚洲专区| 久久亚洲综合av| av一本久道久久综合久久鬼色| 亚洲欧洲av一区二区三区久久| 成人性生交大片免费看视频在线 | 日韩福利视频导航| 日韩精品一区二区三区视频播放| 国内外精品视频| 国产精品水嫩水嫩| 欧美日韩国产在线观看| 国产自产视频一区二区三区| 亚洲特级片在线| 3d成人动漫网站| 国产成人8x视频一区二区| 一区二区在线观看免费视频播放| 91精品国产综合久久精品app| 韩国女主播成人在线| 综合在线观看色| 日韩美一区二区三区| k8久久久一区二区三区| 免费日本视频一区| 中文字幕一区二区三区不卡| 91麻豆精品国产无毒不卡在线观看| 国产精品99久| 天堂成人免费av电影一区| 国产精品美女久久久久久久网站| 欧美久久久久久久久中文字幕| 成人中文字幕在线| 麻豆精品一区二区| 亚洲欧美日韩国产中文在线| 欧美电视剧在线看免费| 欧洲亚洲国产日韩| 国产成人夜色高潮福利影视| 午夜精品成人在线视频| 国产精品乱人伦中文| 欧美一卡2卡3卡4卡| 色老汉一区二区三区| 国产不卡在线视频| 毛片不卡一区二区| 午夜视频一区二区三区| 国产精品久久久久一区二区三区共 | 99精品热视频| 国产伦精品一区二区三区在线观看| 一个色综合网站| 国产精品久久久久久福利一牛影视| 一区二区免费看| 亚洲视频一区二区在线| 国产亚洲自拍一区| 精品99一区二区三区| 欧美美女一区二区三区| 在线欧美一区二区| 91久久精品日日躁夜夜躁欧美| jlzzjlzz亚洲女人18| 成人深夜视频在线观看| 国产精品一区二区三区99| 麻豆91在线观看| 秋霞影院一区二区| 日韩国产一二三区| 丝袜亚洲另类欧美| 视频一区欧美精品| 五月天中文字幕一区二区| 亚洲美腿欧美偷拍| 亚洲精品精品亚洲| 一区二区三区四区激情| 亚洲黄色录像片| 亚洲国产精品久久久久秋霞影院 | 亚洲女爱视频在线| ●精品国产综合乱码久久久久| 国产精品国模大尺度视频| 久久精品视频一区二区三区| 久久久久青草大香线综合精品| 2020国产精品| 久久久久久久综合| 国产精品视频在线看| 国产精品久久福利| 一区二区三区蜜桃| 天堂午夜影视日韩欧美一区二区| 日韩成人一级大片| 久久丁香综合五月国产三级网站| 国产精品一色哟哟哟| 99久久精品免费观看| 色噜噜狠狠色综合中国| 欧美精品v国产精品v日韩精品| 欧美一级搡bbbb搡bbbb| 久久五月婷婷丁香社区| 国产精品高潮呻吟久久| 亚洲精品成人少妇| 毛片一区二区三区| 成人天堂资源www在线| 色婷婷综合久久久| 日韩三级免费观看| 亚洲国产成人午夜在线一区| 亚洲精品国产无套在线观| 亚洲成a人片综合在线| 精品一区二区在线看| 国产91丝袜在线播放0| 色婷婷av一区二区三区之一色屋| 欧美日韩免费在线视频| 日韩免费性生活视频播放| 国产精品日韩精品欧美在线| 亚洲午夜私人影院| 国产在线乱码一区二区三区| 99久久综合精品| 欧美一区三区二区| 国产精品美女视频| 青青草91视频| 99re8在线精品视频免费播放| 欧美私人免费视频| 久久久久久99精品| 99久久夜色精品国产网站| 欧美视频三区在线播放| 久久久另类综合| 舔着乳尖日韩一区| youjizz久久| 精品国产乱码久久| 亚洲福利视频一区| 不卡av免费在线观看| 日韩亚洲欧美在线| 亚洲自拍偷拍图区| 成人av电影在线网| 欧美mv和日韩mv的网站| 亚洲线精品一区二区三区| 成人免费av网站| 久久久亚洲高清| 日韩av一区二区三区四区| 色婷婷综合中文久久一本| 国产日韩欧美高清在线| 日本视频一区二区| 91成人国产精品| 中文字幕在线免费不卡| 国产呦精品一区二区三区网站| 69久久夜色精品国产69蝌蚪网| 亚洲欧美经典视频| 成人网男人的天堂| 中文字幕欧美激情一区| 狠狠色狠狠色合久久伊人| 欧美日韩成人一区| 亚洲精品国产a久久久久久 | 国产欧美精品日韩区二区麻豆天美| 亚洲 欧美综合在线网络| zzijzzij亚洲日本少妇熟睡| 久久久国际精品| 国产伦精品一区二区三区视频青涩| 日韩视频一区二区三区| 日韩电影免费在线| 91精品国产综合久久久久| 亚洲午夜久久久久久久久久久| 91丝袜美女网| 最新成人av在线| 一本大道久久a久久精品综合| 中文字幕一区二| av午夜精品一区二区三区| 中文字幕精品三区| aaa欧美日韩| 一区在线播放视频| 一本到不卡免费一区二区| 自拍偷拍国产亚洲| 色综合久久88色综合天天6| 一区视频在线播放| 99久久精品国产一区| 亚洲女与黑人做爰| 欧美日韩综合在线| 丝瓜av网站精品一区二区| 欧美乱妇15p| 久久av资源网| 国产亲近乱来精品视频| 日韩三级在线免费观看| 精品一区二区三区久久久| 精品国产不卡一区二区三区| 国产自产视频一区二区三区| 欧美激情一二三区| 91网站最新地址| 亚洲午夜久久久久久久久电影网 | 日韩精品一区二区三区在线观看| 日本人妖一区二区| 国产午夜亚洲精品不卡| 91一区二区三区在线观看| 亚洲综合在线免费观看| 欧美日韩1234| 国产成人免费视频网站| 日韩理论在线观看| 欧美一级精品大片| 国产+成+人+亚洲欧洲自线| 亚洲欧洲av在线| 欧美人妖巨大在线| 国产一区二区福利| 一区二区在线观看不卡| 欧美一级在线视频| 99久久99久久精品免费观看 | 久热成人在线视频| 国产精品女同一区二区三区|