Esempio n. 1
0
        public CardVisibilityManager(string sGuidCard, string strConnection)
        {
            Guid oCardId;

            if (sGuidCard.Length > 12)                             // set the guid of the card
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(sGuidCard.Substring(24, 12)).ToString("000000000000"));
            }
            else
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(sGuidCard).ToString("000000000000"));
            }
            SVAOLLib.Card oCard = new SVAOLLib.Card();
            oCard.GUIDconnect = strConnection;
            oCard.GuidCard    = oCardId.ToString();
            oCard.LoadFromGuid();
            sVisibilityXml = oCard.GetVisibilityAsXML();
            sVisibilityXml = sVisibilityXml.Substring(0, sVisibilityXml.Length - 1);
            using (XmlReader xmlReader = XmlReader.Create(new StringReader(sVisibilityXml)))
            {
                XmlSerializer serializer            = new XmlSerializer(typeof(SENDOBJECT));
                SENDOBJECT    deserializedVisEntity = serializer.Deserialize(xmlReader) as SENDOBJECT;
                oUsersInArchiveTypeDoc = (from item in deserializedVisEntity.Items
                                          where item.GetType().ToString() == "Siav.APFlibrary.Model.SENDOBJECTSENDENTITIES"
                                          let cardsdoctypes = item as SENDOBJECTSENDENTITIES
                                                              from docType in cardsdoctypes.SENDENTITY
                                                              select docType).ToList();
            }
        }
Esempio n. 2
0
        public Boolean RemoveVisibility(string GuidConnect, string sGuidCard, string sUsers, string sOffices, string sGroups)
        {
            bool bResult = false;

            SVAOLLib.Offices oOfficesNotice = new SVAOLLib.Offices();
            SVAOLLib.Users   oUsersNotice   = new SVAOLLib.Users();
            SVAOLLib.Groups  oGroupsNotice  = new SVAOLLib.Groups();
            var oSession = new SVAOLLib.Session();
            ConnectionManager oConnectionManager = new ConnectionManager(logger);

            logger.Debug("Entro in connection->RemoveVisibility");
            oOfficesNotice = oConnectionManager.GetOffices(GuidConnect, sGuidCard, sOffices);
            oGroupsNotice  = oConnectionManager.GetGroups(GuidConnect, sGroups);
            oUsersNotice   = oConnectionManager.GetUsers(GuidConnect, sUsers);
            try
            {
                SVAOLLib.Card card = GetCardFromId(GuidConnect, sGuidCard);
                card.RemoveVisibility(oOfficesNotice, oGroupsNotice, oUsersNotice);
                bResult = true;
            }
            catch (Exception e)
            {
                lErr = -1;
                logger.Error("ERRORE: " + e.Source + " - " + e.StackTrace + " - " + e.Message);
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : RemoveVisibility", e.Source, e.Message), e);
            }
            return(bResult);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
 public SVAOLLib.Card GetCardFromId(string GuidConnect, string CardId)
 {
     SVAOLLib.Card oCard = new SVAOLLib.Card();
     oCard.GUIDconnect = GuidConnect;
     oCard.GuidCard    = _Logger.FormatID(CardId);
     oCard.LoadFromGuid();
     return(oCard);
 }
Esempio n. 5
0
        public Boolean AddVisibility(string GuidConnect, string sGuidCard, string sUsers, string sOffices, string sGroups, SVAOLLib.Offices oMailOffices = null, SVAOLLib.Groups oMailGroups = null, SVAOLLib.Users oMailUsers = null)
        {
            int  iStateWf        = 0;
            bool bResult         = false;
            bool bWorkflowActice = false;

            SVAOLLib.Offices oOfficesNotice = new SVAOLLib.Offices();
            SVAOLLib.Users   oUsersNotice   = new SVAOLLib.Users();
            SVAOLLib.Groups  oGroupsNotice  = new SVAOLLib.Groups();
            if (oMailOffices == null)
            {
                oMailOffices = new SVAOLLib.Offices();
            }
            if (oMailGroups == null)
            {
                oMailGroups = new SVAOLLib.Groups();
            }
            if (oMailUsers == null)
            {
                oMailUsers = new SVAOLLib.Users();
            }
            var oSession = new SVAOLLib.Session();
            ConnectionManager oConnectionManager = new ConnectionManager(logger);

            logger.Debug("Entro in connection->AddVisibility");
            oOfficesNotice = oConnectionManager.GetOffices(GuidConnect, sGuidCard, sOffices);
            oGroupsNotice  = oConnectionManager.GetGroups(GuidConnect, sGroups);
            oUsersNotice   = oConnectionManager.GetUsers(GuidConnect, sUsers);
            try
            {
                SVAOLLib.Card card = GetCardFromId(GuidConnect, sGuidCard);
                if (card.ProcWF != 0)
                {
                    iStateWf = (int)card.ProcWF;
                    card.ModifyProcWf(SVAOLLib.svProcWF.svPWFNothing);
                    bWorkflowActice = true;
                }
                card.Offices = oOfficesNotice;
                card.Users   = oUsersNotice;
                card.Groups  = oGroupsNotice;

                card.Send(oMailOffices, oMailGroups, oMailUsers, "", "");
                if (bWorkflowActice)
                {
                    card.ModifyProcWf((SVAOLLib.svProcWF)iStateWf);
                }
                bResult = true;
            }
            catch (Exception e)
            {
                lErr = -1;
                logger.Error("ERRORE: " + e.Source + " - " + e.StackTrace + " - " + e.Message);
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : RemoveVisibility", e.Source, e.Message), e);
            }
            return(bResult);
        }
Esempio n. 6
0
        public List <dynamic> GetAttachmentExt(string stGuidConnect, SVAOLLib.Card gCard, List <string> idAttachments, Boolean addBinary = true)
        {
            //Controllo se non è stato aperto già un File di Log
            bool newcon = false;

            //controllo se sono già connesso, in caso contrario mi connetto e ritorno la stringa di connessione
            SVAOLLib.Session oSession = new SVAOLLib.Session();
            oSession.GUIDconnect = stGuidConnect;
            SVAOLLib.Attachment oAttachmentFrom = new SVAOLLib.Attachment();
            oAttachmentFrom.GUIDconnect = stGuidConnect;
            oAttachmentFrom.GuidCard    = gCard.GuidCard;

            dynamic        objAttachment;
            Object         aBinaryData    = new Object();
            List <dynamic> objAttachments = new List <dynamic>();

            try
            {
                int iCount;
                object[,] attachments = (object[, ])gCard.AttachmentsAsArray;
                for (iCount = 1; iCount < attachments.GetLength(0); iCount++)
                {
                    if (Convert.ToInt32(attachments[iCount, 3]) == 0)
                    {
                        objAttachment               = new DynamicDictionary();
                        objAttachment.id            = attachments[iCount, 1].ToString();
                        objAttachment.nomefile      = attachments[iCount, 4].ToString();
                        objAttachment.note          = attachments[iCount, 2].ToString();
                        objAttachment.binarycontent = Convert.ToBase64String((byte[])(aBinaryData));
                        objAttachments.Add(objAttachment);
                    }
                }
                return(objAttachments);
            }
            catch (Exception e)
            {
                _Logger.WriteOnLog(_sLogId, "ERRORE NELL'ESECUZIONE DI : GetAttachmentExt", 1);
                _Logger.WriteOnLog(_sLogId, e.Source + "  " + e.Message, 1);
                return(null);

                throw new Exception(String.Format("{0}>>{1}>>{2}", "GetAttachmentExt", e.Source, e.Message), e);
            }
            finally
            {
                if (newcon)
                {
                    oSession.Logout();
                }
            }
        }
Esempio n. 7
0
        /// <summary>

        /// Costruisce il link alla scheda documentale per il progressivo assoluto specificato.

        /// E' importante che nel fileXml1 venga impostata la variabile ROOT_URL con l'indirizzo

        /// dell'ambiente Archiflow Web, e.g. http://eslq77:81/archiflow/

        /// </summary>

        /// <param name="stGuidConnect">GUID connection per la session SVAOL</param>

        /// <param name="CardAbsId">Il progressivo assoluto della scheda di interesse</param>

        /// <param name="LogId">Nome del file di log</param>

        /// <returns>HyperLink alla scheda documentale</returns>
        ///


        public static SVAOLLib.Card SendCardFromId(string CardId, string GuidConnect, SVAOLLib.Offices oOffices, SVAOLLib.Groups oGroups, SVAOLLib.Users oUsers, string SAnnotation, string sMessage, SVAOLLib.Offices oMailOffices = null, SVAOLLib.Groups oMailGroups = null, SVAOLLib.Users oMailUsers = null)
        {
            int  iStateWf        = 0;
            bool bWorkflowActice = false;

            if (oMailOffices == null)
            {
                oMailOffices = new SVAOLLib.Offices();
            }
            if (oMailGroups == null)
            {
                oMailGroups = new SVAOLLib.Groups();
            }
            if (oMailUsers == null)
            {
                oMailUsers = new SVAOLLib.Users();
            }
            SVAOLLib.Card card = new SVAOLLib.Card();

            card.GUIDconnect = GuidConnect;
            Guid oCardId;

            if (CardId.Length > 12)                             // set the guid of the card
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(CardId.Substring(24, 12)).ToString("000000000000"));
            }
            else
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(CardId).ToString("000000000000"));
            }
            card.GuidCard = oCardId.ToString();
            card.LoadFromGuid();
            if (card.ProcWF != 0)
            {
                iStateWf = (int)card.ProcWF;
                card.ModifyProcWf(SVAOLLib.svProcWF.svPWFNothing);
                bWorkflowActice = true;
            }
            card.Offices = oOffices;
            card.Users   = oUsers;
            card.Groups  = oGroups;

            card.Send(oMailOffices, oMailGroups, oMailUsers, SAnnotation, sMessage);
            if (bWorkflowActice)
            {
                card.ModifyProcWf((SVAOLLib.svProcWF)iStateWf);
            }
            return(card);
        }
Esempio n. 8
0
 public Boolean SetSingleFieldValue(string GuidConnect, string CardId, long FieldId, string FieldValue)
 {
     try
     {
         SVAOLLib.Card   card   = GetCardFromId(GuidConnect, CardId);
         SVAOLLib.Fields fields = (SVAOLLib.Fields)card.Fields;
         string          result = SetFieldValue(ref fields, Convert.ToInt64(FieldId), FieldValue);
         card.Modify(0);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : SetSingleFieldValue", e.Source, e.Message), e);
     }
 }
Esempio n. 9
0
        public CardManager(LOLIB Logger, string sLogId, string card = "", string connection = "")
        {
            resourceFileManager = ResourceFileManager.Instance;
            resourceFileManager.SetResources();

            _sLogId = sLogId;
            _Logger = Logger;
            if (card != "" && connection != "")
            {
                SVAOLLib.Card sampleCard = new SVAOLLib.Card();
                sampleCard.GUIDconnect = connection;
                sampleCard.GuidCard    = card;
                sampleCard.LoadFromGuid();
                thisCard = sampleCard;
            }
        }
Esempio n. 10
0
        public CardManager(Logger oLogger, string card = "", string connection = "")
        {
            if (oLogger != null)
            {
                logger = oLogger;
            }

            if (card != "" && connection != "")
            {
                SVAOLLib.Card sampleCard = new SVAOLLib.Card();
                sampleCard.GUIDconnect = connection;
                sampleCard.GuidCard    = card;
                sampleCard.LoadFromGuid();
                thisCard = sampleCard;
            }
        }
Esempio n. 11
0
        public Boolean SetInternalAttach(string stGuidConnect, string stguidCardTo, string sGUIDAttachment, string note, string internalNote, bool bBiunivoc)
        {
            //Controllo se non è stato aperto già un File di Log

            //è la variabile da ritornare
            Boolean SetCirAtt = false;

            try
            {                //controllo se sono già connesso, in cvaso contrario mi connetto e ritorno la stringa di connessione
                if (stGuidConnect.Length != 0)
                {
                    stguidCardTo = _Logger.FormatID(stguidCardTo);

                    SVAOLLib.Card oCard = new SVAOLLib.Card();;
                    oCard.GUIDconnect = stGuidConnect;
                    oCard.GuidCard    = stguidCardTo;
                    oCard.LoadFromGuid();
                    string sNumProt = this.GetSingleFieldValue(stGuidConnect, sGUIDAttachment, 0).ToString();
                    SVAOLLib.Attachment oAttachmentTo;
                    // Se la GUIDCard non è formattata lo faccio ora
                    sGUIDAttachment = _Logger.FormatID(sGUIDAttachment);
                    // Imposto l'allegato della scheda
                    oAttachmentTo                = new SVAOLLib.Attachment();
                    oAttachmentTo.Archive        = oCard.Archive;
                    oAttachmentTo.GuidCard       = stguidCardTo;
                    oAttachmentTo.GUIDconnect    = stGuidConnect;
                    oAttachmentTo.GUIDAttachment = sGUIDAttachment;
                    oAttachmentTo.Note           = note;
                    oAttachmentTo.InternalNote   = internalNote;
                    oAttachmentTo.IsInternal     = 1;
                    oAttachmentTo.Name           = sNumProt;
                    int iBiunivoc = bBiunivoc ? 1 : 0;
                    oAttachmentTo.InsertInternal(iBiunivoc);
                    SetCirAtt = true;
                }
            }
            catch (Exception e)
            {
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : SetInternalAttach: " + e.StackTrace, e.Source, e.Message), e);
            }
            finally
            {
            }

            return(SetCirAtt);
        }
Esempio n. 12
0
        public static SVAOLLib.Card GetCardFromId(string GuidConnect, string CardId)
        {
            SVAOLLib.Card card = new SVAOLLib.Card();
            card.GUIDconnect = GuidConnect;
            Guid oCardId;

            if (CardId.Length > 12)                             // set the guid of the card
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(CardId.Substring(24, 12)).ToString("000000000000"));
            }
            else
            {
                oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(CardId).ToString("000000000000"));
            }
            card.GuidCard = oCardId.ToString();
            card.LoadFromGuid();
            return(card);
        }
Esempio n. 13
0
        public List <Model.Attachment> Attachment(string stGuidConnect, SVAOLLib.Card gCard, List <string> idAttachments, Boolean addBinary = true)
        {
            //var att = UtilSvCard.attchment(sConnection, oSvCard, LogId, idAttachments, true);
            List <dynamic> lAttachmentExt = new List <dynamic>();

            using (var oCardManager = new CardManager(_Logger, _sLogId))
            {
                lAttachmentExt = oCardManager.GetAttachmentExt(stGuidConnect, gCard, idAttachments, true);
            }
            List <Model.Attachment> oAttachments = new List <Model.Attachment>();

            foreach (var singleAttach in lAttachmentExt)
            {
                Model.Attachment oAttachment = new Model.Attachment();
                oAttachment.BinaryContent = singleAttach.binarycontent;
                oAttachment.Filename      = singleAttach.nomefile;
                oAttachment.Note          = singleAttach.note;
                oAttachments.Add(oAttachment);
            }
            return(oAttachments);
        }
Esempio n. 14
0
        public Boolean RemoveAllVisibility(string GuidConnect, string sGuidCard)
        {
            bool bResult  = false;
            var  oSession = new SVAOLLib.Session();
            ConnectionManager oConnectionManager = new ConnectionManager(logger);

            logger.Debug("Entro in connection->RemoveAllVisibility");
            try
            {
                CardVisibilityManager visibilityFromCard = new CardVisibilityManager(sGuidCard, GuidConnect);
                //logger.Debug("Leggo la visibilità della scheda: " + CardId);
                //WcfGdpd.WsCard.Group dValue1 = (WcfGdpd.WsCard.Group)Convert.ChangeType(visibilityFromCard.getGroupFromVisibility(resourceFileManager.getConfigData("GroupVisibilityRiservato")), typeof(WcfGdpd.WsCard.Group));
                //var elio= Convert.ChangeType(visibilityFromCard.getGroupFromVisibility(resourceFileManager.getConfigData("GroupVisibilityRiservato")), typeof(WcfGdpd.WsCard.Group));
                var groupsWCF = visibilityFromCard.getGroupsFromSharePredefinite();
                //logger.Debug("Ricavo la visibilità predefinita dai gruppi: " + sGuidCard);
                var officesWCF = visibilityFromCard.getOfficesFromSharePredefinite();
                //logger.Debug("Ricavo la visibilità predefinita dagli uffici: " + sGuidCard);
                var usersWCF = visibilityFromCard.getUsersFromSharePredefinite();
                //logger.Debug("Ricavo la visibilità predefinita dagli utenti: " + sGuidCard);
                var groupsMailWCF = visibilityFromCard.getGroupsMailFromSharePredefinite();
                //logger.Debug("Ricavo la visibilità predefinita dai gruppi con notifica: " + sGuidCard);
                var officesMailWCF = visibilityFromCard.getOfficesMailFromSharePredefinite();
                //logger.Debug("Ricavo la visibilità predefinita dagli uffici con notifica: " + sGuidCard);
                var usersMailWCF = visibilityFromCard.getUsersMailFromSharePredefinite();

                SVAOLLib.Card card = GetCardFromId(GuidConnect, sGuidCard);
                card.RemoveVisibility(officesWCF, groupsWCF, usersWCF);
                bResult = true;
            }
            catch (Exception e)
            {
                lErr = -1;
                logger.Error("ERRORE: " + e.Source + " - " + e.StackTrace + " - " + e.Message);
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : RemoveVisibility", e.Source, e.Message), e);
            }
            return(bResult);
        }