Example #1
0
        public string SendBilancio()
        {
            //effettuo la prima validazione
            if (_rendiconto.IsRegionale)
            {
                CheckRegione(_rendiconto);
            }
            else
            {
                CheckRegioneProvincia(_rendiconto);
            }
            //effettuo la trasformazione con i proxy
            FenealgestServices.DTORendiconto r = TransformToProxyCompatibleData();


            FenealgestServices.Credenziali c = new FenealgestServices.Credenziali();
            c.UserName = _userName;
            c.Password = _password;
            c.Province = _place;

            FenealgestServices.FenealgestwebServices service = new FenealgestServices.FenealgestwebServices();

            service.CredenzialiValue = c;

            string result = "";

            if (_forRlst)
            {
                result = service.ImportRendicontoRlstNew(r);
            }
            else
            {
                result = service.ImportRendicontoNew(r);
            }


            return(result);
        }
Example #2
0
        private FenealgestServices.DTORendiconto TransformToProxyCompatibleData()
        {
            FenealgestServices.DTORendiconto r = new FenealgestServices.DTORendiconto();

            r.Anno = _rendiconto.Anno;
            r.IsBilancioQuadrato   = _rendiconto.IsBilancioQuadrato;
            r.IsPreventivoQuadrato = _rendiconto.IsPreventivoQuadratoQuadrato;
            r.IsRegionale          = _rendiconto.IsRegionale;
            r.Proprietario         = _rendiconto.Proprietario;
            r.Provincia            = _rendiconto.Provincia;
            r.Regione           = _rendiconto.Regione;
            r.StatoPatrimoniale = _rendiconto.StatoPatrimoniale;
            r.ContoRLST         = _rendiconto.ContoRLST;
            r.Versione          = _rendiconto.Version;

            FenealgestServices.DTORendicontoItem[] items = new FenealgestServices.DTORendicontoItem[] { };
            foreach (DTORendicontoItem item in _rendiconto.Items)
            {
                FenealgestServices.DTORendicontoItem i = new FenealgestServices.DTORendicontoItem();
                i.DescrizioneNodo       = item.DescrizioneNodo;
                i.IdNodo                = item.IdNodo;
                i.IdNodoPadre           = item.IdNodoPadre;
                i.ImportoNodoBilancio   = item.ImportoBilancio;
                i.ImportoNodoPreventivo = item.ImportoPreventivo;
                i.IsLeaf                = item.IsLeaf;
                i.Livello               = item.Livello;

                Array.Resize <FenealgestServices.DTORendicontoItem>(ref items, items.Length + 1);
                items[items.Length - 1] = i;
            }

            r.Items = items;



            return(r);
        }