All pastes #758613 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-02 12:25 UTC
rendered paste body
    private void PopulateControl(Control c, Applicant a)
    {
        switch (c.ID)
        {
            case "ApplicantID":
                PopulateControl(c, a.ApplicantID);
                break;
        }
    }

    private void PopulateControl(Control c, object o)
    {
        if (c is DatePicker)
            ((DatePicker)c).Date = o;
        else if (c is TextBox)
            ((TextBox)c).Text = o.ToString();
        else if (c is CheckBox)
            ((CheckBox)c).Checked = (bool)o;
    }