private void UserValidateFields(IUserDTO user, ActionOp action) { switch (action) { case ActionOp.Create: this.FieldsValidate(user); break; case ActionOp.Edit: if (user.IdUser == 0) { throw new Exception(string.Format(FieldsRequired.FieldRe, "Id")); } this.FieldsValidate(user); break; } }
private void PropertieValidateFields(IPropertieDTO propertie, ActionOp action) { switch (action) { case ActionOp.Create: this.FieldsValidate(propertie); break; case ActionOp.Edit: if (propertie.IdPropertie == 0) { throw new Exception(string.Format(FieldsRequired.FieldRe, "Id")); } this.FieldsValidate(propertie); break; } }