예제 #1
0
        public ActionResult AddHouseDetails(HouseDetails house, long allotId, int fxtcompanyId, int cityId, UserCenter_LoginUserInfo loginUser)
        {
            DatAllotFlow allot = DatAllotFlowManager.GetDatAllotFlowById(allotId);

            if (allot == null)
            {
                return(WebUserHelp.GetAction404Page());//无此页面
            }
            //登陆用户所在小组
            PriviDepartmentUser loginDepartment = PriviDepartmentUserManager.GetDepartmentUserByUserName(loginUser.NowCityId, loginUser.FxtCompanyId, loginUser.UserName);
            //当前信息的发起用户所在小组
            PriviDepartmentUser infoStartDepartment = PriviDepartmentUserManager.GetDepartmentUserByUserName(loginUser.NowCityId, allot.FxtCompanyId, allot.UserName);
            //当前信息的用户所在小组
            PriviDepartmentUser infoDepartment = PriviDepartmentUserManager.GetDepartmentUserByUserName(loginUser.NowCityId, allot.FxtCompanyId, allot.SurveyUserName);

            #region 验证查看权限
            //获取当前用户对任务列表页拥有的权限(验证查看权限)
            List <int> nowFunctionCodes = WebUserHelp.GetNowPageFunctionCodes(loginUser.UserName, loginUser.FxtCompanyId, WebCommon.Url_AllotFlowInfo_AllotFlowManager);
            //是否用于查看权限
            if (!WebUserHelp.CheckNowPageViewFunctionCode(nowFunctionCodes.ToArray(), loginUser.UserName, allot.UserName, allot.SurveyUserName,
                                                          loginDepartment == null ? 0 : loginDepartment.DepartmentID, infoStartDepartment == null ? 0 : infoStartDepartment.DepartmentID,
                                                          infoDepartment == null ? 0 : infoDepartment.DepartmentID))
            {
                return(WebUserHelp.GetActionNotRightPage());//无权限
            }
            #endregion

            //户型结构
            ViewBag.StructureCode = SYSCodeManager.StructureCodeManager();
            //通风采光
            ViewBag.VDCode = SYSCodeManager.VDCodeManager();
            //噪音情况
            ViewBag.Noise = SYSCodeManager.NoiseManager();
            //用途
            ViewBag.PurposeCode = SYSCodeManager.HousePurposeCodeManager();

            #region 验证修改权限
            //获取当前用户对当前页拥有的权限
            List <int> nowFunctionCodes2 = WebUserHelp.GetNowPageFunctionCodes(loginUser.UserName, loginUser.FxtCompanyId, WebCommon.Url_AllotFlowInfo_AllotDetailed);
            if (WebUserHelp.CheckNowPageUpdateFunctionCode(nowFunctionCodes2.ToArray(), loginUser.UserName, allot.SurveyUserName,
                                                           loginDepartment == null ? 0 : loginDepartment.DepartmentID, infoDepartment == null ? 0 : infoDepartment.DepartmentID, allot.SurveyUserName) &&
                (allot.StateCode != SYSCodeManager.STATECODE_10))
            {
                ViewBag.IsUpdateRight = 1;//有权限
            }
            #endregion
            if (house.Id > 0)
            {
                return(View(_unitOfWork.HouseDetailsRepository.GetById(house.Id)));
            }
            else
            {
                return(View(house));
            }
        }
예제 #2
0
        public ActionResult SetDepartment(string departmentId, string companyName)
        {
            UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser();
            int result = 1;

            companyName = companyName.DecodeField();
            if (departmentId.CheckInteger())//修改
            {
                List <int>      functionCodes = WebUserHelp.GetNowPageFunctionCodes(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_DepartmentInfo_DepartmentManager);
                PriviDepartment department    = PriviDepartmentManager.GetDepartmentById(Convert.ToInt32(departmentId));
                if (functionCodes.Contains(SYSCodeManager.FunOperCode_7))
                {
                }
                else if (functionCodes.Contains(SYSCodeManager.FunOperCode_5))//修改自己
                {
                    PriviDepartment nowDep = PriviDepartmentManager.GetDepartmentByUserName(WebUserHelp.GetNowCityId(), loginUserInfo.FxtCompanyId, loginUserInfo.UserName);
                    if (nowDep == null || !nowDep.DepartmentId.ToString().Equals(departmentId))
                    {
                        return(WebUserHelp.GetActionNotRightPage());//无权限
                    }
                }
                else
                {
                    return(WebUserHelp.GetActionNotRightPage());//无权限
                }
                if (department != null)
                {
                    ViewBag.DepartmentName = department.DepartmentName;
                    ViewBag.DepartmentId   = departmentId;
                }
                else
                {
                    result = 0;
                }
            }
            else//新增
            {
                if (!WebUserHelp.CheckNowPageFunctionCode(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_DepartmentInfo_DepartmentManager, SYSCodeManager.FunOperCode_4))
                {
                    return(WebUserHelp.GetActionNotRightPage());//无权限
                }
            }
            ViewBag.Result      = result;
            ViewBag.CompanyName = companyName;
            return(View());
        }