Esempio n. 1
0
    private void viewStateNew()
    {
        List <Brevet> brevetList = new List <Brevet>();
        BrevetDAO     brevetDao  = new BrevetDAO();

        brevetList = brevetDao.GetAllBrevets();
        DateTime myDate;
        string   myString;

        for (int i = 0; i < brevetList.Count; i++)
        {
            myDate   = brevetList[i].BrevetDate;
            myString = myDate.ToString("yyyy-MM-dd");

            listBoxClubs.Items.Add(new ListItem(brevetList[i].Distance.ToString() + ": " + myString + ", " +
                                                brevetList[i].Location, brevetList[i].BrevetId.ToString()));

            ddlDistance.Items.Add(brevetList[i].Distance.ToString());
            ddlYear.Items.Add(myString);
            ddlLocation.Items.Add(brevetList[i].Location);
        }


        if (brevetList == null)
        {
            listBoxClubs.Items.Add("No Brevets Found!");
        }
    }
Esempio n. 2
0
    //CREATE LIST
    private void createBrevetList()
    {
        List <Brevet> brevetList = brevetDAO.GetAllBrevets();

        ListBoxBrevets.Items.Clear();
        if (brevetList == null)
        {
            showErrorMessage("DATABASE TEMPORARILY OUT OF USE (see Database.log)");
        }
        else
        {
            foreach (Brevet brevet in brevetList)
            {
                String text = brevet.Distance + "km, " + brevet.BrevetDate.ToString("yyyy-MM-dd") + ", " + brevet.Location;

                ListItem listItem = new ListItem(text, "" + brevet.BrevetId);
                ListBoxBrevets.Items.Add(listItem);
            }
        }
    }