Exemplo n.º 1
0
        protected override void DataBind()
        {
            _resolutionDataSet = new ResolutionDataSet();
            foreach (var resolution in Items)
            {
                var row = _resolutionDataSet.ResolutionLetterDataTable.NewResolutionLetterDataTableRow();
                row.Resolution_ID                = resolution.Id.ToString(CultureInfo.InvariantCulture);
                row.Resolution_Year              = resolution.Year.ToString();
                row.Resolution_Number            = resolution.Number.ToString();
                row.Resolution_FullNumber        = ResolutionJournalPrinter.GetDetermina(resolution);
                row.Resolution_Controllo         = ResolutionJournalPrinter.GetControllo(resolution);
                row.Resolution_AdoptionDate      = resolution.AdoptionDate.HasValue ? resolution.AdoptionDate.Value.ToString("dd/MM/yyyy") : string.Empty;
                row.Resolution_PublishingDate    = resolution.PublishingDate.HasValue ? resolution.PublishingDate.Value.ToString("dd/MM/yyyy") : string.Empty;
                row.Resolution_EffectivenessDate = resolution.EffectivenessDate.HasValue ? resolution.EffectivenessDate.Value.ToString("dd/MM/yyyy") : string.Empty;
                row.Resolution_RetiredDate       = resolution.LeaveDate.HasValue ? resolution.LeaveDate.Value.ToString("dd/MM/yyyy") : string.Empty;

                row.Resolution_Object = resolution.ResolutionObject;

                // CONTENITORE
                if (resolution.Container != null)
                {
                    row.Container_ID             = resolution.Container.Id;
                    row.Container_Description    = resolution.Container.Name;
                    row.Resolution_HeadingLetter = resolution.Container.HeadingLetter;
                }

                _resolutionDataSet.ResolutionLetterDataTable.Rows.Add(row);
            }
            PrimaryTableName = "ResolutionLetterDataTable";
            DataSource       = _resolutionDataSet;
        }
Exemplo n.º 2
0
        protected override void DataBind()
        {
            _resolutionDataSet = new ResolutionDataSet();
            foreach (var resolution in Items)
            {
                var cat = resolution.Category;

                var row = _resolutionDataSet.ResolutionDataTable.NewResolutionDataTableRow();
                row.Resolution_ID           = resolution.Id.ToString(CultureInfo.InvariantCulture);
                row.Resolution_Year         = resolution.Year.ToString();
                row.Resolution_Number       = resolution.Number.ToString();
                row.Resolution_AdoptionDate = resolution.AdoptionDate.HasValue ? resolution.AdoptionDate.Value.ToString("dd/MM/yyyy") : string.Empty;
                row.Resolution_FullNumber   = ResolutionJournalPrinter.GetDetermina(resolution);
                row.Resolution_Controllo    = ResolutionJournalPrinter.GetControllo(resolution);
                if (resolution.ImmediatelyExecutive.HasValue)
                {
                    row.Resolution_ImmediatelyExecutive = resolution.ImmediatelyExecutive.ToString();
                }

                row.Resolution_Object = resolution.ResolutionObject;
                if (resolution.ProposeDate.HasValue)
                {
                    row.Resolution_RegistrationDate = resolution.ProposeDate.Value;
                    row.Resolution_InclusiveNumber  = resolution.InclusiveNumber;
                }
                row.Resolution_RegistrationUser = resolution.ProposeUser;

                // CLASSIFICATORE
                row.Category_ID          = cat.Id;
                row.Category_Description = cat.Name;
                row.Category_Code        = cat.Code.ToString(CultureInfo.InvariantCulture);
                row.Category_FullCode    = cat.FullCodeDotted;


                // CONTENITORE
                if (resolution.Container != null)
                {
                    row.Container_ID          = resolution.Container.Id;
                    row.Container_Description = resolution.Container.Name;
                }

                if (resolution.Status != null)
                {
                    row.Resolution_Status = resolution.Status.Description;
                }

                _resolutionDataSet.ResolutionDataTable.Rows.Add(row);
            }
            DataSource = _resolutionDataSet;
        }