Class PHCTypedWS<T>
- Namespace
- PHCBusinessLayer
- Assembly
- PHCBusinessLayer.dll
This class contains generic methods to be inherited by subclasses that extend of type BusinessVO.
public class PHCTypedWS<T> : PHCGenericWS, IComponent, IDisposable, IServiceProvider where T : GenericVO
Type Parameters
T
- Inheritance
-
PHCTypedWS<T>
Methods
ClearRecover(string)
delete a changing record from memory
[WebMethod]
public PHCResult ClearRecover(string IdStamp)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record that you want to delete, corresponds to the stored value in the field 'XXstamp' of the record. |
Returns
- PHCResult
PHCResult containing the registration request or error messages produced by this query process.
ClearRecovered()
Delete all changing records of the user from the memory
[WebMethod]
public PHCResult ClearRecovered()
Returns
- PHCResult
PHCResult containing the registration request or error messages produced by this query process.
DownloadXMLCollection(object, List<string>, bool)
public PHCResult DownloadXMLCollection(object payload, List<string> IdStamps, bool runValidations)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
payload |
object | |
IdStamps |
List<string> | |
runValidations |
bool |
Returns
EmailXMLCollection(object, EmailVO, List<string>, bool)
public PHCResult EmailXMLCollection(object payload, EmailVO emailItem, List<string> IdStamps, bool runValidations)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
payload |
object | |
emailItem |
EmailVO | |
IdStamps |
List<string> | |
runValidations |
bool |
Returns
ExecuteAction(ActionFilterVO)
[WebMethod]
public PHCResult ExecuteAction(ActionFilterVO filter)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
filter |
ActionFilterVO |
Returns
GeneratePortalAccess(ActionVO, T)
[WebMethod]
public PHCResult GeneratePortalAccess(ActionVO action, T record)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
action |
ActionVO | |
record |
T |
Returns
GetActions(ActionFilterVO)
[WebMethod]
public PHCResult GetActions(ActionFilterVO filter)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
filter |
ActionFilterVO |
Returns
GetDocTracking(T, string, string)
[WebMethod]
public PHCResult GetDocTracking(T itemVO, string entityName, string lineStamp)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
itemVO |
T | |
entityName |
string | |
lineStamp |
string |
Returns
GetEditLoopFields(decimal, List<string>, QueryVO)
public PHCResult GetEditLoopFields(decimal serieID, List<string> collectionIDs, QueryVO itemQuery)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
serieID |
decimal | |
collectionIDs |
List<string> | |
itemQuery |
QueryVO |
Returns
GetEditLoopValues(decimal, string, List<string>, QueryVO, ScalarResult)
public PHCResult GetEditLoopValues(decimal serieID, string field, List<string> collectionIDs, QueryVO itemQuery, ScalarResult newValue)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
serieID |
decimal | |
field |
string | |
collectionIDs |
List<string> | |
itemQuery |
QueryVO | |
newValue |
ScalarResult |
Returns
GetNewInstanceFromPortal(string, string, string)
[WebMethod]
public PHCResult GetNewInstanceFromPortal(string authEntity, string userEntity, string hash)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
authEntity |
string | |
userEntity |
string | |
hash |
string |
Returns
GetNewInstanceFromPortalStamp(string, string, string, string)
[WebMethod]
public PHCResult GetNewInstanceFromPortalStamp(string authEntity, string userEntity, string hash, string stamp)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
authEntity |
string | |
userEntity |
string | |
hash |
string | |
stamp |
string |
Returns
IsActionAvailable(ActionFilterVO)
[WebMethod]
public PHCResult IsActionAvailable(ActionFilterVO filter)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
filter |
ActionFilterVO |
Returns
Recover(string)
Query a changing record
[WebMethod]
public PHCResult Recover(string IdStamp)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record that you want to query, corresponds to the stored value in the field 'XXstamp' of the record. |
Returns
- PHCResult
PHCResult containing the registration request or error messages produced by this query process.
Recovered(List<string>)
Query all changing records from the user
[WebMethod]
public PHCResult Recovered(List<string> selectItems)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
selectItems |
List<string> |
Returns
- PHCResult
PHCResult containing the registration request or error messages produced by this query process.
Remove(string, bool)
Deletes a record in the database.
[WebMethod]
public PHCResult Remove(string IdStamp, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record to be deleted, corresponds to the value stored in the registration field ' XXstamp '. |
runWarningRules |
bool |
Returns
- PHCResult
PHCResult empty that indicates that the operation was successful, or error / warning messages produced by user/system rules and / or errors returned by the database engine that may have been generated in this process of erasing.
RemoveAll(bool)
[WebMethod]
public PHCResult RemoveAll(bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
runWarningRules |
bool |
Returns
RemoveList(List<string>, bool)
Deletes a list of records in the database.
[WebMethod]
public PHCResult RemoveList(List<string> IdStamps, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamps |
List<string> | Is a list of identifiers of records to be deleted, corresponding to values stored in the fields searchstamp of SearchVO. |
runWarningRules |
bool |
Returns
RemoveSearch(bool, QueryVO)
[WebMethod]
public PHCResult RemoveSearch(bool runWarningRules, QueryVO itemQuery)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
runWarningRules |
bool | |
itemQuery |
QueryVO |
Returns
Requery(string, bool)
Query a record in the database.
[WebMethod]
public PHCResult Requery(string IdStamp, bool runValidations)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record that you want to query, corresponds to the stored value in the field 'XXstamp' of the record. |
runValidations |
bool | Indicates that before being asked the register to entity's manager must be validated the query access and other operations performed such as for example registering the log activity determined that user consulted this record. |
Returns
- PHCResult
PHCResult containing the registration request or error messages produced by this consultation process.
Save(T, bool)
Writes a record of a particular entity in the database.
[WebMethod]
public PHCResult Save(T itemVO, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
itemVO |
T | Corresponds to the record you want to write in the database. |
runWarningRules |
bool | Indicates whether to run the user/system warning rules when recording. When there is need to make a recording you must call this method with this parameter to True and if the application returns only warning messages, we can ask the user if you still want to save the log. In afirmative case should call this method again but now with this parameter to False so they are not executing again the user/system warning rules when recording. |
Returns
- PHCResult
PHCResult containing the object recorded in the database with the latest information or generated errors by the application or database, in this recording process.
SaveList(List<T>, bool)
Writes a list of records of a particular entity in the database.
[WebMethod]
public PHCResult SaveList(List<T> itemsVO, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
itemsVO |
List<T> | List containing the records that want to write in the database. |
runWarningRules |
bool | Indicates whether to run user/system 'warning' rules when recording. When there is need to make a recording you must call this method with this parameter to True and if the application returns only warning messages, we can ask the user if you still want to save the record. If so you must call this method with this parameter to False so they are not executing 'warning' rules. |
Returns
- PHCResult
PHCResult containing the objects stored in the database with the latest information or errors generated by the application or database in this recording process.
SetEditLoopValues(decimal, string, List<EditLoopValues>)
public PHCResult SetEditLoopValues(decimal serieID, string field, List<EditLoopValues> collection)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
serieID |
decimal | |
field |
string | |
collection |
List<EditLoopValues> |
Returns
ValidateAppWebService(string)
public List<MessageVO> ValidateAppWebService(string callerMember = "")
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
callerMember |
string |
Returns
ValidateAppWebService(Type, string)
public List<MessageVO> ValidateAppWebService(Type validType, string callerMember)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
validType |
Type | |
callerMember |
string |
Returns
ValidateWebService(bool, string)
public override List<MessageVO> ValidateWebService(bool validateClient = true, string callerMember = "")
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
validateClient |
bool | |
callerMember |
string |
Returns
ValidateWebService<anotherType>(string)
public List<MessageVO> ValidateWebService<anotherType>(string callerMember = "") where anotherType : GenericVO
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
callerMember |
string |
Returns
Type Parameters
anotherType
XMLExport(object, string, bool)
[WebMethod]
public PHCResult XMLExport(object payload, string IdStamp, bool runValidations)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
payload |
object | |
IdStamp |
string | |
runValidations |
bool |
Returns
actEntity(T, int, object)
Updates an entity which currently is in insert or change mode.
[WebMethod]
public PHCResult actEntity(T entity, int code, object newValue)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
entity |
T | Entity that should be used to update the current editing record. |
code |
int | Deprecated, always use zero value |
newValue |
object | Deprecated, always use empty object |
Returns
- PHCResult
The updated entity and any messages, after running all the application and user rules.
editInstance(string, bool)
Start editing an existing record.
[WebMethod]
public PHCResult editInstance(string IdStamp, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record you want to editinge, corresponds to the value stored in the field 'XXstamp' of the record. |
runWarningRules |
bool |
Returns
getDuplicateInstance(string)
Duplicates an existing record.
[WebMethod]
public PHCResult getDuplicateInstance(string IdStamp)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
IdStamp |
string | Identifies the record you want to duplicate, corresponds to the value stored in the field 'XXstamp' of the record. |
Returns
- PHCResult
-
PHCResult containing duplicated record or error messages produced by this duplication process.
The returned record will contain duplicate values from the indicated register and will be applied default values and / or system rules that might exist to the entity in question.
Remarks
O FtVO is only duplicated and stored in memory, the final recording in the database should be done by service 'Save'.
getInstanceFromReference(List<KeyValueVO>)
Creates a new record based on reference.
[WebMethod]
public PHCResult getInstanceFromReference(List<KeyValueVO> parameters)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
parameters |
List<KeyValueVO> | Indicates the internal number corresponding to the document type. For example, in the case of the FtVO this value is written in the field ndoc of FtVO and makes the connection with the field ndoc of TdVO. For example, in the case of ClVO this value is 0 |
Returns
- PHCResult
PHCResult containing the new registry established, or error messages produced by this process of creation. The returned record will contain default values and / or system rules that may exist for the entity in question.
Remarks
The record is only created and saved in memory, the final recording in the database should be done by the service 'Save'.
getNewInstance(decimal)
Cria um novo registro para uma entidade a partir de outra.
[WebMethod]
public PHCResult getNewInstance(decimal ndos)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
ndos |
decimal |
Returns
- PHCResult
-
Retorna um objeto do tipo PHCResult que contém:
- O registro criado com os valores padrão e regras do sistema.
- Mensagens de erro, caso ocorram problemas durante a criação.
Examples
' Exemplo de uso:
Dim parametros As New List(Of KeyValueVO)
parametros.Add(New KeyValueVO("origin", "Ft"))
parametros.Add(New KeyValueVO("originstamp", "6f2-4b23-8d57-cd001bc6fd9"))
parametros.Add(New KeyValueVO("destination", "Re"))
Dim resultado As PHCResult = getNewInstanceFromReference(parametros)
If resultado.HasErrors Then
' Tratar os erros
Else
' Utilizar o registro criado
End If
Remarks
Este método gera um registro em memória aplicando os valores padrão e regras do sistema, sem persistir os dados no banco.
É necessário que o usuário esteja logado para utilizar este método.
getNewInstanceFromReference(List<KeyValueVO>)
Cria um novo registro em memória para uma entidade, a partir de outra, usando uma lista de parâmetros.
[WebMethod]
public PHCResult getNewInstanceFromReference(List<KeyValueVO> parameters)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
parameters |
List<KeyValueVO> | Lista de KeyValueVO com chave e valor. Ex.:
|
Returns
Examples
Dim parametros As New List(Of KeyValueVO)
parametros.Add(New KeyValueVO("origin", "Ft"))
parametros.Add(New KeyValueVO("originstamp", "6f2-4b23-8d57-cd001bc6fd9"))
parametros.Add(New KeyValueVO("destination", "Re"))
Dim resultado As PHCResult = getNewInstanceFromReference(parametros)
Remarks
O registro não é salvo no banco até chamar o serviço 'Save'. Usuário deve estar logado.
importEntityFromXml(string)
Imports a record from an XML that represents it.
[WebMethod]
public PHCResult importEntityFromXml(string xmlString)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
xmlString |
string | String containing the representative XML Registry to import. |
Returns
- PHCResult
PHCResult containing the imported record or error messages produced by the import process.
runCode(T, string, object, bool)
[WebMethod]
public PHCResult runCode(T entity, string code, object payload, bool runWarningRules)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
entity |
T | |
code |
string | |
payload |
object | |
runWarningRules |
bool |
Returns
- PHCResult
This operation has no return.
runListCode(string, object)
[WebMethod]
public PHCResult runListCode(string code, object payload)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
code |
string | |
payload |
object |
Returns
- PHCResult
This operation has no return.