public ActionResult Partial_Menu() { List <WebMenuClass> list = WebUserHelp.GetNowLoginMenu(); ViewBag.Menus = list; return(PartialView()); }
public ActionResult AllotFlowInfo(string statuscode) { List <UserCenter_Apps> appList = new List <UserCenter_Apps>(); UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(out appList); int cityId = WebUserHelp.GetNowCityId(); List <SYSCode> colist = DataCenterCodeApi.GetCodeById(1035, loginUserInfo.UserName, loginUserInfo.SignName, appList); List <FxtApi_SYSArea> areaList = SYSAreaManager.GetAreaByCityId(cityId, loginUserInfo.UserName, loginUserInfo.SignName, appList); ViewBag.AreaList = areaList; //状态code ViewBag.AllotStatus1 = SYSCodeManager.STATECODE_1; ViewBag.AllotStatus2 = SYSCodeManager.STATECODE_2; ViewBag.AllotStatus4 = SYSCodeManager.STATECODE_4; //功能code ViewBag.FunctionCode14 = SYSCodeManager.FunOperCode_14; ViewBag.FunctionCode15 = SYSCodeManager.FunOperCode_15; ViewBag.FunctionCode16 = SYSCodeManager.FunOperCode_16; //获取当前用户在此页面所有的操作权限 List <int> functionCodes = WebUserHelp.GetNowPageFunctionCodes(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_AllotFlowInfo_AllotFlowManager); ViewBag.FunctionCodes = functionCodes; if (!string.IsNullOrEmpty(statuscode) && statuscode != "0") { ViewBag.NowStatus = statuscode; } ViewBag.IomportAllotRight = 0; if (functionCodes.Contains(SYSCodeManager.FunOperCode_10)) { ViewBag.IomportAllotRight = 1; } return(View()); }
public ActionResult EditUser(string userName) { ViewBag.DeparUrl = WebCommon.Url_DepartmentInfo_DepartmentManager; //获取用户信息 PriviDepartmentUser pdu = null; IList <SYSRoleUser> roleUserList = new List <SYSRoleUser>(); List <UserCenter_Apps> appList = new List <UserCenter_Apps>(); UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(out appList); int cityId = WebUserHelp.GetNowCityId(); int companyId = loginUserInfo.FxtCompanyId; string loginusername = loginUserInfo.UserName; string loginsignname = loginUserInfo.SignName; UserCenter_UserInfo userInfo = UserInfoManager.GetUserInfoByUserName(cityId, companyId, userName, loginsignname, loginsignname, appList, out pdu, out roleUserList); if (userInfo != null) { //输出给页面变量 ViewBag.CompanyName = userInfo.CompanyName; ViewBag.UserName = userInfo.UserName; ViewBag.TrueName = userInfo.TrueName; ViewBag.Mebile = userInfo.Mobile; if (pdu != null) { ViewBag.DepartmentId = pdu.DepartmentID; } ViewBag.RoleUserList = roleUserList; } //获取小组+角色基础信息 IList <SYSRole> roleList = SYSRoleManager.GetSYSRoleByCompanyId(cityId, companyId); IList <PriviDepartment> pdList = PriviDepartmentManager.GetDepartmentByCompanyId(cityId, companyId); ViewBag.DepartmentList = pdList; ViewBag.RoleList = roleList; return(View()); }
public ActionResult Index(LoginUser userInfo) { var province = WebUserHelp.GetNowProvinceId(); var city = WebUserHelp.GetNowCityId(); //省份 List <FxtApi_SYSProvince> provinceList = _unitOfWork.CityService.GetProvinceCityListBy(userInfo.UserName, userInfo.SignName, userInfo.AppList); if (provinceList.Where(m => m.CityList.Any(c => c.CityId == city)).Count() < 1) { WebUserHelp.SetNowProvinceAndCity(0, 0); } ViewBag.UserName = userInfo.TrueName; ViewBag.ProvinceList = provinceList; ViewBag.NowProvinceId = WebUserHelp.GetNowProvinceId(); ViewBag.NowCityId = city; ViewBag.MenuList = GetMenuDtoList(userInfo.UserName, userInfo.NowCityId, userInfo.FxtCompanyId, userInfo); return(View()); }
public ActionResult EditUser_SubmitData_Api(string userName, string truename, string departmentId, string roleIds) { string json = ""; int? _departmentId = null; int[] _roleIds = null; if (string.IsNullOrEmpty(userName)) { Response.Write(json.MvcResponseJson(result: 0, message: "请填写用户名")); Response.End(); return(null); } //获取提交数据 UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(); int cityId = WebUserHelp.GetNowCityId(); int companyId = loginUserInfo.FxtCompanyId; string loginusername = loginUserInfo.UserName; string loginsignname = loginUserInfo.SignName; if (StringHelp.CheckInteger(departmentId) && departmentId != "0") { _departmentId = Convert.ToInt32(departmentId); } _roleIds = roleIds.ConvertToInts(','); //提交数据 string message = ""; bool result = UserInfoManager.SetUserInfo(cityId, companyId, userName, truename, _departmentId, _roleIds, out message); if (!result) { Response.Write(json.MvcResponseJson(result: 0, message: "提交失败:" + message)); Response.End(); return(null); } IList <SYSRole> roleList = SYSRoleManager.GetSYSRoleByRoleIds(_roleIds); StringBuilder roleNameSb = new StringBuilder(""); string departmentName = ""; foreach (SYSRole roleInfo in roleList) { roleNameSb.Append(roleInfo.RoleName).Append(","); } if (Convert.ToInt32(_departmentId) > 0) { PriviDepartment pd = PriviDepartmentManager.GetDepartmentById(Convert.ToInt32(_departmentId)); if (pd != null) { departmentName = pd.DepartmentName; } } json = string.Format("{{\"username\":\"{0}\",\"truename\":\"{1}\",\"departmentname\":\"{2}\",\"rolename\":\"{3}\"}}", userName, truename, departmentName, roleNameSb.ToString()); Response.Write(json.MvcResponseJson(result: 1, message: "")); Response.End(); return(null); }
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)); } }
public ActionResult BuildingIndex(int projectId, UserCenter_LoginUserInfo loginUserInfo) { //获取当前用户在此页面所有的操作权限 List <int> functionCodes = WebUserHelp.GetNowPageFunctionCodes(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_AllotFlowInfo_AllotFlowManager); ViewBag.FunctionCodes = functionCodes; ViewBag.ProjectID = projectId; return(View()); }
public ActionResult Partial_UserInfo() { UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(); ViewBag.UserName = loginUserInfo.UserName; if (!string.IsNullOrEmpty(loginUserInfo.TrueName)) { ViewBag.UserName = loginUserInfo.TrueName; } return(PartialView()); }
public ActionResult Partial_SelectCity(string callbackUrl) { var userInfo = WebUserHelp.GetNowLoginUser(); //省份 List <FxtApi_SYSProvince> provinceList = _unitOfWork.CityService.GetProvinceCityListBy(userInfo.UserName, userInfo.SignName, userInfo.AppList); ViewBag.NowProvinceList = provinceList; ViewBag.CallbackUrl = callbackUrl; return(PartialView()); }
// // GET: /Shared/ public ActionResult Partial_SelectCity(string callbackUrl) { var userInfo = WebUserHelp.GetNowLoginUser(); //省份 //List<FxtApi_SYSProvince> provinceList = DataCenterProvinceApi.GetProvinceAll(userInfo.UserName, userInfo.SignName, userInfo.AppList); List <FxtApi_SYSProvince> provinceList = _unitOfWork.CityService.GetProvinceCityListBy(userInfo.UserName, userInfo.SignName, userInfo.AppList); ////城市 //List<FxtApi_SYSCity> cityList = DataCenterCityApi.GetCityAll(userInfo.UserName, userInfo.SignName, userInfo.AppList); ////获取当前公司开通产品城市ID //int[] cityIds = UserCenterUserInfoApi.GetCompanyProductCityIds(userInfo.SignName, FxtAPI.FxtUserCenter.Common.systypeCode, userInfo.UserName, userInfo.SignName, userInfo.AppList); ////所有城市 //if (!cityIds.Contains(0)) //{ // cityList = cityList.Where(m => cityIds.Contains(m.CityId)).ToList(); // provinceList = provinceList.Where(m => cityList.Any(c => m.ProvinceId == c.ProvinceId)).ToList(); //} ViewBag.NowProvinceList = provinceList; //List<FxtApi_SYSProvince> provinceList = new List<FxtApi_SYSProvince>(); //List<FxtApi_SYSCity> cityList = new List<FxtApi_SYSCity>(); ////获取当前拥有产品权限的城市 并输出到页面 //WebUserHelp.GetNowRightCityList(out provinceList, out cityList); //StringBuilder sb = new StringBuilder(); //sb.Append("["); //foreach (FxtApi_SYSProvince pro in provinceList) //{ // sb.Append("{\"provinceid\":").Append(pro.ProvinceId).Append(","); // sb.Append("\"provincename\":\"").Append(pro.ProvinceName).Append("\","); // List<FxtApi_SYSCity> _cityList = cityList.Where(obj => obj.ProvinceId == pro.ProvinceId).ToList(); // sb.Append("\"citylist\":["); // StringBuilder sb2 = new StringBuilder(); // foreach (FxtApi_SYSCity city in _cityList) // { // sb2.Append("{\"cityid\":").Append(city.CityId).Append(","); // sb2.Append("\"cityname\":\"").Append(city.CityName).Append("\","); // sb2.Append("\"provinceid\":").Append(pro.ProvinceId).Append("},"); // } // sb.Append(sb2.ToString().TrimEnd(',')).Append("]"); // sb.Append("},"); //} //string result = sb.ToString().TrimEnd(',') + "]"; //ViewBag.RightCityData = result; //ViewBag.NowCityId = WebUserHelp.GetNowCityId(); //ViewBag.NowProvinceId = WebUserHelp.GetNowProvinceId(); ViewBag.CallbackUrl = callbackUrl; return(PartialView()); }
public ActionResult SubmitChangeCity_Api(int provinceId, int cityId) { AjaxResult result = new AjaxResult(""); if (provinceId < 1 || cityId < 1) { result.Result = false; result.Message = "请选择城市"; return(AjaxJson(result)); } WebUserHelp.SetNowProvinceAndCity(provinceId, cityId); return(AjaxJson(result)); }
public ActionResult SubmitChangeCity_Api(int provinceId, int cityId) { string json = ""; if (provinceId < 1 || cityId < 1) { Response.Write(json.MvcResponseJson(result: 0, message: "请选择城市")); Response.End(); return(null); } WebUserHelp.SetNowProvinceAndCity(provinceId, cityId); Response.Write(json.MvcResponseJson(result: 1, message: "")); Response.End(); return(null); }
public ActionResult Index(UserCenter_LoginUserInfo loginUser) { List <SYSCode> colist = DataCenterCodeApi.GetCodeById(1035, loginUser.UserName, loginUser.SignName, loginUser.AppList); List <FxtApi_SYSArea> areaList = DataCenterAreaApi.GetAreaByCityId(loginUser.NowCityId, loginUser.UserName, loginUser.SignName, loginUser.AppList); ViewBag.AreaList = areaList; //获取当前用户在此页面所有的操作权限 List <int> functionCodes = WebUserHelp.GetNowPageFunctionCodes(loginUser.UserName, loginUser.FxtCompanyId, WebCommon.Url_AllotFlowInfo_AllotFlowManager); ViewBag.FunctionCodes = functionCodes; return(View()); }
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()); }
//[AllowAnonymous] public ActionResult Login(string type, string path) { ViewBag.LastUserName = WebUserHelp.GetLastUserName(); //LNKPPhotoManager.GetLNKPPhotoCountByProjectId(0, 6, 25); if (type == "signout") { WebUserHelp.SignOutLoginUser(); Response.Redirect(WebCommon.Url_Login_Login); return(null); } else if (type == "open") { ViewBag.LastPageType = "open"; } if (WebUserHelp.GetNowLoginUser() != null) { return(RedirectToAction("Index", "Home")); } return(View()); }
public ActionResult UserManager() { UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(); int cityId = WebUserHelp.GetNowCityId(); int companyId = loginUserInfo.FxtCompanyId; IList <PriviDepartment> departmentList = PriviDepartmentManager.GetDepartmentByCompanyId(cityId, companyId); IList <SYSRole> roleList = SYSRoleManager.GetSYSRoleByCompanyId(0, 0); ViewBag.DepartmentList = departmentList; ViewBag.RoleList = roleList; //获取是否有修改用户权限 ViewBag.UpdateRight = 0; bool updateRight = WebUserHelp.CheckNowPageFunctionCode(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_UserInfo_UserManager, SYSCodeManager.FunOperCode_7); if (updateRight) { ViewBag.UpdateRight = 1; } return(View()); }
public ActionResult Login_SubmitDate_Api(string userName, string pwd) { AjaxResult result = new AjaxResult("登陆成功"); string message = ""; if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(pwd)) { result.Result = false; result.Message = "请填写用户名和密码"; return(Json(result)); } var appList = new List <UserCenter_Apps>(); var userResult = UserCenterUserInfoApi.UserLogin(userName, pwd, out appList, out message); if (userResult == null) { result.Result = false; result.Message = "用户名或密码错误"; return(Json(result)); } //获取当前用户拥有产品的城市 int nowCityId = WebUserHelp.GetNowCityId(); string lastuser = WebUserHelp.GetLastUserName(); //int[] ints = UserCenterUserInfoApi.GetCompanyProductCityIds(userResult.SignName, FxtAPI.FxtUserCenter.Common.systypeCode, userResult.UserName, userResult.SignName, appList); //WebUserHelp.SetNowRightCityList(ints); //IList <SYSMenu> menuList = SYSMenuManager.GetSYSMenuPageByUserNameAndCompanyIdAndCityId(userName, userResult.FxtCompanyId, nowCityId); WebUserHelp.SetNowLoginUser(userResult, appList, null, null); result.Data = new { userinfo = userResult, islastuser = userName == lastuser ? "1" : "0", cityid = nowCityId }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult SetDepartment_SubmitData_Api(string departmentId, string departmentName) { string json = ""; departmentName = departmentName.DecodeField().TrimBlank(); if (string.IsNullOrEmpty(departmentName)) { Response.Write(json.MvcResponseJson(result: 0, message: "请填写组名")); Response.End(); return(null); } string message = ""; bool result = true; UserCenter_LoginUserInfo loginUserInfo = WebUserHelp.GetNowLoginUser(); //如果是修改 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)) { Response.Write(json.MvcResponseJson(result: 0, message: "无权限修改此信息")); Response.End(); return(null); } } else//无修改权限 { Response.Write(json.MvcResponseJson(result: 0, message: "无权限修改此信息")); Response.End(); return(null); } result = PriviDepartmentManager.UpdateDepartment(Convert.ToInt32(departmentId), departmentName, out message); } else//新增 { if (!WebUserHelp.CheckNowPageFunctionCode(loginUserInfo.UserName, loginUserInfo.FxtCompanyId, WebCommon.Url_DepartmentInfo_DepartmentManager, SYSCodeManager.FunOperCode_4)) { Response.Write(json.MvcResponseJson(result: 0, message: "无权限新增信息")); Response.End(); return(null); } int cityId = WebUserHelp.GetNowCityId(); int companyId = loginUserInfo.FxtCompanyId; string loginusername = loginUserInfo.UserName; string loginsignname = loginUserInfo.SignName; PriviDepartment department = PriviDepartmentManager.InsertDepartment(cityId, companyId, departmentName, out message); if (department == null) { result = false; } else { json = department.EncodeField <PriviDepartment>().ToJSONjss(); } } //失败 if (!result) { Response.Write(json.MvcResponseJson(result: 0, message: "提交失败:" + message)); Response.End(); return(null); } //成功 Response.Write(json.MvcResponseJson(result: 1, message: "")); Response.End(); return(null); }
public ActionResult LoginBox() { ViewBag.LastUserName = WebUserHelp.GetLastUserName(); return(View()); }