//Please write your properties and functions here. This part will not be replaced.

        public override void CheckRules(object entitySet, RuleFunctionSEnum fnName, BusinessRuleErrorList errors)
        {
            base.CheckRules(entitySet, fnName, errors);

            // check to make sure that no duplicate item is exists in the database
            CheckUtils.CheckDuplicateTwoKeyNotToBeExists(entitySet,
                                                         vDoctor_Specialty.ColumnNames.SpecialtyID,
                                                         vDoctor_Specialty.ColumnNames.DoctorID,
                                                         vDoctor_Specialty.ColumnNames.Doctor_SpecialtyID,
                                                         errors,
                                                         null,
                                                         fnName == RuleFunctionSEnum.Insert,
                                                         null);
        }
        //Please write your properties and functions here. This part will not be replaced.

        public override void CheckRules(object entitySet, RuleFunctionSEnum fnName, BusinessRuleErrorList errors)
        {
            base.CheckRules(entitySet, fnName, errors);

            if (CheckUtils.CheckDuplicateTwoKeyNotToBeExists

                    (entitySet
                    , vMedicalHistory.ColumnNames.SectionName,
                    vMedicalHistory.ColumnNames.PatientUserID,
                    vMedicalHistory.ColumnNames.MedicalHistoryID,
                    errors,
                    null,
                    fnName == RuleFunctionSEnum.Insert,
                    null)

                == false)
            {
                // the application shouldn't insert a medical history section when it is exists in the database
                throw new ImpossibleExecutionException("Medical history section is already saved by another user. Please re-save it.");
            }
        }