Ejemplo n.º 1
0
        public ActionResult Index(String userId)
        {
            UserAuthUtil authUtil = new UserAuthUtil();

            String opScope = "";

            String[] roleInfo = authUtil.chkUserFuncAuth(Session["UserID"].ToString(), "~/UserMgr/");
            if (roleInfo != null && roleInfo.Length == 1)
            {
                opScope = "1";
                //roleId = roleInfo[1];
                //funcType = roleInfo[2];
            }


            ViewBag.opScope = opScope;

            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();


            //啟用狀態
            var isDisabledList = sysCodeDao.loadSelectList("IS_DISABLED");

            ViewBag.isDisabledList = isDisabledList;

            //是否寄送MAIL
            var isMailList = sysCodeDao.loadSelectList("YN_FLAG");

            ViewBag.isMailList = isMailList;

            //角色群組
            var roleAuthTypeList = sysCodeDao.loadSelectList("ROLE_AUTH_TYPE");

            ViewBag.roleAuthTypeList = roleAuthTypeList;

            //角色名稱
            CodeRoleDao codeRoleDao  = new CodeRoleDao();
            var         CodeRoleList = codeRoleDao.loadSelectList();

            ViewBag.CodeRoleList = CodeRoleList;

            //異動人員
            CodeUserDao codeUserDao  = new CodeUserDao();
            var         CodeUserList = codeUserDao.loadSelectList();

            ViewBag.CodeUserList = CodeUserList;

            if (userId != null)
            {
                UserMgrModel userMgrModel = new UserMgrModel();
                userMgrModel.cUserID = userId;
                ViewBag.cUserID      = userId;
                return(View(userMgrModel));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult userHis(String cUserID)
        {
            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();


            //覆核狀態
            var apprStatusList = sysCodeDao.loadSelectList("APPR_STATUS");

            apprStatusList = new SelectList(apprStatusList
                                            .Where(x => x.Value != "4")
                                            .ToList(),
                                            "Value",
                                            "Text");

            ViewBag.apprStatusList = apprStatusList;


            if (!"".Equals(StringUtil.toString(cUserID)))
            {
                UserMgrModel userMgrModel = new UserMgrModel();
                userMgrModel.cUserID = cUserID;
                List <UserMgrModel> rows = qryUserData(userMgrModel);


                ViewBag.cUserID = cUserID;
                return(View(rows[0]));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        /**
         * 畫面初始
         **/
        public ActionResult Index()
        {
            UserAuthUtil authUtil = new UserAuthUtil();

            String opScope  = "";
            String roleId   = "";
            String funcType = "";

            String[] roleInfo = authUtil.chkUserFuncAuth(Session["UserID"].ToString(), "~/FuncMgr/");
            if (roleInfo != null && roleInfo.Length == 1)
            {
                opScope = "1";// roleInfo[0];
                //roleId = roleInfo[1];
                //funcType = roleInfo[2];
            }


            ViewBag.opScope = opScope;

            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();
            //停用註記
            var FlagList = sysCodeDao.loadSelectList("IS_DISABLED");

            ViewBag.FlagList = FlagList;

            return(View());
        }
Ejemplo n.º 4
0
        public ActionResult roleHis(String cRoleID)
        {
            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();


            //覆核狀態
            var apprStatusList = sysCodeDao.loadSelectList("APPR_STATUS");

            apprStatusList = new SelectList(apprStatusList
                                            .Where(x => x.Value != "4")
                                            .ToList(),
                                            "Value",
                                            "Text");

            ViewBag.apprStatusList = apprStatusList;

            //角色群組
            var roleAuthTypeList = sysCodeDao.loadSelectList("ROLE_AUTH_TYPE");

            ViewBag.roleAuthTypeList = roleAuthTypeList;


            RoleMgrHisModel roleMgrHisModel = new RoleMgrHisModel();


            if (!"".Equals(StringUtil.toString(cRoleID)))
            {
                CodeRoleDao codeRoleDao = new CodeRoleDao();
                CODE_ROLE   codeRole    = new CODE_ROLE();
                codeRole = codeRoleDao.qryRoleByKey(cRoleID);


                roleMgrHisModel.cRoleID      = StringUtil.toString(codeRole.ROLE_ID);
                roleMgrHisModel.cRoleName    = StringUtil.toString(codeRole.ROLE_NAME);
                roleMgrHisModel.roleAuthType = StringUtil.toString(codeRole.ROLE_AUTH_TYPE);

                ViewBag.cRoleID = cRoleID;
                return(View(roleMgrHisModel));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 5
0
        public ActionResult Index(String cRoleID)
        {
            UserAuthUtil authUtil = new UserAuthUtil();
            String       opScope  = "";
            String       roleId   = "";
            String       funcType = "";

            String[] roleInfo = authUtil.chkUserFuncAuth(Session["UserID"].ToString(), "~/RoleMgr/");
            if (roleInfo != null && roleInfo.Length == 1)
            {
                opScope = "1";
                //roleId = roleInfo[1];
                //funcType = roleInfo[2];
            }


            ViewBag.opScope = opScope;

            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();


            //啟用狀態
            var isDisabledList = sysCodeDao.loadSelectList("IS_DISABLED");

            ViewBag.isDisabledList = isDisabledList;

            //角色群組
            var roleAuthTypeList = sysCodeDao.loadSelectList("ROLE_AUTH_TYPE");

            ViewBag.roleAuthTypeList = roleAuthTypeList;

            //角色名稱
            CodeRoleDao codeRoleDao  = new CodeRoleDao();
            var         CodeRoleList = codeRoleDao.loadSelectList();

            ViewBag.CodeRoleList = CodeRoleList;

            //異動人員
            CodeUserDao codeUserDao  = new CodeUserDao();
            var         CodeUserList = codeUserDao.loadSelectList();

            ViewBag.CodeUserList = CodeUserList;

            RoleMgrModel roleMgrModel = new RoleMgrModel();


            if (!"".Equals(StringUtil.toString(cRoleID)))
            {
                CODE_ROLE codeRole = new CODE_ROLE();
                codeRole = codeRoleDao.qryRoleByKey(cRoleID);


                roleMgrModel.cRoleID      = StringUtil.toString(codeRole.ROLE_ID);
                roleMgrModel.cRoleName    = StringUtil.toString(codeRole.ROLE_NAME);
                roleMgrModel.roleAuthType = StringUtil.toString(codeRole.ROLE_AUTH_TYPE);
                roleMgrModel.isDisabled   = StringUtil.toString(codeRole.IS_DISABLED);
                roleMgrModel.vMemo        = StringUtil.toString(codeRole.MEMO);
                roleMgrModel.cUpdUserID   = StringUtil.toString(codeRole.LAST_UPDATE_UID);

                ViewBag.cRoleID = cRoleID;
                return(View(roleMgrModel));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 6
0
        /**
         * 角色資訊(含功能授權)
         **/
        public ActionResult detailRole(string cRoleId, string execType)
        {
            /*---畫面下拉選單初始值---*/

            //金庫設備
            TreaEquipDao treaEquipDao = new TreaEquipDao();

            ViewBag.equipList = treaEquipDao.jqgridSelect();

            //存取項目
            TreaItemDao treaItemDao = new TreaItemDao();

            ViewBag.itemList = treaItemDao.jqgridSelect("");

            SysCodeDao sysCodeDao = new SysCodeDao();

            //停用註記
            var isDisabledList = sysCodeDao.loadSelectList("IS_DISABLED");

            ViewBag.isDisabledList = isDisabledList;

            //角色群組
            var roleAuthTypeList = sysCodeDao.loadSelectList("ROLE_AUTH_TYPE");

            ViewBag.roleAuthTypeList = roleAuthTypeList;

            //控管模式
            var controlList = sysCodeDao.loadSelectList("CONTROL_MODE");

            ViewBag.controlList = controlList;
            //ViewBag.controlList = sysCodeDao.jqGridList("CONTROL_MODE");


            //控管方式
            var custodyList = sysCodeDao.loadSelectList("CUSTODY_MODE");

            ViewBag.custodyList = custodyList;
            //ViewBag.custodyList = sysCodeDao.jqGridList("CUSTODY_MODE");


            //入庫作業類型
            ViewBag.itemOpTypeList = sysCodeDao.jqGridList("ITEM_OP_TYPE");



            //覆核狀態  add by daiyu 20180214
            Dictionary <string, string> dicReview = sysCodeDao.qryByTypeDic("DATA_STATUS");



            //查詢角色資訊
            CodeRoleDao codeRoleDao = new CodeRoleDao();
            CODE_ROLE   codeRole    = new CODE_ROLE();

            if (cRoleId != null)
            {
                codeRole = codeRoleDao.qryRoleByKey(cRoleId);
            }



            //將值搬給畫面欄位
            RoleMgrModel roleMgrModel = new RoleMgrModel();

            qryUserFunc(cRoleId);  //取得已授權、未授權功能清單

            if (!"".Equals(StringUtil.toString(codeRole.ROLE_ID)))
            {
                roleMgrModel.cRoleID      = StringUtil.toString(codeRole.ROLE_ID);
                roleMgrModel.cRoleName    = StringUtil.toString(codeRole.ROLE_NAME);
                roleMgrModel.roleAuthType = StringUtil.toString(codeRole.ROLE_AUTH_TYPE);
                roleMgrModel.isDisabled   = StringUtil.toString(codeRole.IS_DISABLED);
                roleMgrModel.vMemo        = StringUtil.toString(codeRole.MEMO);
                roleMgrModel.dataStatus   = StringUtil.toString(codeRole.DATA_STATUS) == "" ? "" : codeRole.DATA_STATUS + "." + dicReview[codeRole.DATA_STATUS];

                roleMgrModel.cCrtDateTime = codeRole.CREATE_DT == null ? "" : DateUtil.DatetimeToString(codeRole.CREATE_DT, "");

                roleMgrModel.cUpdDateTime = codeRole.LAST_UPDATE_DT == null ? "" : DateUtil.DatetimeToString(codeRole.LAST_UPDATE_DT, "");

                OaEmpDao oaEmpDao = new OaEmpDao();
                using (DB_INTRAEntities dbIntra = new DB_INTRAEntities())
                {
                    try
                    {
                        roleMgrModel.cCrtUserID = codeRole.CREATE_UID == null ? "" : StringUtil.toString(oaEmpDao.qryByUsrId(codeRole.CREATE_UID, dbIntra).EMP_NAME);
                    }
                    catch (Exception e)
                    {
                    }

                    try
                    {
                        roleMgrModel.cUpdUserID = codeRole.LAST_UPDATE_UID == null ? "" : StringUtil.toString(oaEmpDao.qryByUsrId(codeRole.LAST_UPDATE_UID, dbIntra).EMP_NAME);
                    }
                    catch (Exception e)
                    {
                    }
                }


                roleMgrModel.Categories = ViewBag.funcList;

                ViewBag.bHaveData = "Y";
                //return RedirectToAction("Index", "Home");
                return(View(roleMgrModel));
            }
            else
            {
                if ("A".Equals(execType))
                {
                    qryUserFunc("");  //取得已授權、未授權功能清單

                    roleMgrModel.cRoleID      = "";
                    roleMgrModel.cRoleName    = "";
                    roleMgrModel.isDisabled   = "N";
                    roleMgrModel.vMemo        = "";
                    roleMgrModel.cCrtUserID   = "";
                    roleMgrModel.cCrtDateTime = "";
                    roleMgrModel.cUpdUserID   = "";
                    roleMgrModel.cUpdDateTime = "";
                    roleMgrModel.dataStatus   = "";

                    roleMgrModel.Categories = ViewBag.funcList;
                    ViewBag.bHaveData       = "Y";
                    return(View(roleMgrModel));
                }
                else
                {
                    ViewBag.bHaveData = "N";
                    return(View("detailRole"));
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 使用者資訊codeUser
        /// </summary>
        /// <param name="cUserID"></param>
        /// <returns></returns>
        public ActionResult detailUser(string userId)
        {
            /*---畫面下拉選單初始值---*/
            SysCodeDao sysCodeDao = new SysCodeDao();


            //啟用狀態
            var isDisabledList = sysCodeDao.loadSelectList("IS_DISABLED");

            ViewBag.isDisabledList = isDisabledList;

            //是否寄送MAIL
            var isMailList = sysCodeDao.loadSelectList("YN_FLAG");

            ViewBag.isMailList = isMailList;


            //角色群組
            var roleAuthTypeList = sysCodeDao.jqGridList("ROLE_AUTH_TYPE");

            ViewBag.roleAuthTypeList = roleAuthTypeList;


            ////查詢使用者資訊
            //CodeUserDao codeUserDao = new CodeUserDao();
            //CODEUSER codeUser = codeUserDao.qryByKey(cUserID);


            ////查詢角色
            CodeRoleDao codeRoleDao = new CodeRoleDao();
            var         roleStr     = codeRoleDao.jqGridRoleList("");

            ViewBag.roleList = roleStr;



            //將值搬給畫面欄位
            UserMgrModel userMgrModel = new UserMgrModel();

            if ("".Equals(StringUtil.toString(userId)))
            {
                ViewBag.bHaveData = false;
                return(View(userMgrModel));
            }


            userMgrModel.cUserID = userId;
            List <UserMgrModel> rows = qryUserData(userMgrModel);

            if (rows.Count > 0)
            {
                ViewBag.bHaveData = true;

                //return RedirectToAction("Index", "Home");
                return(View(rows[0]));
            }
            else
            {
                ViewBag.bHaveData = false;
                return(View(userMgrModel));
            }
        }