예제 #1
0
        /// <summary>
        /// 能否执行新增或修改操作
        /// </summary>
        /// <returns></returns>
        public override bool canExecute()
        {
            if (LogicalBuilding == null)
            {
                return(false);
            }

            bool        isValid     = true;
            CultureInfo cultureInfo = new CultureInfo("");
            // 非空验证
            NotEmptyValidationRule notEmptyValidationRule = new NotEmptyValidationRule();

            isValid &= notEmptyValidationRule.Validate(LogicalBuilding.LJZH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(LogicalBuilding.ZRZH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(LogicalBuilding.YSDM, cultureInfo).IsValid;
            // 数字验证
            NumbericValidationRule numbericValidationRule = new NumbericValidationRule();

            isValid &= numbericValidationRule.Validate(LogicalBuilding.YCJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(LogicalBuilding.YCDXMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(LogicalBuilding.YCQTMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(LogicalBuilding.SCJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(LogicalBuilding.SCDXMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(LogicalBuilding.SCQTMJ, cultureInfo).IsValid;

            return(isValid);
        }
예제 #2
0
        public override bool canExecute()
        {
            if (Floor == null)
            {
                return(false);
            }

            bool        isValid     = true;
            CultureInfo cultureInfo = new CultureInfo("");
            // 非空验证
            NotEmptyValidationRule notEmptyValidationRule = new NotEmptyValidationRule();

            isValid &= notEmptyValidationRule.Validate(Floor.CH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Floor.ZRZH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Floor.YSDM, cultureInfo).IsValid;
            // 数字验证
            NumbericValidationRule numbericValidationRule = new NumbericValidationRule();

            isValid &= numbericValidationRule.Validate(Floor.CJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CTNJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CYTMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CGYJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CFTJZMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CBQMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.CG, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Floor.SPTYMJ, cultureInfo).IsValid;

            return(isValid);
        }
예제 #3
0
        /// <summary>
        /// 能否执行新增或修改操作
        /// </summary>
        /// <returns></returns>
        public override bool canExecute()
        {
            if (Household == null)
            {
                return(false);
            }

            bool        isValid     = true;
            CultureInfo cultureInfo = new CultureInfo("");
            // 非空验证
            NotEmptyValidationRule notEmptyValidationRule = new NotEmptyValidationRule();

            isValid &= notEmptyValidationRule.Validate(Household.HBSM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.FWBM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.YSDM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.ZL, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.MJDW, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.SZC, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.QSC, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.ZZC, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.SHBW, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Household.ZT, cultureInfo).IsValid;
            // 数字和非空验证
            NumbericAndNotEmptyValidationRule numbericAndNotEmptyValidationRule = new NumbericAndNotEmptyValidationRule();
            NumbericValidationRule            numbericValidationRule            = new NumbericValidationRule();

            if (MappingType == EMappingType.PredictiveMapping)
            {
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.YCTNJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.YCFTJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.YCJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.YCQTJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.YCDXBFJZMJ, cultureInfo).IsValid;

                isValid &= numbericValidationRule.Validate(Household.YCFTXS, cultureInfo).IsValid;
            }
            else if (MappingType == EMappingType.SurveyingMapping)
            {
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.SCTNJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.SCFTJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.SCJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.SCQTJZMJ, cultureInfo).IsValid;
                isValid &= numbericAndNotEmptyValidationRule.Validate(Household.SCDXBFJZMJ, cultureInfo).IsValid;

                isValid &= numbericValidationRule.Validate(Household.SCFTXS, cultureInfo).IsValid;
            }
            // 数字验证
            isValid &= numbericValidationRule.Validate(Household.FTTDMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Household.DYTDMJ, cultureInfo).IsValid;
            isValid &= numbericValidationRule.Validate(Household.GYTDMJ, cultureInfo).IsValid;
            // 不动产单元号验证
            BDCDYHValidationRule bDCDYHValidationRule = new BDCDYHValidationRule();

            isValid &= bDCDYHValidationRule.Validate(Household.BDCDYH, cultureInfo).IsValid;

            return(isValid);
        }
        public override bool canExecute()
        {
            if (NaturalBuilding == null)
            {
                return(false);
            }

            bool        isValid     = true;
            CultureInfo cultureInfo = new CultureInfo("");
            // 非空验证
            NotEmptyValidationRule notEmptyValidationRule = new NotEmptyValidationRule();

            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.BSM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.YSDM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.ZRZH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.GHYT, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.FWJG, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(NaturalBuilding.ZT, cultureInfo).IsValid;
            // 数字和非空验证
            NumbericAndNotEmptyValidationRule numbericAndNotEmptyValidationRule = new NumbericAndNotEmptyValidationRule();

            isValid &= numbericAndNotEmptyValidationRule.Validate(NaturalBuilding.ZYDMJ, cultureInfo).IsValid;
            isValid &= numbericAndNotEmptyValidationRule.Validate(NaturalBuilding.ZZDMJ, cultureInfo).IsValid;
            if (MappingType == EMappingType.PredictiveMapping)
            {
                isValid &= numbericAndNotEmptyValidationRule.Validate(NaturalBuilding.YCJZMJ, cultureInfo).IsValid;
            }
            else if (MappingType == EMappingType.SurveyingMapping)
            {
                isValid &= numbericAndNotEmptyValidationRule.Validate(NaturalBuilding.SCJZMJ, cultureInfo).IsValid;
            }
            // 整数和非空验证
            IntegerAndNotEmptyValidationRule integerAndNotEmptyValidationRule = new IntegerAndNotEmptyValidationRule();

            isValid &= integerAndNotEmptyValidationRule.Validate(NaturalBuilding.DSCS, cultureInfo).IsValid;
            isValid &= integerAndNotEmptyValidationRule.Validate(NaturalBuilding.DXCS, cultureInfo).IsValid;
            isValid &= integerAndNotEmptyValidationRule.Validate(NaturalBuilding.ZCS, cultureInfo).IsValid;
            isValid &= integerAndNotEmptyValidationRule.Validate(NaturalBuilding.ZTS, cultureInfo).IsValid;
            // 数字验证
            NumbericValidationRule numbericValidationRule = new NumbericValidationRule();

            isValid &= numbericValidationRule.Validate(NaturalBuilding.JZWGD, cultureInfo).IsValid;
            //isValid &= numbericValidationRule.Validate(NaturalBuilding.SCJZMJ, cultureInfo).IsValid;
            //isValid &= numbericValidationRule.Validate(NaturalBuilding.YCJZMJ, cultureInfo).IsValid;
            // 不动产单元号验证
            BDCDYHValidationRule bDCDYHValidationRule = new BDCDYHValidationRule();

            isValid &= bDCDYHValidationRule.Validate(NaturalBuilding.BDCDYH, cultureInfo).IsValid;
            // 宗地代码验证
            ZDDMValidationRule zDDMValidationRule = new ZDDMValidationRule();

            isValid &= zDDMValidationRule.Validate(NaturalBuilding.ZDDM, cultureInfo).IsValid;

            return(isValid);
        }
예제 #5
0
        /// <summary>
        /// 能否执行新增或修改操作
        /// </summary>
        /// <returns></returns>
        public override bool canExecute()
        {
            if (Obligee == null)
            {
                return(false);
            }

            bool        isValid     = true;
            CultureInfo cultureInfo = new CultureInfo("");
            // 非空验证
            NotEmptyValidationRule notEmptyValidationRule = new NotEmptyValidationRule();

            isValid &= notEmptyValidationRule.Validate(Obligee.HBSM, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.QLRMC, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.ZJZL, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.ZJH, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.GJ, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.XB, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.QLRLX, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.QLLX, cultureInfo).IsValid;
            isValid &= notEmptyValidationRule.Validate(Obligee.GYFS, cultureInfo).IsValid;

            if (!string.IsNullOrWhiteSpace(Obligee.FRXM)) // 若法人姓名不为空
            {
                isValid &= notEmptyValidationRule.Validate(Obligee.FRZJLX, cultureInfo).IsValid;
                isValid &= notEmptyValidationRule.Validate(Obligee.FRZJH, cultureInfo).IsValid;
            }
            if (!string.IsNullOrWhiteSpace(Obligee.DLRXM)) // 若代理人姓名不为空
            {
                isValid &= notEmptyValidationRule.Validate(Obligee.DLRZJLX, cultureInfo).IsValid;
                isValid &= notEmptyValidationRule.Validate(Obligee.DLRZJH, cultureInfo).IsValid;
            }

            // 数字验证
            NumbericValidationRule numbericValidationRule = new NumbericValidationRule();

            isValid &= numbericValidationRule.Validate(Obligee.QLMJ, cultureInfo).IsValid;

            return(isValid);
        }