Exemple #1
0
        public static bool CheckHouseObj(HouseDto house, out string message)
        {
            message = "";
            //
            string unitno = string.IsNullOrEmpty(house.UnitNo) ? null : house.UnitNo.DecodeField();

            if (unitno != null && unitno.Length > 20)
            {
                message = "请输入房号单元名称字符长度不能大于20";
                return(false);
            }
            //
            //object floorno = jobj["floorno"] == null ? null : jobj.Value<JValue>("floorno").Value;
            //int fno = 0;
            //if (floorno == null || !int.TryParse(floorno.ToString().DecodeField(), out fno))
            //{
            //    message = "请输入起始楼层";
            //    return false;
            //}
            //
            //string housename = jobj["housename"] == null ? null : jobj.Value<string>("housename").DecodeField();
            //if (housename == null)
            //{
            //    message = "请输入房号";
            //    return false;
            //}
            //if (housename.Length > 20)
            //{
            //    message = "请输入房号字符长度不能大于20";
            //    return false;
            //}
            //
            if (!house.FrontCode.HasValue || !StringHelp.CheckInteger(house.FrontCode.Value.ToString().DecodeField()))
            {
                message = "请输入朝向";
                return(false);
            }
            //
            if (house.BuildArea.HasValue && !StringHelp.CheckDecimal(house.BuildArea.Value.ToString().DecodeField()))
            {
                message = "请输入正确的面积格式";
                return(false);
            }
            //
            if (house.HouseTypeCode.HasValue && !StringHelp.CheckInteger(house.HouseTypeCode.Value.ToString().DecodeField()))
            {
                message = "请输入正确的户型";
                return(false);
            }
            //
            if (house.SightCode.HasValue && !StringHelp.CheckInteger(house.SightCode.Value.ToString().DecodeField()))
            {
                message = "请输入景观";
                return(false);
            }
            return(true);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        private bool CheckBuildingObj(BuildingDto building, out string message)
        {
            message = "";
            //
            string buildingname = building.BuildingName == null ? null : building.BuildingName.DecodeField();

            if (string.IsNullOrEmpty(buildingname))
            {
                message = "请输入楼栋名称";
                return(false);
            }
            if (buildingname.Length > 150)
            {
                message = "请输入楼栋名称长度不能大于150";
                return(false);
            }
            //
            //string doorplate = building.Doorplate == null ? null : building.Doorplate.DecodeField();
            //if (doorplate != null && doorplate.Length > 200)
            //{
            //    message = "请输入门牌号长度不能大于200";
            //    return false;
            //}
            //
            string othername = building.OtherName == null ? null : building.OtherName.DecodeField();

            if (othername != null && othername.Length > 50)
            {
                message = "请输入楼栋别名长度不能大于50";
                return(false);
            }
            //
            if (building.StructureCode.HasValue && !StringHelp.CheckInteger(building.StructureCode.Value.ToString().DecodeField()))
            {
                message = "请输入正确的建筑结构";
                return(false);
            }
            //
            if (building.LocationCode.HasValue && !StringHelp.CheckInteger(building.LocationCode.Value.ToString().DecodeField()))
            {
                message = "请输入正确的位置";
                return(false);
            }
            //
            //if (building.AveragePrice.HasValue && !StringHelp.CheckDecimal(building.AveragePrice.Value.ToString().DecodeField()))
            //{
            //    message = "请输入正确的楼栋均价";
            //    return false;
            //}
            //
            if (building.BuildDate.HasValue && !StringHelp.CheckIsDate(building.BuildDate.Value.ToString().DecodeField()))
            {
                message = "请输入正确的楼栋竣工时间(建筑时间)";
                return(false);
            }
            //
            if (building.IsElevator.HasValue && !StringHelp.CheckInteger(building.IsElevator.Value.ToString().DecodeField()))
            {
                message = "请输入正确的楼栋是否带电梯";
                return(false);
            }
            //
            string elevatorrate = string.IsNullOrEmpty(building.ElevatorRate) ? null : building.ElevatorRate.DecodeField();

            if (elevatorrate != null && elevatorrate.Length > 50)
            {
                message = "请输入楼栋梯户比字符不能大于50";
                return(false);
            }
            //
            //string pricedetail = string.IsNullOrEmpty(building.PriceDetail) ? null : building.PriceDetail.DecodeField();
            //if (pricedetail != null && pricedetail.Length > 500)
            //{
            //    message = "请输入价格系数说明字符不能大于500";
            //    return false;
            //}
            //
            //if (building.SightCode.HasValue && !StringHelp.CheckInteger(building.SightCode.Value.ToString().DecodeField()))
            //{
            //    message = "请输入正确的景观值";
            //    return false;
            //}
            //
            if (!building.TotalFloor.HasValue || !StringHelp.CheckInteger(building.TotalFloor.Value.ToString().DecodeField()))
            {
                message = "请输入楼栋总层数";
                return(false);
            }
            return(true);
        }
Exemple #4
0
        public static bool CheckProjectObj(Project project, out string message)
        {
            message = "";
            //
            if (project.X == null || project.Y == null)
            {
                message = "请输入查勘员经度和纬度";
                return(false);
            }
            if (!StringHelp.CheckDecimal(Convert.ToString(project.X)) || !StringHelp.CheckDecimal(Convert.ToString(project.Y)))
            {
                message = "请输入正确的查勘员经度和纬度";
                return(false);
            }
            //
            string projectname = string.IsNullOrEmpty(project.ProjectName) ? null : project.ProjectName.DecodeField();

            if (string.IsNullOrEmpty(projectname))
            {
                message = "请输入楼盘名";
                return(false);
            }
            //
            if (project.CityID < 1 || project.AreaID < 1)
            {
                message = "请正确输入城市和行政区";
                return(false);
            }
            //
            string address = string.IsNullOrEmpty(project.Address) ? null : project.Address.DecodeField();

            if (string.IsNullOrEmpty(address))
            {
                message = "请输入楼盘地址";
                return(false);
            }
            //
            if (project.EndDate.HasValue && !StringHelp.CheckIsDate(project.EndDate.Value.ToString().DecodeField())) //(enddate == null || !StringHelp.CheckIsDate(enddate.ToString().DecodeField()))
            {
                message = "请输入正确的竣工时间";
                return(false);
            }
            //
            if (project.BuildingArea.HasValue && !StringHelp.CheckDecimal(project.BuildingArea.Value.ToString().DecodeField()))//(buildingarea == null || !StringHelp.CheckDecimal(buildingarea.ToString().DecodeField()))
            {
                message = "请输入正确的建筑面积";
                return(false);
            }
            //
            if (project.LandArea.HasValue && !StringHelp.CheckDecimal(project.LandArea.Value.ToString().DecodeField()))//(landarea == null || !StringHelp.CheckDecimal(landarea.ToString().DecodeField()))
            {
                message = "请输入正确的占地面积";
                return(false);
            }
            //
            //object cubagerate = jobj["cubagerate"] == null || jobj.Value<string>("cubagerate") == "" ? null : jobj.Value<JValue>("cubagerate").Value;
            //if ( cubagerate != null && !StringHelp.CheckDecimal(cubagerate.ToString().DecodeField()))//(cubagerate == null || !StringHelp.CheckDecimal(cubagerate.ToString().DecodeField()))
            //{
            //    message = "请输入正确的容积率值";
            //    return false;
            //}
            //
            //object greenrate = jobj["greenrate"] == null || jobj.Value<string>("greenrate") == "" ? null : jobj.Value<JValue>("greenrate").Value;
            //if (greenrate != null && !StringHelp.CheckDecimal(greenrate.ToString().DecodeField()))//(greenrate == null || !StringHelp.CheckDecimal(greenrate.ToString().DecodeField()))
            //{
            //    message = "请输入正确的绿化率值";
            //    return false;
            //}
            //
            //string managerprice = jobj["managerprice"] == null ? null : jobj.Value<string>("managerprice").DecodeField();
            //if (string.IsNullOrEmpty(managerprice))
            //{
            //    message = "请输入物业管理费";
            //    return false;
            //}
            //
            //object parkingnumber = jobj["parkingnumber"] == null || jobj.Value<string>("parkingnumber") == "" ? null : jobj.Value<JValue>("parkingnumber").Value;
            //if (parkingnumber != null && !StringHelp.CheckInteger(parkingnumber.ToString().DecodeField()))//(parkingnumber == null || !StringHelp.CheckInteger(parkingnumber.ToString().DecodeField()))
            //{
            //    message = "请输入车位数量";
            //    return false;
            //}
            //
            if (project.TotalNum.HasValue && !StringHelp.CheckInteger(project.TotalNum.Value.ToString().DecodeField()))//(totalnum == null || !StringHelp.CheckInteger(totalnum.ToString().DecodeField()))
            {
                message = "请输入总户数";
                return(false);
            }
            //
            if (project.BuildingNum.HasValue && !StringHelp.CheckInteger(project.BuildingNum.Value.ToString().DecodeField()))//(buildingnum == null || !StringHelp.CheckInteger(buildingnum.ToString().DecodeField()))
            {
                message = "请输入总栋数";
                return(false);
            }
            //
            //object saledate = jobj["saledate"] == null || jobj.Value<string>("saledate") == "" ? null : jobj.Value<JValue>("saledate").Value;
            //if (saledate != null && !StringHelp.CheckIsDate(saledate.ToString().DecodeField()))//(saledate == null || !StringHelp.CheckIsDate(saledate.ToString().DecodeField()))
            //{
            //    message = "请输入开盘时间";
            //    return false;
            //}
            ////
            //object buildingdate = jobj["buildingdate"] == null || jobj.Value<string>("buildingdate") == "" ? null : jobj.Value<JValue>("buildingdate").Value;
            //if (buildingdate != null && !StringHelp.CheckIsDate(buildingdate.ToString()))//(buildingdate == null || !StringHelp.CheckIsDate(buildingdate.ToString()))
            //{
            //    message = "请输入开工时间";
            //    return false;
            //}
            //
            if (project.StartDate.HasValue && !StringHelp.CheckIsDate(project.StartDate.Value.ToString().DecodeField()))//(statedate == null || !StringHelp.CheckIsDate(statedate.ToString().DecodeField()))
            {
                message = "请输入采集时间";
                return(false);
            }
            return(true);
        }