Exemplo n.º 1
0
        protected override void DisplayContenuto(Scheda scheda, TableLayoutPanel table, Contenuto con, int level)
        {
            String tabs = "";

            for (int i = 0; i < level; i++)
            {
                tabs += "      ";
            }

            String[] currentId = new String[2] {
                scheda.IdScheda, con.Id
            };

            String key = con.Id;
            Label  l   = new Label();

            l.AutoSize = true;
            l.Text     = tabs + key;

            table.Controls.Add(l);

            Label l2 = new Label();

            l2.AutoSize = true;
            l2.Text     = _values[GenerateId(currentId)][0] + "";
            table.Controls.Add(l2);

            TextBox tb = new TextBox();

            tb.Text = _values[GenerateId(currentId)][1] == null ? "" : _values[GenerateId(currentId)][1];

            table.Controls.Add(tb);

            String[] ProprietaTag = new String[] { scheda.IdScheda, con.Id, scheda.GetValore(con.Id), null };
            //ID scheda | ID campo | Valore vecchio | Valore nuovo

            Button conferma = new Button();

            conferma.Text     = "Conferma";
            conferma.AutoSize = true;
            conferma.Tag      = new Object[] { currentId, tb };
            conferma.Click   += ModificaCampoScheda;
            table.Controls.Add(conferma);

            Button cancella = new Button();

            cancella.Text     = "Cancella";
            cancella.AutoSize = true;
            cancella.Tag      = new Object[] { currentId, tb };
            cancella.Click   += RipristinaCampoScheda;
            table.Controls.Add(cancella);

            if (_values[GenerateId(currentId)][1] != null)
            {
                tb.BackColor = Color.Yellow;
            }
        }
Exemplo n.º 2
0
        public Contenuto creaStrutturaContenuto(FolderConservazione[] folders, string idFascicolo, DocsPaVO.utente.InfoUtente infoUtente, ref DocsPaConservazione.Metadata.Fascicolo.Fascicolo fascicolo)
        {
            Contenuto             cnt         = new Contenuto();
            List <Sottofascicolo> sfLst       = new List <Sottofascicolo>();
            List <object>         sfLstPuliti = new List <object>();

            int             nrDocumenti      = 0;
            int             nrSottofascicoli = 0;
            List <object>   contentItems     = new List <object>();
            List <DateTime> dtList           = new List <DateTime>();

            foreach (FolderConservazione f in folders)
            {
                if (f.parent != idFascicolo)//E' il fascicolo stesso (record C)
                {
                    nrSottofascicoli++;
                }

                List <object> objSfLst = new List <object>();
                if (f.ID_Profile != null)
                {
                    foreach (string item in f.ID_Profile)
                    {
                        nrDocumenti++;
                        InfoDocumento id = BusinessLogic.Documenti.DocManager.GetInfoDocumento(infoUtente, item, item);
                        DateTime      dc = Utils.convertiData(id.dataApertura);
                        dtList.Add(dc);
                        String dataCreazione = Utils.formattaData(dc);

                        Fascicolo.Documento d = new Fascicolo.Documento {
                            IDdocumento = item, Oggetto = id.oggetto, DataCreazione = dataCreazione, LivelloRiservatezza = Utils.convertiLivelloRiservatezza(id.privato)
                        };
                        // Documento d = new Documento { IDdocumento = item };

                        objSfLst.Add(d);
                    }
                }
                Sottofascicolo sottof = new Sottofascicolo {
                    Codice = f.systemID, Descrizione = f.descrizione, parent = f.parent, Items = objSfLst.ToArray()
                };
                sfLst.Add(sottof);
            }

            List <FolderConservazione> fclst = new List <FolderConservazione>();

            foreach (Sottofascicolo s in sfLst)
            {
                var           b    = (from pippo in sfLst where pippo.parent == s.Codice select pippo).ToArray();
                List <object> otmp = s.Items.ToList();
                otmp.AddRange(b);
                s.Items = otmp.ToArray();
            }

            foreach (Sottofascicolo s in sfLst)
            {
                if (s.parent == idFascicolo)
                {
                    foreach (object si in s.Items)
                    {
                        sfLstPuliti.Add(si);
                    }
                }
            }


            cnt.Items = sfLstPuliti.ToArray();
            cnt.ConsistenzaDocumenti      = nrDocumenti.ToString();
            cnt.ConsistenzaSottofascicoli = nrSottofascicoli.ToString();

            dtList.Sort();

            fascicolo.EstremoCronologicoInferiore = Utils.formattaData(dtList.LastOrDefault());
            fascicolo.EstremoCronologicoSuperiore = Utils.formattaData(dtList.FirstOrDefault());
            return(cnt);
        }
Exemplo n.º 3
0
        protected override void DisplayContenuto(Scheda scheda, TableLayoutPanel table, Contenuto con, int level)
        {
            String tabs = "";

            for (int i = 0; i < level; i++)
            {
                tabs += "      ";
            }

            String[] currentId = new String[] { scheda.IdScheda, con.Id };

            String key = con.Id;
            Label  l   = new Label();

            l.AutoSize = true;
            l.Text     = tabs + key;
            table.Controls.Add(l);

            Label l2 = new Label();

            l2.AutoSize = true;
            l2.Text     = _values[GenerateId(currentId)][0] + "";
            table.Controls.Add(l2);

            TextBox tb = new TextBox();

            tb.Text = _values[GenerateId(currentId)][1] == null ? "" : _values[GenerateId(currentId)][1];
            table.Controls.Add(tb);

            String[] ProprietaTag = new String[] { scheda.IdScheda, con.Id, scheda.GetValore(con.Id), null };
            //ID scheda | ID campo | Valore vecchio | Valore nuovo


            Button conferma = new Button();

            conferma.Tag      = new Object[] { currentId, tb };
            conferma.AutoSize = true;
            if (con.ConfermaMaster)
            {
                conferma.Text   = "Richiedi modifica";
                conferma.Click += RichiediModificaCampoScheda;
            }
            else
            {
                conferma.Text   = "Modifica";
                conferma.Click += ModificaCampoScheda;
            }

            table.Controls.Add(conferma);

            Button prova = new Button();

            prova.AutoSize = true;
            prova.Text     = "Prova";
            prova.Tag      = new Object[] { currentId, con.FormulaProva };
            prova.Click   += EseguiProva;
            table.Controls.Add(prova);
            if (!con.Modificabile)
            {
                tb.Enabled       = false;
                conferma.Enabled = false;
            }
            if (String.IsNullOrEmpty(con.FormulaProva.Trim()))
            {
                prova.Enabled = false;
            }
        }
Exemplo n.º 4
0
        //public Task<int> SaveContenutoAsync(Contenuto item)
        //{
        //    if (item.Id /*!*/== 0)
        //    {
        //        return Database.UpdateAsync(item);
        //    }
        //    else
        //    {
        //        return Database.InsertAsync(item);
        //    }
        //}

        public Task <int> DeleteContenutoAsync(Contenuto item)
        {
            return(Database.DeleteAsync(item));
        }