Esempio n. 1
0
        public Boolean SendNotify(string GuidConnect, string CardId, string sOffices, string sGroups, string sUsers, string sMessages)
        {
            SVAOLLib.Offices oOfficesNotice = new SVAOLLib.Offices();
            SVAOLLib.Users   oUsersNotice   = new SVAOLLib.Users();
            SVAOLLib.Groups  oGroupsNotice  = new SVAOLLib.Groups();
            var oSession = new SVAOLLib.Session();

            //setto i server appropriati
            oSession.Server      = serverArchiflow;
            oSession.Database    = databaseArchiflow;
            oSession.GUIDconnect = GuidConnect;
            logger.Debug("Entro in connection->SendNotify");
            oOfficesNotice = this.GetOffices(GuidConnect, CardId, sOffices);
            oGroupsNotice  = this.GetGroups(GuidConnect, sGroups);
            oUsersNotice   = this.GetUsers(GuidConnect, sUsers);
            try
            {
                logger.Debug("Invio il messaggio: " + sMessages);
                oSession.SendMailMessage(oOfficesNotice, oGroupsNotice, oUsersNotice, sMessages);
                return(true);
            }
            catch (Exception e)
            {
                lErr = -1;
                logger.Error("ERRORE: " + e.Source + " - " + e.StackTrace + " - " + e.Message);
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : SendNotify", e.Source, e.Message), e);
            }
        }
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 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. 4
0
        public SVAOLLib.Groups getGroupsMailFromSharePredefinite()
        {
            SVAOLLib.Groups oGroups = new SVAOLLib.Groups();
            var             sData   = oUsersInArchiveTypeDoc.Where(b => b.TYPE == "2" && b.SENDINGTYPE == "2");

            foreach (var oGroupVis in sData)
            {
                SVAOLLib.Group oGroup = new SVAOLLib.Group();
                oGroup.Code = short.Parse(oGroupVis.ID);
                oGroups.Add(oGroup);
            }
            return(oGroups);
        }
Esempio n. 5
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. 6
0
        public static SVAOLLib.Groups getGroupsFromSharePredefinite(List <SENDOBJECTSENDENTITIESSENDENTITY> oUsersInArchiveTypeDoc)
        {
            SVAOLLib.Groups oGroups = new SVAOLLib.Groups();
            var             sData   = oUsersInArchiveTypeDoc.Where(b => b.TYPE == "2" && b.SENDINGTYPE == "1");

            /* var sData = (from item in oUsersInArchiveTypeDoc
            *                                 where item.TYPE == "2" && item.SENDINGTYPE == "1"
            *                                 select oUsersInArchiveTypeDoc).SingleOrDefault();*/
            foreach (var oGroupVis in sData)
            {
                SVAOLLib.Group oGroup = new SVAOLLib.Group();
                oGroup.Code = short.Parse(oGroupVis.ID);
                oGroups.Add(oGroup);
            }
            return(oGroups);
        }
Esempio n. 7
0
        public SVAOLLib.Groups GetGroups(string GuidConnect, string sGroups)
        {
            SVAOLLib.Groups oGroupsNotice = new SVAOLLib.Groups();
            var             oSession      = new SVAOLLib.Session();

            //setto i server appropriati
            oSession.Server      = serverArchiflow;
            oSession.Database    = databaseArchiflow;
            oSession.GUIDconnect = GuidConnect;

            try
            {
                foreach (string sGroup in sGroups.Split('|'))
                {
                    if (!string.IsNullOrEmpty(sGroup))
                    {
                        var            oGroupsFound = oSession.GetAllGroups(1);
                        SVAOLLib.Group ogroup       = new SVAOLLib.Group();
                        foreach (var oGrp in oGroupsFound)
                        {
                            if (oGrp.Name == sGroup)
                            {
                                logger.Debug("Gruppo Trovato");
                                oGroupsNotice.Add(oGrp);
                                break;
                            }
                            logger.Debug("userid: " + oGrp.Name);
                        }
                        ;
                    }
                }
                return(oGroupsNotice);
            }
            catch (Exception e)
            {
                lErr = -1;
                logger.Error("ERRORE: " + e.Source + " - " + e.StackTrace + " - " + e.Message);
                throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : GetGroups", e.Source, e.Message), e);
            }
        }