示例#1
0
        private DataSet AllegatiToDataset(Allegato[] allegati)
        {
            DataSet   ds = new DataSet();
            DataTable dt = new DataTable();

            dt.Columns.Add("Codice", typeof(string));
            dt.Columns.Add("Descrizione", typeof(string));
            dt.Columns.Add("NumeroPagine", typeof(string));
            dt.Columns.Add("VersionID", typeof(string));
            dt.Columns.Add("Acquisito", typeof(bool));

            AllegatiHandler allegatiHandler = new AllegatiHandler();

            foreach (Allegato allegato in allegati)
            {
                DataRow row = dt.NewRow();

                row["Codice"]       = allegato.versionLabel;
                row["Descrizione"]  = allegato.descrizione;
                row["NumeroPagine"] = allegato.numeroPagine;
                row["VersionID"]    = allegato.versionId;

                row["Acquisito"] = allegatiHandler.IsAcquired(allegato);

                dt.Rows.Add(row);
            }

            ds.Tables.Add(dt);

            return(ds);
        }
示例#2
0
        /// <summary>
        /// Caricamento degli allegati del documento
        /// </summary>
        private void FetchAllegati()
        {
            AllegatiHandler allegatiHandler = new AllegatiHandler();

            // Reperimento degli allegati del documento
            Allegato[] allegati = allegatiHandler.GetAllegatiDocumento(this._schedaDocumento);

            this.grdAllegati.DataSource = this.AllegatiToDataset(allegati);
            this.grdAllegati.DataBind();
        }