﻿<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:nlo="http://nulllogicone.net/schema.rdfs#" xml:base="http://nulllogicone.net/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <nlo:TopLab rdf:about="TopLab/81809c56-e1e5-4173-a926-9e59df8ee6ed">
    <dc:date>2026-07-26T18:09:01</dc:date>
    <dc:publisher rdf:resource="http://nulllogicone.net" />
    <nlo:topLabGuid>81809c56-e1e5-4173-a926-9e59df8ee6ed</nlo:topLabGuid>
    <nlo:stammGuid>5ccbf5a3-4074-4e3c-a719-faf98eb7b02a</nlo:stammGuid>
    <nlo:postItGuid>4214d8ac-e017-4f26-be0a-55dbb2f53358</nlo:postItGuid>
    <nlo:titel>Der Control Code</nlo:titel>
    <nlo:topLab>&lt;pre&gt;// der Code vom ascx Control
// ----------------------------

using System.Globalization;
using System.Threading;

public delegate void DayRenderHandler (object sender, DayRenderEventArgs e);

public partial class BelegungsplanControl : System.Web.UI.UserControl
{
    public event DayRenderHandler DayRender;

    HtmlTable tbl;
    HtmlTableRow row;
    HtmlTableCell cell;

    string[] monate;
    string[] tage;

    public string Jahr = "2007";

    protected void Page_Load(object sender, EventArgs e)
    {
        monate = DateTimeFormatInfo.CurrentInfo.MonthNames;
        tage = DateTimeFormatInfo.CurrentInfo.ShortestDayNames;

        tbl = new HtmlTable();
        PlaceHolder1.Controls.Add(tbl);

        createHeader();

        for(int monatIdx = 0; monatIdx &lt; 12; monatIdx++)
        {
            // neue Zeile für den Monat
            row = new HtmlTableRow();
            tbl.Rows.Add(row);

            // Monatsname
            cell = new HtmlTableCell();
            cell.InnerHtml = monate[monatIdx];
            row.Cells.Add(cell);

            // Der erste Tag im Monat
            DateTime day = DateTime.Parse(Jahr + "-" + 
(monatIdx+1).ToString() + "-1");

            // leere Zellen bis zum richtigen Wochentag
            for (int leer = 0; leer &lt; (int)day.DayOfWeek; leer++)
            {
                cell = new HtmlTableCell();
                cell.InnerHtml = "-";
                row.Cells.Add(cell);
            }

            // Die Tage des Monats füllen
            while (day.Month == (monatIdx + 1))
            {
                cell = new HtmlTableCell();
                cell.InnerHtml = day.Day.ToString();
                row.Cells.Add(cell);

                // Ereignis auslösen
                if (DayRender != null)
                {
                    DayRenderEventArgs drea = new 
DayRenderEventArgs(day,cell);
                    DayRender(this, drea);
                }

                // nächster Tag
                day = day.AddDays(1);
            }
        }
    }

    // erstellt die erste Zeile mit den Wochentagsnamen
    private void createHeader()
    {
        row = new HtmlTableRow();
        tbl.Rows.Add(row);

        // leere Zelle
        cell = new HtmlTableCell();
        row.Cells.Add(cell);

        // 5 Wochen aneinander hängen
        for (int i = 0; i &lt; 5; i++)
        {
            foreach(string tag in tage)
            {
                cell = new HtmlTableCell();
                cell.InnerHtml = tag;
                row.Cells.Add(cell);
            }
        }
    }
}
&lt;/pre&gt;

</nlo:topLab>
    <nlo:url />
    <nlo:lohn>0.8500</nlo:lohn>
    <nlo:datum>2007-01-16T00:06:14</nlo:datum>
    <nlo:typ>htm</nlo:typ>
    <nlo:datei rdf:resource="" />
  </nlo:TopLab>
</rdf:RDF>