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); } }
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); }
public void setCardVisibilityDefaultConnLess(string sConnection, string CardId, string LogId = "") { try { //logger.Debug("Aperta connessione:" + sConnection); CardVisibilityManager visibilityFromCard = new CardVisibilityManager(CardId, sConnection); //logger.Debug("Leggo la visibilità della scheda: " + CardId); SVAOLLib.Offices oOffices = new SVAOLLib.Offices(); SVAOLLib.Users oUsers = new SVAOLLib.Users(); //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(); //logger.Debug("Ricavo la visibilità predefinita dagli utenti con notifica: " + sGuidCard); //Mapper.Map(groupWCF, groupRiservato, Group, SVAOLLib.Group); CardManager.SendCardFromId(CardId, sConnection, officesWCF, groupsWCF, usersWCF, "", "", officesMailWCF, groupsMailWCF, usersMailWCF); //logger.Debug("Condivisione eseguita: " + sGuidCard); } catch (Exception e) { throw new Exception(String.Format("{0}>>{1}>>{2}", "ERRORE : SetSingleFieldValue", e.Source, e.Message), e); } }
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); }
public SVAOLLib.Users getUsersMailFromSharePredefinite() { SVAOLLib.Users oUsers = new SVAOLLib.Users(); var sData = oUsersInArchiveTypeDoc.Where(b => b.TYPE == "0" && b.SENDINGTYPE == "2"); foreach (var oUserVis in sData) { SVAOLLib.User oUser = new SVAOLLib.User(); oUser.Code = short.Parse(oUserVis.ID); oUsers.Add(oUser); } return(oUsers); }
public static SVAOLLib.Users getUsersFromSharePredefinite(List <SENDOBJECTSENDENTITIESSENDENTITY> oUsersInArchiveTypeDoc) { SVAOLLib.Users oUsers = new SVAOLLib.Users(); var sData = oUsersInArchiveTypeDoc.Where(b => b.TYPE == "0" && b.SENDINGTYPE == "1"); //(from item in oUsersInArchiveTypeDoc where item.TYPE == "0" && item.SENDINGTYPE == "1" select oUsersInArchiveTypeDoc); foreach (var oUserVis in sData) { SVAOLLib.User oUser = new SVAOLLib.User(); oUser.Code = short.Parse(oUserVis.ID); oUsers.Add(oUser); } return(oUsers); }
/// <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); }
public SVAOLLib.Users GetUsers(string GuidConnect, string sUsers) { SVAOLLib.Users oUsersNotice = new SVAOLLib.Users(); var oSession = new SVAOLLib.Session(); //setto i server appropriati oSession.Server = serverArchiflow; oSession.Database = databaseArchiflow; oSession.GUIDconnect = GuidConnect; try { foreach (string sUser in sUsers.Split('|')) { if (!string.IsNullOrEmpty(sUser)) { logger.Debug("Elaboro il l'utente: " + sUser); var oUsersFound = oSession.GetAllUsers(0); foreach (var oUsr in oUsersFound) { if (oUsr.UserID == sUser) { logger.Debug("Utente Trovato"); oUsersNotice.Add(oUsr); break; } logger.Debug("userid: " + oUsr.UserID); } ; } } return(oUsersNotice); } 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); } }