Exemplo n.º 1
0
 public bool PostFieldValidation(ModelStateDictionary validationDictionary, Client currentClient, int FieldGroupId, int PeopleId)
 {
     if ((FieldGroupRepository.GetFieldGroupById(FieldGroupId, currentClient.Id) == null))
     {
         validationDictionary.AddModelError(String.Format(GenericNames.MODEL_STATE_FORMAT, TypeOfName.GetNameFromType <PeopleField>(), "FieldGroupId"), GenericError.FORBIDDEN_RESOURCE_OR_DOES_NO_EXIST);
     }
     if ((PeopleRepository.GetPeopleById(PeopleId, currentClient.Id)) == null)
     {
         validationDictionary.AddModelError(String.Format(GenericNames.MODEL_STATE_FORMAT, TypeOfName.GetNameFromType <PeopleField>(), "PeopleId"), GenericError.FORBIDDEN_RESOURCE_OR_DOES_NO_EXIST);
     }
     return(validationDictionary.IsValid);
 }
Exemplo n.º 2
0
 public void Init()
 {
     ctx  = EFContext.CreateContext();
     repo = new FieldGroupRepository(ctx);
 }
Exemplo n.º 3
0
 public void Init()
 {
     ctx = EFContext.CreateContext();
     repo = new FieldGroupRepository(ctx);
 }