Пример #1
0
        public bool ExportAnagraficaFunzioni(XmlDocument doc, XmlNode root)
        {
            bool result = true;           //presume successo

            try
            {
                System.Data.DataSet dataSetFunzioniElementari;
                DocsPaDB.Query_DocsPAWS.AmministrazioneXml amministrazioneXml = new DocsPaDB.Query_DocsPAWS.AmministrazioneXml();
                result = amministrazioneXml.Exp_GetFunzioniElementari(out dataSetFunzioniElementari);
                if (!result)
                {
                    logger.Debug("Errore lettura anagrafica funzioni elementari");
                    throw new Exception();
                }

                if (dataSetFunzioniElementari != null)
                {
                    XmlNode funzioniElementari = root.AppendChild(doc.CreateElement("FUNZIONIELEMENTARI"));
                    foreach (System.Data.DataRow rowFunzioni in dataSetFunzioniElementari.Tables["FUNZIONIELEMENTARI"].Rows)
                    {
                        XmlNode funzioneElementare = funzioniElementari.AppendChild(doc.CreateElement("FUNZIONEELEMENTARE"));
                        funzioneElementare.AppendChild(doc.CreateElement("DESCRIZIONE")).InnerText = rowFunzioni["VAR_DESC_FUNZIONE"].ToString();
                        funzioneElementare.AppendChild(doc.CreateElement("CODICE")).InnerText      = rowFunzioni["COD_FUNZIONE"].ToString().ToUpper();
                        string tipoFunzFull = "Full";
                        string tipoFunz     = rowFunzioni["CHA_TIPO_FUNZ"].ToString();
                        if (tipoFunz == "R")
                        {
                            tipoFunzFull = "Read";
                        }
                        if (tipoFunz == "W")
                        {
                            tipoFunzFull = "Write";
                        }
                        funzioneElementare.AppendChild(doc.CreateElement("ACCESSO")).InnerText = tipoFunzFull;
                    }
                }
            }
            catch (Exception exception)
            {
                logger.Debug("Errore durante l'esportazione della anagrafica funzioni elementari", exception);
                result = false;
            }
            return(result);
        }