Ejemplo n.º 1
0
        /// <summary>
        /// Populates the data abou the current state of different visitor groups
        /// Takes an array of labels as a parameter, from which 0th label - for present
        /// 1st label - for expected
        /// 2nd label - fro total
        /// </summary>
        /// <param name="lbls"></param>
        static public void PopulateVisitorGroupData(Label[] lbls)
        {
            int nmbrTotal, nmbrExp, nmbrPres;

            VisitorsDb.GetNmbrOfVistrPerStatus(out nmbrTotal, out nmbrExp, out nmbrPres);
            try
            {
                lbls[0].Text = nmbrPres.ToString();
                lbls[1].Text = nmbrExp.ToString();
                lbls[2].Text = nmbrTotal.ToString();
            }
            catch
            {
                Console.WriteLine("okay, didn't work");
            }
        }
Ejemplo n.º 2
0
        static public void PopulateCampersAndBuyersData(Label[] lbls)
        {
            int nmbrWithCamps, nmbrGroups, nmbrBuyers;

            VisitorsDb.GetNmbrOfCampersAndBuyers(out nmbrWithCamps, out nmbrGroups, out nmbrBuyers);
            try
            {
                lbls[0].Text = nmbrWithCamps.ToString();
                lbls[1].Text = nmbrGroups.ToString();
                lbls[2].Text = nmbrBuyers.ToString();
            }
            catch
            {
                Console.WriteLine("okay, didn't work");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Populates the bracelet section of the visitors tab
        /// Fills the data in the gridview and also displays the number of bracelets in total
        /// </summary>
        /// <param name="dgv"></param>
        /// <param name="lblBracNumVal"></param>
        static public void PopulateBraceletSection(DataGridView dgv, Label lblBracNumVal)
        {
            dgv.Rows.Clear();

            List <Bracelet> lb = new List <Bracelet>();
            int             nmbr;

            lb = VisitorsDb.GetAllBracelets(out nmbr);
            lblBracNumVal.Text = nmbr.ToString();

            if (dgv.Columns.Count < 2)
            {
                dgv.Columns.Add("colID", "ID");
                dgv.Columns.Add("colStatus", "Status");
            }
            dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            foreach (Bracelet b in lb)
            {
                dgv.Rows.Add(b.Id, b.Status);
            }
        }