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 static decimal?CaseColumnConvertToDecimal(string str)
 {
     if (string.IsNullOrEmpty(str))
     {
         return(null);
     }
     if (StringHelp.CheckDecimal(str))
     {
         return(Convert.ToDecimal(str));
     }
     return(null);
 }
Exemple #3
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);
        }