public Int16 GetIdDocTypeByName(string stGuidConnect, string stName) { //Controllo se non è stato aperto già un File di Log Int16 iResult = 0; //istanzio l'oggetto SvAol.Session SVAOLLib.Session oSession = new SVAOLLib.Session(); try { ResourceFileManager resourceFileManager = ResourceFileManager.Instance; resourceFileManager.SetResources(); string sValueFromKey = ""; if (string.IsNullOrEmpty(sValueFromKey)) { //controllo se sono già connesso, in caso contrario mi connetto e ritorno la stringa di connessione oSession.GUIDconnect = stGuidConnect; //Inizializzo gli oggetti SvAol necessari SVAOLLib.DocumentTypes oDocuments = new SVAOLLib.DocumentTypes(); //Recupero tutti i Tipi documento. oDocuments = (SVAOLLib.DocumentTypes)oSession.GetDocTypes(0, 0); //il secondo 0 sta per false //Cerco il Tipo Documento con nome #stName#. foreach (SVAOLLib.DocumentType oDoc in oDocuments) { // ERU modifica // if (oDoc.Description.ToUpper() == stName) if (oDoc.Description.ToUpper() == stName.ToUpper()) { iResult = oDoc.Id; break; } } } else { iResult = Int16.Parse(sValueFromKey); } } catch (Exception e) { throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : GetIdDocTypeByName", e.Source, e.Message), e); } return(iResult); }
public List <string> GetFieldsDocTypeByName(string stGuidConnect, string stName) { List <string> lstResult = new List <string>(); //istanzio l'oggetto SvAol.Session SVAOLLib.Session oSession = new SVAOLLib.Session(); try { //controllo se sono già connesso, in caso contrario mi connetto e ritorno la stringa di connessione oSession.GUIDconnect = stGuidConnect; //Inizializzo gli oggetti SvAol necessari SVAOLLib.DocumentTypes oDocuments = new SVAOLLib.DocumentTypes(); //Recupero tutti i Tipi documento. oDocuments = (SVAOLLib.DocumentTypes)oSession.GetDocTypes(0, 0); //il secondo 0 sta per false //Cerco il Tipo Documento con nome #stName#. foreach (SVAOLLib.DocumentType oDoc in oDocuments) { // ERU modifica // if (oDoc.Description.ToUpper() == stName) if (oDoc.Description.ToUpper() == stName.ToUpper()) { foreach (SVAOLLib.Field oFieldsDoc in oDoc.Fields) { lstResult.Add(oFieldsDoc.Id + " " + oFieldsDoc.Description); } // iResult = oDoc.Id; break; } } } catch (Exception e) { throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : GetFieldsDocTypeByName", e.Source, e.Message), e); } return(lstResult); }