Пример #1
0
        protected void cvCode_ServerValidate(object source, ServerValidateEventArgs args)
        {
            args.IsValid = true;

            UnitsGateway unitsGateway = new UnitsGateway(null);
            int unitId = int.Parse(hdfUnitId.Value);

            if (unitsGateway.IsUnitCodeInUse(args.Value.Trim(), unitId))
            {
                args.IsValid = false;
            }
        }
Пример #2
0
        protected void cvCode_ServerValidate(object source, ServerValidateEventArgs args)
        {
            args.IsValid = true;

            UnitsGateway unitsGateway = new UnitsGateway(null);

            if (unitsGateway.IsUnitCodeInUse(tbxCode.Text))
            {
                args.IsValid = false;
            }
        }