예제 #1
0
        public List <dynamic> GetIndiciScheda(string stGuidConnect, string sGuidCard)
        {
            List <dynamic> oModelCard = new List <dynamic>();
            dynamic        index      = "";

            index = new DynamicDictionary();
            SVAOLLib.Card oCard;

            oCard = new SVAOLLib.Card();
            SVAOLLib.Session oSession = new SVAOLLib.Session();
            oSession.GUIDconnect = stGuidConnect;
            oCard.GUIDconnect    = stGuidConnect;
            oCard.GuidCard       = _Logger.FormatID(sGuidCard);
            oCard.LoadFromGuid();

            List <string> IndiciScheda = new List <string>();

            string[] buffer = new string[21];
            IndiciScheda = buffer.ToList();
            foreach (SVAOLLib.Field oField in (SVAOLLib.Fields)oCard.Fields)
            {
                index.id          = oField.Id;
                index.description = oField.Description;
                if (oField.Value != null)
                {
                    index.value = oField.Value.ToString();
                }
                else
                {
                    index.value = "";
                }
                oModelCard.Add(index);
            }
            return(oModelCard);
        }
예제 #2
0
        public svMainDoc GetMainDoc(string stGuidConnect, string stGuidCard)
        {
            svMainDoc oMainDoc = new svMainDoc();
            //Controllo se non è stato aperto già un File di Log
            bool newcon = false;

            //istanzio l'oggetto SvAol.Session
            SVAOLLib.Session oSession = new SVAOLLib.Session();
            try
            {
                if (stGuidConnect.Length != 0)
                {
                    //Assegno la stringa di connessione
                    oSession.GUIDconnect = stGuidConnect;

                    // dichiaro l'oggetto SvAol.Card per la Card
                    SVAOLLib.Card oCard = new SVAOLLib.Card();

                    //Imposto la scheda con GUID Card.
                    oCard.GuidCard    = _Logger.FormatID(stGuidCard);
                    oCard.GUIDconnect = stGuidConnect;
                    oCard.LoadFromGuid();
                    SVAOLLib.Document oDocumento = oCard.Document;

                    if (oDocumento.FileSize > 0)
                    {
                        oMainDoc.Filename  = oDocumento.Name + "." + oDocumento.Extension;
                        oMainDoc.Extension = oDocumento.Extension;
                        if (oDocumento.IsSigned == 0 && oDocumento.IsSignedPdf == 0)
                        {
                            oMainDoc.IsSigned = false;

                            oMainDoc.oByte = (byte[])(oDocumento.ViewAsArray(0, 0));
                        }
                        else
                        {
                            oMainDoc.IsSigned = true;
                            oMainDoc.oByte    = (byte[])(oDocumento.GetSignedDocumentAsArray());
                        }
                    }
                }
            }
            catch (Exception e)
            {
                throw new Exception(String.Format("{0}>>{1}>>{2}", "GetMainDoc", e.Source, e.Message), e);
            }
            finally
            {
                if (newcon)
                {
                    oSession.Logout();
                }
            }
            return(oMainDoc);
        }