public void EnumCanProduceItems()
        {
            CommonReferenceDataRepository repo = new CommonReferenceDataRepository(null);

            var professionTypes = repo.GetAllProfessionTypes();
            Assert.AreEqual(7, professionTypes.Count);
        }
 public CorrespondenceController()
 {
     edisDbEntities db = new edisDbEntities();
     comRepo = new CommonReferenceDataRepository(db);
     corresRepo = new CorrespondenceRepository(db);
     //advRepo = new AdviserRepository(db);
     edisRepo = new EdisRepository();
 }
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            if (value == null)
            {
                return ValidationResult.Success;
            }

            int valueNumber = -1;
            try
            {
                valueNumber = (int)value;
            }
            catch (Exception)
            {

                return new ValidationResult("Property is invalid");
            }
            if (valueNumber < 0)
            {

                return new ValidationResult("Property is invalid");
            }

            using (CommonReferenceDataRepository db = new CommonReferenceDataRepository())
            {
                var clientGroup = db.GetAllProductTypes().SingleOrDefault(s => s.id == valueNumber);
                if (clientGroup != null)
                {
                    return ValidationResult.Success;
                }
                else
                {
                    return new ValidationResult(ErrorMessage);
                }
            }
        }
 public EducationLevelController()
 {
     repo = new CommonReferenceDataRepository();
 }
 public CorporateActionRepository(edisDbEntities database)
 {
     db      = database;
     comRepo = new CommonReferenceDataRepository(db);
 }
 public CorporateActionRepository()
 {
     db      = new edisDbEntities();
     comRepo = new CommonReferenceDataRepository(db);
 }
 public void CanGenerateFilteredCommissionsAndFees()
 {
     CommonReferenceDataRepository repo = new CommonReferenceDataRepository(null);
     var fees = repo.GetCommissionAndFees_Filtered(c => c.CommissionsAndFeesId == 1);
     Assert.AreEqual(1, fees.Count);
 }
 public RebalanceRepository()
 {
     db = new edisDbEntities();
     comRepo = new CommonReferenceDataRepository(db);
 }
 public RebalanceRepository(edisDbEntities database)
 {
     db = database;
     comRepo = new CommonReferenceDataRepository(db);
 }
 public CommonController()
 {
     comRepo = new CommonReferenceDataRepository();
 }